Multi-core implementation

Started by reck, February 24, 2007, 07:49:02 AM

Previous topic - Next topic

reck

There's no doubt that when multi-core support comes to Terragen 2 it's going to be a big benefit. But as an owner of a dual core system I am also seeing the advantages of being able to render with Terragen on one core and being able to still use my computer for other stuff using the other core. Sometimes my renders will take hours or even days and seeing as I only have the one computer that I have to share with my girlfriend it's nice that running Terragen on one core doesn't stop us from using the computer. I've even played games while rendering with no noticeable slow down. So onto the point of the post. When support comes for multicore would it be feasible to specify how many cores to dedicate to rendering? Sometimes you will want to chuck every ounce of power your system has to render an image as fast as possible but it was also be nice to say restrict to one core to get the advantages I mentioned above. Ideally this could be done on the fly. So you could start a render of one evening just using one core and then when I go to bed I could switch the other core over to Terragen during the night. Then if it was still rendering the next day I could turn the second core off again. Is this something that could be implemented?

Will

well terragen uses one core, but by going into the Task Manager, going to processes, and right clicking on tgd.exe then select affinity and uncheck one of the cores and click ok and there you go.


Regards,

Will
The world is round... so you have to use spherical projection.

reck

Will adding/removing cores in the manner during a render not affect terragen stability? Maybe terragen will check how many cores are available when you click the render button and split/allocate whatever to that many cores at that point. Adding/removing cores after this point might cause problems. I don't know, but if its something that has to be built it would be a nice option.

Arandil

Quote from: reck on February 24, 2007, 01:21:50 PM
Will adding/removing cores in the manner during a render not affect terragen stability? Maybe terragen will check how many cores are available when you click the render button and split/allocate whatever to that many cores at that point. Adding/removing cores after this point might cause problems. I don't know, but if its something that has to be built it would be a nice option.

Setting the processor affinity like this is an operating system feature, I don't think it will affect stability at all.

Oshyan

You should be able to specify how many threads/cores are used once the renderer is multithreaded, however I don't think dynamically adjusting that number would be very easy to do. From my experience with other apps that's not something that is generally allowed. But perhaps some of the new versions of the high-end 3D apps do, I'm not sure. Does anyone have experience with that?

- Oshyan

Arandil

Quote from: Oshyan on February 24, 2007, 01:31:41 PM
You should be able to specify how many threads/cores are used once the renderer is multithreaded, however I don't think dynamically adjusting that number would be very easy to do. From my experience with other apps that's not something that is generally allowed. But perhaps some of the new versions of the high-end 3D apps do, I'm not sure. Does anyone have experience with that?

- Oshyan

Ah, I missed the dynamic assumption, have to read the entire post next time.  :-[  I assumed starting the application with some kind of processor affinity.  The best option is if an application supports processor affinity internally, through a command line switch when running the application or something.  You'd otherwise have to use a utility to mask the number of processors to the application.  In any case, I would agree that dynamically changing processor affinity for X number of rendering processes on the fly is not advisable, better to respawn the rendering process with a new affinity setting.

reck

Quote from: Oshyan on February 24, 2007, 01:31:41 PM
You should be able to specify how many threads/cores are used once the renderer is multithreaded, however I don't think dynamically adjusting that number would be very easy to do. From my experience with other apps that's not something that is generally allowed. But perhaps some of the new versions of the high-end 3D apps do, I'm not sure. Does anyone have experience with that?

- Oshyan

Yeah I wondered whether the dynamic bit might not be something that could be implemented. Worth asking though.

nixx

For Win2k/XP, there is xCPU which lets you start an application assigned to a specific CPU only :

http://www.appliedvisual.com/xcpu.htm

For Vista, this is supported by the OS, and here's how you can do it :

http://www.howtogeek.com/howto/windows-vista/start-an-application-assigned-to-a-specific-cpu-in-windows-vista/

All this is probably a bit premature right now, but here's hoping that we will need to use those links really soon ;)

nick
I 'm child, and man, then child again; the boy never gets older