Use less cores when rendering DS4
mikedaddysmooth
Posts: 0
Trying to render an animation, and want to use less cores on my processor. Does anyone know how to lower the priority, so it's not using all the resources at the same time on my machine?
Getting crashes and stuff.
I have Win 7, 64 bit sys, 8 core AMD proc. Black Ed.
Thanks, Mike
Cores.JPG
140 x 213 - 17K
Comments
Same system here 8 cores but with an Intel Processor. When I render in DAZ Studio I always first launch the Task manager then in the processes tab I look for DAZStudio.exe and right click on it to set the Affinity. I always uncheck 2 cores so I can do something else while the rendering is going on. This solution works only for the current DAZ Studio session.
I am looking for a more permanent way to set Studio's processor affinity. It can obviously be done with a manifest file located in the same directory as the exe. I couldn't find any documentation yet explaining how to do that. I only found some info for the exe to run on one proc while I want it to run on 6 proc. Stay tuned :)
Try using WinAFC - http://affinitychanger.sourceforge.net/
Download for the program is under the installation section, second link.
I get great results by dropping DS to just 6 cores, as far as PC use goes. Does Affinity Changer allow you to save a Preset? Or would I be better of writting a script file?
Would it work to make/run a batch file for low priority?
It works on my WindowsXP.
Creating a batch file to run a program at priority belownormal:
Go to the folder where your DAZStudio.exe resides.
Create a new text document with an Editor (txt) (not Word or something like that, that tends to add formatting).
Write:
start /belownormal DAZStudio.exe
save as DS4Low.txt
Rename to .bat (maybe you have to show file extensions first)
Answer with yes to the are you sure question.
Right click on the bat file to create a shortcut on your desktop.
Instead of using the DS icon on the desktop use the DS4Low icon to start DS.
For Poser it's the same procedure with
start /belownormal Poser.exe
or
Poserpro.exe
or ...
Just make an "Affinity" batch file.
The key bit is that you have to understand that the value following the /affinity switch is a hex mask. It basically boils down to this:
1 = OFF OFF OFF ON
2 = OFF OFF ON OFF
3 = OFF OFF ON ON
4 = OFF ON OFF OFF
5 = OFF ON OFF ON
6 = OFF ON ON OFF
7 = OFF ON ON ON
8 = ON OFF OFF OFF
9 = ON OFF OFF ON
A = ON OFF ON OFF
B = ON OFF ON ON
C = ON ON OFF OFF
D = ON ON OFF ON
E = ON ON ON OFF
F = ON ON ON ON
Another thing to note is that you need an affinity mask for each 4 CPUs (including hyperthreaded CPUs if you have them). So if you have a 6 CPU machine with hyperthreading (shows as 12 CPUs on the task manager) you'll need THREE values for affinity. The values are from the upper end to the lower end of CPUs in order. So if you wanted everything but CPU0 dedicated to DAZStudio you'd do:
altering the path to your DAZ Studio executable as needed. Save that code as a "start_ds.bat" and use that to launch DAZ Studio from now on and it'll always start using all but one CPU.If you only have 8 cores, you'd just drop the first affinity mask... If you have 24 cores, then lucky you, and you want to use all but 1 of them for DS, again it'd be FFFFFE for the affinity mask.
Hope that helps.
Thx Adam. I am gonna try this. Seams reasonable since it doesn't require to install some special software and only tweaks (messes?) with the system scheduler. I read something about this solution this afternoon on MSDN. I thought it was only available on SQL or IIS servers though.
Does your knowledge have a limit? LOL
Yeah, it does, but then I go ahead and try things anyway. Sometimes it works. Sometimes it doesn't and I have to get a bigger hammer...
For those who aren't following this... Basically what you do (in a more step by step fashion) is:
1) Create a new file, call it "start_ds.bat". Make sure you have viewing of file extensions enabled. (Right click, new text document, "start_ds.bat" and answer yes when it asks you if you're sure you wish to change the extension).
2) Find where DAZ Studio is installed. Most likely: c:\program files\DAZ 3D\DAZStudio4\ if you've installed things with the default file locations.
3) Know how many CPU cores you have (look at the Task Manager and count!)
4) For every Four CPU cores you have determine how many you want to use. E.g., You have 8, you want to use 6, You have 12, you want to use 11...
5) Use the chart above to determine each bit of the affinity mask. E.g., to use 6 of 8, you want F and C, to use 11 of 12, you want FFE.
6) Right click on your new start_ds.bat file and select "edit".
7) copy and paste the line below into the notepad window
8) Replace the and entries with the appropriate answers as determined in steps 2 and 5.
9) Save and close the file.
Try it. :)
ETA: For what it is worth...
Answer2: c:\program files\daz 3d\DAZStudio4
Answer3: 8
Answer4: 6
Answer5: FC
Result:
Answer2: e:\daz\studio4.64
Answer3: 12
Answer4: 11
Answer5: FFE
Result:
Thanks all, some interesting stuff, but Erdehel hit it on the head, don't really need to go into the bowels of the system. Going into Task Mgr. took care of it.
I appreciate everyone's input. Thanks again.
Mike
thanks Kerya, going to make life easier this is, i tend to forget otherwise, till I start rendering ;-)
I had been searching for an answer online for days until I stumbled on this thread.
Im not sure why, what, or how, but since I started using the 4.6 beta things changed for me during renders.
Before I could set the renderer and leave it in the background while I surfed the net, watched streaming videos, muck around in after effects or photoshop as the frames were rendered....then nothing. Id set the render and the computer basically lags out only responding to input during the few seconds after completing a frame render before moving to the next (i only render image series)
So after reading this thread I learned I could set affinity. I have the 8 core black amd as well. I set it to use only 6 cores and ho lee fuk, not only could I use my computer again, but the actual render time of each frame dropped nearly 40% (5 minutes a frame to 3)
Not sure if its something on my end, or a bug in the 4.6 public beta, but im back baby...chugging out the frames while listening to NFL network stream online, doing postwork in AE and not lagging a bit.
thanks!!
I'm trying to make this works, but no result, the bat can't find the program
My Daz is installed in D:\DAZ 3D\DAZStudio4\
so I wrote this :
c:\windows\system32\cmd.exe /c start /affinity C D:\DAZ 3D\DAZStudio4\DAZStudio.exe
But no luck, I always got "Windows can't find D:\DAZ"
Oh, just for confirmation, must I used affinity mask "C" or "3" for 4 Cores CPU and only want use 2, still pretty confusing for me
Thank you
At a guess it's down to the file name in the path, put quotes around the full path:
Grrrr, I didn't get email notif for the reply in this thread, sorry for the very late reply. I see, I'll try that out, thank you Simon
To make it works with windows 7, I had to do small changes:
ex for the ds beta with 6 of my 8 threads (i7):
and to answer the first question you can do the same with /<priority> instead or in add to the /affinity
replace <priority> by the wanted one:
Realtime
High
AboveNormal
Normal
BelowNormal
Low
ex:
but I prefer less threads to lower priority
Thanks for the info on this topic. I was hoping that there would be some kind of setting within DS itself that would tell it how many cores to use, and it's disappointing to discover that there isn't. I have a fairly modest machine (Win7 64-bit, 8 GB RAM, i7 quad-core, nVidia 2 GB), and multi-tasking while DS is rendering is difficult bordering on forget about it, and rendering with Lux via Reality is even worse. Any chance of getting a throttle feature (letting the user choose how many cores DS can use at any one time) added to DS 5?
Interestingly I wrote a DS plugin a few months ago that lowers the DS process priority during a render (and restores it after the render is finished). Did it mainly because I got tired of having to go to the task manager to lower the process priority by hand.
Didn't think it had any commercial value and wasn't really keen on dealing with people that would complain renders would take slightly longer, so it's just something I've kept to myself (well one other beta tester). But it's been pretty handy.
There would be a HUGE market for it.. please sell it!
I had to dig up this thread today, Thanks for the instructions, Adam, worked great. A nice little easy to use script would be even better though. =)
I'd buy that script.
so would I
Depending on the version, the task manager has an option to assign a core.