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 » Fri Jan 05, 2018 2:53 am

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: 384
Joined: Sun Jan 15, 2017 8:40 pm
Location: Russia, Korolev
Contact:

Re: Setting affinity for tasks

Post by timurhai » Fri Jan 05, 2018 5:13 pm

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 2.3.0 Debian 9, Ubuntu 18.04LTS, MS Windows 7,10 (client only).

jhowe
Posts: 6
Joined: Tue May 23, 2017 1:02 pm

Re: Setting affinity for tasks

Post by jhowe » Fri Jan 05, 2018 7:01 pm

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

Who is online

Users browsing this forum: No registered users and 1 guest