Use less cores when rendering DS4

mikedaddysmoothmikedaddysmooth Posts: 0
edited December 1969 in Technical Help (nuts n bolts)

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

Comments

  • ErdehelErdehel Posts: 193
    edited May 2012

    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 :)

    Post edited by Erdehel on
  • MattymanxMattymanx Posts: 3,405
    edited December 1969

    Try using WinAFC - http://affinitychanger.sourceforge.net/

    Download for the program is under the installation section, second link.

  • JaderailJaderail Posts: 0
    edited December 1969

    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?

  • KeryaKerya Posts: 7,186
    edited December 1969

    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 ...

  • adamr001adamr001 Posts: 0
    edited December 1969

    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:

    c:\windows\system32\cmd.exe /c start /affinity FFE c:\program files\daz\studio4\dazstudio.exe
    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.

  • ErdehelErdehel Posts: 193
    edited December 1969

    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

  • adamr001adamr001 Posts: 0
    edited May 2012

    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

    c:\windows\system32\cmd.exe /c start /affinity  \dazstudio.exe

    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:

    c:\windows\system32\cmd.exe /c start /affinity FC c:\program files\daz 3d\DAZStudio4\dazstudio.exe

    Answer2: e:\daz\studio4.64
    Answer3: 12
    Answer4: 11
    Answer5: FFE

    Result:

    c:\windows\system32\cmd.exe /c start /affinity FFE e:\daz\studio4.64\dazstudio.exe

    Post edited by adamr001 on
  • mikedaddysmoothmikedaddysmooth Posts: 0
    edited December 1969

    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

  • IanTPIanTP Posts: 1,271
    edited December 1969

    Kerya said:
    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 ...


    thanks Kerya, going to make life easier this is, i tend to forget otherwise, till I start rendering ;-)

  • crudlercrudler Posts: 1
    edited September 2013

    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!!

    Post edited by crudler on
  • Yonas AngYonas Ang Posts: 108
    edited December 1969

    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

  • SimonJMSimonJM Posts: 2,898
    edited December 1969

    At a guess it's down to the file name in the path, put quotes around the full path:

    c:\windows\system32\cmd.exe /c start /affinity C "D:\DAZ 3D\DAZStudio4\DAZStudio.exe"

  • Yonas AngYonas Ang Posts: 108
    edited December 1969

    SimonJM said:
    At a guess it's down to the file name in the path, put quotes around the full path:

    c:\windows\system32\cmd.exe /c start /affinity C "D:\DAZ 3D\DAZStudio4\DAZStudio.exe"

    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

  • siocsioc Posts: 265
    edited May 2014

    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):

    C:\Windows\System32\cmd.exe /c START "DAZStudio.exe" /affinity 3F "C:\Program Files\DAZ 3D\DAZStudio4 Public Build\DAZStudio.exe"

    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:

    C:\Windows\System32\cmd.exe /c START "DAZStudio.exe" /AboveNormal "C:\Program Files\DAZ 3D\DAZStudio4 Public Build\DAZStudio.exe"

    but I prefer less threads to lower priority

    Post edited by sioc on
  • Kevin-McKeeKevin-McKee Posts: 645
    edited December 1969

    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?

  • msorrelsmsorrels Posts: 44
    edited December 1969

    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.

    renderpri.png
    485 x 170 - 28K
  • FistyFisty Posts: 1,692
    edited December 1969

    msorrels said:
    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. =)

  • VaskaniaVaskania Posts: 5,108
    edited December 1969

    I'd buy that script.

Sign In or Register to comment.
Rocket Fuel