Adapt Thread Priority doesn't work for C4D?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 10 October 2012   #1
Adapt Thread Priority doesn't work for C4D?

Hello everyone.

I have Adapt Thread Priority enabled, but it doesn't seem to apply to Cinema 4D itself.

When I have a render going, C4D is crushingly unresponsive. Even in light scenes of just a few hundred faces and performing the most basic tasks, like panning or zooming, it takes a good second or two to respond.

I've even lowered the task priority in the Task Manager to low, but it doesn't help much (it does a little).

Every other app is quite nicely responsive. The computer itself doesn't slow down, just C4D.

It's quite a productivity crippler to not be able to work smoothly when a render is going (which is almost all the time).

Basically - any help to ease the situation?
 
Old 10 October 2012   #2
right, because C4D is the task, you can't prioritize the renderer separate form the rest of the app like that. You could run two instances of C4D to do that I guess. Your other option is to go into the C4D prefs and limit the threads. It can be a notable sacrifice as every render you do will now not utilize the full system when it can, but it keeps the rest of the app nice and responsive and easier to stop renders too. I personally always opt to keep one thread less than I have cores/multithreads. Yes I'm losing some speed from rendering but I need to be able to work fast. If I'm leaving a render to go overnight then I"ll change the pref back and leave, but while working I"m always using 10 or 11 as a preference on my 6 core/12 thread system. My efficiency in working is far more important than my computers efficiency at rendering.
__________________
Quote: "Until you do what you believe in, how do you know whether you believe in it or not?" -Leo Tolstoy
Kai Pedersen
 
Old 10 October 2012   #3
Don't lower the priority but restrict CINEMA 4D to use one or more cores less.
On Windows you can use a batch job with Start /affinity to define this on start
Cheers
Björn
__________________
- www.bonkers.de -
The views expressed on this post are my personal opinions and do not represent the views of my employer.
 
Old 10 October 2012   #4
When rendering, it really does make the machine unusable. You can use windows manager to set priority, but also affinity. This lets you "reserve" some cpu cores for other tasks, and you can change it on the fly (as opposed to the render threads preference, which doesn't change until after you stop the current render. )

But the problem is the main gui and renderer are not differentiated in the task manager.

I end up having to use a mix of strategies. If I want to continue to model in C4D while a render is running, I keep the task manager setting to all cores and normal priority, and use the render thread option (I have a script button to toggle the setting). If I want to render while using the computer for other activities, but still render as fast as possible, I use the task manager to knock the task priority down to below normal or low, and maybe disable a couple cores in the affinity settings if priority alone doesn't make the system responsive enough. (Same for net render). I find that low priority usually keeps the system responsive while still using up all available cpu cycles. Before letting the machine render overnight, I double check the affinity is set to all cores, something you can change on the fly, unlike the render thread preference.

All of what I do manually is what I understand "adapt thread priority" is supposed to (used to?) do for us. sigh. .

I recommend an app called prio, which extends the windows task manager in a couple ways...one, you can set I/O priority as well, which helps in a few cases. Two, it will remember your priority and affinity settings every time the same app is launched. By making a copy of the c4d exe and renaming it, I can have two sets of default priority and affinity settings for gui and net render.

Another piece of stupid is that C4D doesn't set the appropriate flags on the thread to prevent windows from going into standby.
 
Old 10 October 2012   #5
I should add that adjusting the affinity in task manager doesn't work for multi-frame animations. C4D resets the affinity flags at the start of each rendered frame.
 
Old 10 October 2012   #6
Thanks for all the input.

Perhaps there's a case for separating the renderer from the main app, like what Maya does with its batch renderer.

Kai, how do I run a 2nd instance of C4D? It doesn't seem to let me by default.
 
Old 10 October 2012   #7
The command line option -parallel lets you run a second copy at the same time.
 
Old 10 October 2012   #8
Originally Posted by eikonoklastes: Hello everyone.

I have Adapt Thread Priority enabled, but it doesn't seem to apply to Cinema 4D itself.

When I have a render going, C4D is crushingly unresponsive. Even in light scenes of just a few hundred faces and performing the most basic tasks, like panning or zooming, it takes a good second or two to respond.

I've even lowered the task priority in the Task Manager to low, but it doesn't help much (it does a little).

Every other app is quite nicely responsive. The computer itself doesn't slow down, just C4D.

It's quite a productivity crippler to not be able to work smoothly when a render is going (which is almost all the time).

Basically - any help to ease the situation?


Windows uses a concept of thread priorities and dynamic priority boosts - you can read about this here: http://www4.cs.fau.de/Lehre/WS06/V_...Windows-2x2.pdf (warning: it's in german, you might need to translate this) and Windows does a lot of fuss to compensate for the lack of a good multitasking scheduling strategy (in other words: OS X & Linux do proper multitasking even under heavy load, Windows most of time fails).

You can observe the same behaviour you have in other cpu demanding application on Windows too. E.g. if you're compiling a heavy project with Microsoft's Visual Studio IDE (using INtel's compiler), the machine and esp. Visual Studio is not usable anymore. Try the same with XCode on OS X or Eclipse on Linux and it works fluid.


I think we had a similar discussion (it was about switching the OS) a few month ago here at cgtalk where someone just claimed "this behaviour shows how efficient Windows uses the cpu"). Here you go...

If you have to use Windows, you:
- should Enable "Adapt thread priority"
- and can reduce the number of Render threads

How does "Adapt thread priority" work?
Windows starts an application with the default priority unless you start it via an external shell/program with lowered priority (or change that priority in the task manager). "Adapt thread priority" then sets the priority to "Below normal" for render threads.
Note that "Below normal" thread priority is relativ to the programs (process) priority. If the process priority of the program/process is lowered (e.g. in the task manager), the "below normal" thread priority is below this process priority. Have a look at the above mentioned pdf for more details.

If you've disabled "Adapt thread priority" the render threads have the same priority as the process (which is not what you want).

Best regards,

wbj
 
Old 10 October 2012   #9
Quote: I should add that adjusting the affinity in task manager doesn't work for multi-frame animations. C4D resets the affinity flags at the start of each rendered frame.


I have the same problem since R14 in combination with Win 7. Cinema and Netrender are now resetting the affinity settings in the task manager after each frame they render....
Usualy i used netrender to keep on working in Cinema and and took away 1 or 2 cores from netrender to have some overhead to be able to fluidly working.

A workaround for the affinity problem is to use the the preferences in Netrender instead of using the Taskmanager affinity. There you can set how many threads (cores) the netrender should use. Like Lucent dreams already described.

But i prefered the Taskmanger method as you can easily forget to set back the netrender to full throttle. I just asked the German support about that, but they didnt seem to be aware of the problem (which came up with R14).
 
Old 10 October 2012   #10
Because I kept forgetting if render threads was limited or not, I put this trivial COFFEE script in a button on my render palette, right next to the render button...it will toggle the render thread limiter, and the icon will highlight if the render thread limiter is active.

I use an icon of a speed limit sign.

in the menu state section:


  CHECK=prefs(465001630)#PREF_RENDERER_THREADCUSTOM;  
     ENABLE=TRUE;
      

script
------------
main(doc,op)
     {
       if (prefs(465001630)#PREF_RENDERER_THREADCUSTOM) 
     	{ 	
     		prefs(465001630)#PREF_RENDERER_THREADCUSTOM=FALSE;  
     		println ("Render threads not limited");
     	}
     	else
     	{
     		prefs(465001630)#PREF_RENDERER_THREADCUSTOM=TRUE;
     		prefs(465001630)#PREF_RENDERER_THREADNUMBER=8;  // SET THIS TO THE NUMBER OF THREADS YOU WANT WHEN LIMITED
    	   println ("Render threads limited to " , prefs(465001630)#PREF_RENDERER_THREADNUMBER);
     	}
     }
     
 
Old 10 October 2012   #11
Where did you get this ID# from selmo? : 465001630
I searched through all the files and I couldn't find where this comes from.

-ScottA
__________________
My Gallery
 
Old 10 October 2012   #12
The sript is nice. But with using Netrender it doesent help me.
I hope that Maxon will fix the behaviour in the future...
 
Old 10 October 2012   #13
Originally Posted by Scott Ayers: Where did you get this ID# from selmo? : 465001630
I searched through all the files and I couldn't find where this comes from.

-ScottA


Open the script log (via the script menu) and it will echo most commands that you do in the GUI as lines of python and coffee. Copy and paste for easy scripting, no documentation required. A very cool feature.

Since the code is generated by c4d, using it's internal dictionary of IDs, one would presume it to be more complete, current, and accurate than the documentation. I don't know if it filters or exposes IDs that are not meant to be public (the developers may change them in a future release) but the scripts work.

It's not quite a macro recorder tho -- not everything you do is echoed. It's limited to commands and some commands need context ( for example, the log may record a command as "import an object from the content browser" but there is no scripted recording of what object you picked in the content browser to import).
 
Old 10 October 2012   #14
Originally Posted by doppelmonster: The sript is nice. But with using Netrender it doesent help me.
I hope that Maxon will fix the behaviour in the future...


I find setting netrender to low or idle priority (via task manager) is usually enough to tame it, even with it set to all cores affinity. Is that not working well for you?
 
Old 10 October 2012   #15
Originally Posted by selmo: Since the code is generated by c4d, using it's internal dictionary of IDs, one would presume it to be more complete, current, and accurate than the documentation. I don't know if it filters or exposes IDs that are not meant to be public (the developers may change them in a future release) but the scripts work.


I was afraid you'd say that you got them from the SL. Because That's the only way I know how to get them too. Which is a bad thing because we can't always rely on the SL. So I always look for where the ID's are actually stored.
The ID's for everything (or so I thought) are all stored in .h files in the Maxon folder structure.
That's where they come from. And that's where the program looks them up.

However... I can't find the header file with the ID#'s for the preferences in them.
The ID's for the names of the preferences can be found in the ge_prepass.h file. But not their numerical equivalents(starting with 465001620).
They have to come from a file on the system somewhere. But I can't find the file they are being pulled from.
I suppose it's possible that Maxon has these number hard coded into a .dll file where the users can't get at them. But I've never seen that before.
Usually every ID has a corresponding .h file and/or .res file somewhere in the file structure. It's just a challenge to find them sometimes.

-ScottA
__________________
My Gallery
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 06:31 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.