Maximum Number of Threads

Started by echrei, June 18, 2010, 12:34:44 am

Previous topic - Next topic

echrei

I just built a new machine with Terragen in mind. It uses two 6-Core Xeons for a total of 24 threads. I'm running Win7 64-bit Ultimate and plan to put Mac OS on it. I haven't had much luck rendering complex scenes with even half the total threads. If I just open TG up and render the default scene with all 24 threads, it runs fine. If I add some terrain and water and try to render, I get a bunch of errors such as "An unknown error occurred in a render thread", "An unknown error occurred in TraceRay", and "An unknown error occurred in trBucketRender::RenderMore() ray-traced pass".

I have try changing the subdiv cache and setting it to preallocate it. If I set it to preallocate it, the errors show up immediately rather than part way through the render. I tried it with limiting it to 12 threads and still ran into the problem. If I let it keep rendering, I get spammed by errors from the Microsoft Visual C++ Runtime which ends with Terragen quitting.

Is there any way I could use the full potential of my computer to render?
15" MacBook Pro / 2.6GHz Penryn C2D / 4GB RAM / 500GB 7200RPM HDD / 8600M GT 512MB
Hackintosh / Dual X5680 @ 4.2GHz / 12GB RAM / 2TB HDD / GTX 480+260

antti

Congratulations on your new computer!
Planetside and more experienced users can probably give better answers, but I think that the issues you are facing are memory related. Increasing subdiv cache may help with some scenes but as long as Terragen is a 32-bit application, you probably can't increase the cache enough to utilize all (or most) of the available threads. I am running with two 4-core Xeons (a total of 16 threads) and at the moment I have found it best to run several Terragen processes simultaneously. At the very moment I am running 4 Terragens, each limited to 4 cores, which is very convinient as I am doing an animation with lots of frames. Sometimes I run with 5 Terragens, each with 3 cores. I think that this pretty much gives the best calculation power with the animation I am working on. With big still frames one can use cropping to split the image to several parts (preferably with some overlapping) that can be rendered simultaneously and combined afterwards. Here one just has to remember to set the ray detail region and/or padding settings properly so that the different parts will match. There has been some discussion on that, e.g. http://forums.planetside.co.uk/index.php?topic=7019.msg74707#msg74707 and http://forums.planetside.co.uk/index.php?topic=9466.0

jo

Hi,

I typically run TG2 with 16 threads without problems, although I'm not often rendering particularly intensive scenes. It will often render somewhat faster with less threads, 8 or 12 for example. This is because even there is overhead from running so many threads which can end up slowing things down.

With the 32 bit version I don't think running with 24 threads would be such a good idea because even with a smaller subdiv cache, for example 100 MB per thread, that still ends up being 2400 MB which doesn't leave a lot of memory free for other things.

I think you need to experiment with scaling back the number of threads and then with the subdiv cache amounts so you can find the best performance balance for the typical scene you render. There is no one answer to this for everyone.

When the 64 bit version is available you'll be free to allocate more memory for the subdiv cache, but until we can really optimise the threading overhead you still might find that 24 threads is too many.

You might be interested to know that the threading overhead is greater ( i.e. ends up with slower rendering ) on OS X than Windows.

Regards,

Jo

echrei

I'm currently rendering 6 copies of Terragen with 4 threads each. I've still gotten a rasterize error on one with 4 threads and am trying it again, but most scenes seem to be working well.
15" MacBook Pro / 2.6GHz Penryn C2D / 4GB RAM / 500GB 7200RPM HDD / 8600M GT 512MB
Hackintosh / Dual X5680 @ 4.2GHz / 12GB RAM / 2TB HDD / GTX 480+260

echrei

What could be causing an error in "trBucketRender::RenderMore() rasterised pass"? I'm getting this on some renders with still only using 4 threads?
15" MacBook Pro / 2.6GHz Penryn C2D / 4GB RAM / 500GB 7200RPM HDD / 8600M GT 512MB
Hackintosh / Dual X5680 @ 4.2GHz / 12GB RAM / 2TB HDD / GTX 480+260

Oshyan

What's your memory use like for the instance that is throwing this error? Do you end up with any black/unrendered tiles?

- Oshyan

echrei

July 11, 2010, 12:58:07 am #6 Last Edit: July 11, 2010, 01:00:44 am by echrei
Yeah, it ends up either crashing, leaving one or two tiles black, or just stalling with a bunch of unrendered frames. It looks like the scenes are using over 2GB of memory. My computer has 12GB, but I know TG is 32 bit right now. I've been setting the subdiv cache to 1200 preallocated since I've found higher values in that result in faster renders. Maybe that isn't leaving enough for other stuff? Should I try reducing the subdiv cache and seeing if it finishes rendering then? I'm using 4 render threads per instance of Terragen right now.

Edit: It seems like many of the times it is dying on water tiles.
15" MacBook Pro / 2.6GHz Penryn C2D / 4GB RAM / 500GB 7200RPM HDD / 8600M GT 512MB
Hackintosh / Dual X5680 @ 4.2GHz / 12GB RAM / 2TB HDD / GTX 480+260

Oshyan

Definitely try reducing the subdiv cache. Although larger caches can improve performance, when you're dealing with possible memory issues it pays to stick with the default recommended 100MB/thread, or 200MB at most.

- Oshyan

echrei

Thank you, I'll try that. Do you recommend having Preallocate enabled or disabled?
15" MacBook Pro / 2.6GHz Penryn C2D / 4GB RAM / 500GB 7200RPM HDD / 8600M GT 512MB
Hackintosh / Dual X5680 @ 4.2GHz / 12GB RAM / 2TB HDD / GTX 480+260

Oshyan

If having it enabled has not helped to prevent these issues mid-way in a render, then better to disable it IMO. The idea of using it is that it allocates necessary memory at the beginning of the render, so that if there *is* going to be a memory issue it will show up early before you waste a lot of time rendering. But there are other memory-consuming systems that do change over the render period, so this is not always a safe bet. So as I said if it hasn't really been helping for you, no need to have it enabled. Technically if you set it high and you have it enabled, you may be unnecessarily forcing a memory issue if a cache that size is not actually needed. If you give it a large enough allocation but don't *preallocate*, it can expand to fill the space it needs (in theory, assuming the memory is available by the time it needs it).

- Oshyan

echrei

Thank you, that's what I assumed would be the case.
15" MacBook Pro / 2.6GHz Penryn C2D / 4GB RAM / 500GB 7200RPM HDD / 8600M GT 512MB
Hackintosh / Dual X5680 @ 4.2GHz / 12GB RAM / 2TB HDD / GTX 480+260