Setting affinity for tasks

Installation and configuration.
Post Reply
jhowe
Posts: 6
Joined: Tue May 23, 2017 1:02 pm

Setting affinity for tasks

Post by jhowe »

I would like to set the rendering software CPU affinity to be one less than the total CPU cores for the computer that is running the AFANASY server, just so the system is responsive at all times. I am using Windows 10 and can do this from the Command Prompt by launching Blender using

start /affinity FFFD blender.exe ...

Is there a way to accomplish this easily in the configuration settings? Is it something I can customize for just one render node? This would go well with af_render_nice in the config file.
User avatar
timurhai
Site Admin
Posts: 910
Joined: Sun Jan 15, 2017 8:40 pm
Location: Russia, Korolev
Contact:

Re: Setting affinity for tasks

Post by timurhai »

You can write a .cmd blender command wrapper.
You can use it on one (any) machines.
Or you can set affinity for an entire afrender process, child processes should inherit it.
Timur Hairulin
CGRU 3.3.1, Ubuntu 20.04, 22.04, MS Windows 10 (clients only).
jhowe
Posts: 6
Joined: Tue May 23, 2017 1:02 pm

Re: Setting affinity for tasks

Post by jhowe »

I didn't realize child processes would inherit affinity. That makes this easy, as I just changed the one line in render.cmd from

Code: Select all

"%AF_ROOT%\bin\afrender.exe" %*
to

Code: Select all

start "AF_RENDER" /affinity FFFD "%AF_ROOT%\bin\afrender.exe" %*

and now things are working great. Blender launches with the matching affinity and this is just a quick edit of render.cmd for the one computer running the server. Plus, by posting this here, I will be able to refer to it later when I upgrade to a new version. Thanks for your help, Timur!
Post Reply