Planetside Software Forums

Support => Terragen Support => Topic started by: Mohawk20 on November 14, 2008, 01:52:29 pm

Title: "Unknown error in Thread"
Post by: Mohawk20 on November 14, 2008, 01:52:29 pm
Hmmm, I got a never before encountered error...

I'm rendering an older scene at high resolution (4096 x 3072), and halfway through the image, I get this error:
"An unknown error occurred in a render thread".

I can see nothing wrong in the render, and rendering continues like normal, but still - it's the 'Red Octagon of Sorrow', so something's gone bad.
Title: Re: "Unknown error in Thread"
Post by: Mohawk20 on November 14, 2008, 03:30:32 pm
In addition...
A block (or bucket) that was about to render round the time of the error is still black, though blocks beyond that are already complete.
Since the error, TG2 is only using half the processor capacity, instead of fuul capacity before the error. It's still distributed over both cores though.
Title: Re: "Unknown error in Thread"
Post by: jo on November 14, 2008, 10:34:38 pm
Hi,

You got this message because something went wrong in one of the threads using for rendering. It's running at half processor capacity because it was probably using two threads on two cores, and when the thread got shut down just the remaining one was working. The problem could have been caused by any number of things. To try and investigate it we would need your project file and *all* of the models, image maps etc. used in the scene. If you can get that together, pm me and we can arrange "delivery" :-).

Regards,

Jo
Title: Re: "Unknown error in Thread"
Post by: buzzzzz1 on November 14, 2008, 11:49:52 pm
I think I ran into the same thing? However I'm running a single core P4 and 4 Gig of ram. Here's a couple of screen grabs one showing the errors and another showing where it skipped several buffers and picked up rendering about half way across as you can see.  Where it picked up is in a shadow of a building if you are wondering why it's looks strange. Also min and max threads were at default of 1 and 16.
Title: Re: "Unknown error in Thread"
Post by: Oshyan on November 15, 2008, 12:15:58 am
Buzzzzz, looks like it might be getting up around the 2GB per app limit in a 32 bit OS. Are you running 64 bit? Or do you have the /3gb switch enabled?

- Oshyan
Title: Re: "Unknown error in Thread"
Post by: buzzzzz1 on November 15, 2008, 12:23:05 am
Quote from: Oshyan on November 15, 2008, 12:15:58 am
Buzzzzz, looks like it might be getting up around the 2GB per app limit in a 32 bit OS. Are you running 64 bit? Or do you have the /3gb switch enabled?

- Oshyan


No, 32 bit and yeah I noticed the v memory up around 1.8 gig. Wasn't sure if that was it or not so I started rendering smaller crops and so far so good. Just thought you might like to know.

Thanks Oshyan
Title: Re: "Unknown error in Thread"
Post by: Oshyan on November 15, 2008, 12:30:11 am
What is your cache set to? Default 400MB? You might try lowering it a bit.

- Oshyan
Title: Re: "Unknown error in Thread"
Post by: Mohawk20 on November 15, 2008, 07:12:57 am
The other thread just errored as well, shutting down all processor activity to tgd.exe

Luckily it happened exactly halfway through the image, so continuing from there is easy.
Jo - expect that PM soon!
Title: Re: "Unknown error in Thread"
Post by: buzzzzz1 on November 15, 2008, 10:25:54 am
Quote from: Oshyan on November 15, 2008, 12:30:11 am
What is your cache set to? Default 400MB? You might try lowering it a bit.

- Oshyan


Well the crop crashed over night so I will try lowering the cache, 200 maybe? Dunno? Perhaps an error notice that TG has ran out of memory would be nice?   I've been thinking for a while now that I need to build another machine that will handle TG.  Maybe I can get a Bailout from the US Treasury?    ;)
Title: Re: "Unknown error in Thread"
Post by: Oshyan on November 15, 2008, 06:02:13 pm
From what I have seen it can be quite difficult to handle "out of memory" issues gracefully, and I'm referring to experience with other apps, not just TG. I have always been surprised by this myself and I'm not sure why that seems to be the case, but I experience it a lot. Hopefully we can work out methods such as disk caching (like Photoshop) that will at least allow for graceful handling of those situations, albeit with significantly lower performance.

Ironically if you were running a 64 bit version of Windows you'd probably have no problems, even with your current hardware setup. So you might just consider upgrading to an x64 version of Windows before getting a whole new machine.

As for the cache settings, 200 might help. Make sure you are also only using 1 render thread as the P4 Hyperthreading might be fooling the multi-core detection system (although I think it is usually pretty good about that). The more threads you are using, the higher the memory use.

- Oshyan
Title: Re: "Unknown error in Thread"
Post by: reck on November 30, 2008, 06:15:37 pm
I'm getting quite a few errors with one of my project and this "unknown error" is one of them".

The first error I received was the Microsoft Visual C++ Runtime error. This crashed TG and I had to start again. So I closed it down, rebooted the machine and tried again. This time it got further but now I get the "unknown error". On top of that i've been getting the populator errors/warnings that I see quite a lot as well.

Could this be caused by lack of memory, i've got 4GB? It's not a particularlay high resolution image though that i'm trying to render, only 1024x768.

More details

Vista 32bit
Intel Core 2 Duo
4GB RAM
Terragen 2 Beta

If it could be related to memory should I increase or decrease the subdiv cache? I thought increase it to maybe 2GB because then it would allocate all that memory straight away rather then having to allocate hours later during the render. But I notice eariler in the thread it's recommended to decrease the cache size, why is that?

Should I tick "preallocate subdic cache"?

Also any other ideas how I can it to render without crashing?

I plan to move over to 64bit after Christmas but with Windows 7 due next year as well i'll probably wait and buy a 64x bit version of that rather than a 64 bit version of vista.


Title: Re: "Unknown error in Thread"
Post by: Mohawk20 on November 30, 2008, 06:28:48 pm
Yeah, I have this strange thing...
I'm rendering a 4096x3072 image, done those lots of time. In the mean while I look at some nodes in the main window. All of a sudden I get this Visual C error. I know that if I click 'OK' TG2 will shut down. So I didn't...

The render is going and going, finishing buckets for a bout 140 hours since. It's almost halfway now. If the render finished in about 300 hours, will I be able to save it, or does the Visual C error prevent the save interface screen to open?
Title: Re: "Unknown error in Thread"
Post by: reck on November 30, 2008, 06:57:17 pm
well not sure if I should increase or decrease the subdiv cache. Going to guess I should increase it so going to double it 800MB and click  preallocate subdiv cache and see what happens. Going to bed now so i'll take a look in the morning.

Hope I wasn't supposed to decrease the subdiv cache.
Title: Re: "Unknown error in Thread"
Post by: jo on November 30, 2008, 10:02:16 pm
Hi,

Decreasing the subdiv cache is a good idea because it frees up memory to be used for other things during rendering which might otherwise run out. I think the preallocation thing helps because it allocates the memory up front and can a) allocate big chunks of memory without fragmentation problems and b) possibly cause the render to fail earlier. That's not a great thing, obviously, but better than waiting for ages and then having it fail.

I'm not really that certain about TG2s memory allocation patterns during rendering, that's more Matt's area, but I hope to get more familiar with it very soon to help make things more robust before final release. It's possible that when memory use is starting to get high then memory allocation might fail even though it seems like there's a decent amount left because the memory is broken up ( fragmented ) and there is no one area large enough for the required allocation. This is even though it might seem like there's quite a bit left. It isn't a situation which is easy to get around. I've been doing some experiments with this lately.

I have found that the various thread render errors can be caused by running out of memory. We're going to be looking into this in the next little while to see if we can improve things.

Even though you have 4 GB of memory, on a 32 bit Windows OS ( including Vista AFAIK ) applications can only use up to 2 GB, unless you have the 3GB switch turned on. Most of the time when we're talking about lack of memory, the problem isn't really that you lack RAM in your machine, it's more that your scene currently requires more memory than the OS will let the application use.

Regards,

Jo
Title: Re: "Unknown error in Thread"
Post by: reck on December 01, 2008, 03:59:59 am
I see, so it sounds like I should have decreased the subdiv cache.

When I got up this morning I could see that the GI prepass didn't even complete with the cache set at 700. Before I came to work I set the cache to 200 and restarted so we will see what happens when I get home tonight.

It seems with TG a 32bit OS is really starting to become a major limitation. I don't think this scene is a particularly demanding one, it has 2x populations of grass, 1x population of trees and a couple of single objects in there, the rendering resolution is 1024x768 at 0.8. I was hoping to start increasing my resolutions in future and also have scenes with more populations, but this seems like i'll never be able to render them because of the 2GB limit on each application. If I understand correctly 64x OS's can allocate up to 4GB per application but is this even enough when wanting to render higher resolutions with lots more populations?
Title: Re: "Unknown error in Thread"
Post by: jo on December 01, 2008, 05:09:42 am
Hi Reck,

I think the 2 GB limit is more of a limitation than we originally thought it would be, but on the other hand I still think there are a lot of things we can do to improve matters. TG2 on 64 bit Windows as it is can use up to 4 GB, so that's an improvement. After final release we'll be working on a 64 bit version of TG2, and that should be a massive improvement for those with a 64 bit machine and OS.

OS X is able to use more memory at the moment, up to about 3.2 GB usually.

It would be helpful if you could send us your entire scene. If you have somewhere you can upload and then email me the link ( jomeder@planetside.co.uk ) to download it, that would be great. It sounds like it should be possible to render your scene, it doesn't sound extreme, so it would be interesting to try it out.

Regards,

Jo
Title: Re: "Unknown error in Thread"
Post by: reck on December 01, 2008, 03:45:16 pm
Well it's been rendering all day with the cache size set to 200MB and it's got further than before, 2-3rds done now so when I get up tomorrow hopefully it will have completed ok.

If it crashes again i'll send the file over Jo.

Thanks
Title: Re: "Unknown error in Thread"
Post by: reck on December 02, 2008, 04:01:48 am
The good news is that reducing the cache size down to 200MB made the render complete with no errors  ;D

So should I set 200MB as my default size for future projects instead of the normal 400MB, what about 100MB? There must be a disadvantage to using smaller cache sizes otherwise the default would be a lot smaller than 400MB.
Title: Re: "Unknown error in Thread"
Post by: Matt on December 07, 2008, 01:07:21 pm
Yes, there can be a disadvantage to using a smaller subdiv cache. It might slow the rendering speed if you have a scene with lots of reflections, or rendered at high resolution and/or detail. It is more of a problem if you are rendering with more threads, because each thread is only allocated a small part of the total subdiv cache. In general it's difficult to predict what will be the best size to use. If you're working on a long-running project, it's probably worth spending some time testing different setups. Otherwise, stick to the default value and maybe reduce it if you get errors during rendering or if you know TG is using too much memory.

Matt
Title: Re: "Unknown error in Thread"
Post by: reck on December 14, 2008, 07:58:07 am
I'd missed this reply but i'm glad I noticed it because i'd knocked the cache down in size and saved it as default. I'll move it back now that i've read this and alter as needed.

Thanks