[Arnold] Setting core affinity aka pinning threads

Instead of setting the core affinity yourself, you should let Arnold do it. By default, Arnold pins threads (sets the affinity) if you use more than half the cores on the machine.

If you really must set affinity yourself, you can use the Override User Options to set options.pin_threads to off.

BUT you can also limit the number of threads Arnold uses: in the Render Settings, System tab, clear the Autodetect Threads check box and then set the number of threads. For example, you could limit Arnold to six threads, and limiting the threads is probably a better approach, since you won’t end up with multiple render threads running on the same core, which can be bad for performance. This way, you wouldn’t need to set the affinity at all.

See Also:

  • As of Arnold, options.pin_threads works on Windows too.
  • Thread affinity was added in Arnold
    From the Arnold release notes:
    Threads can now be pinned to cores on Linux. This can improve scalability in modern machines with 16 or 24+ threads and, in the case of ray acceleration structure builds, it can occasionally result in as much as a 3x speedup when all the cores are being used (which is the default in Arnold, options.threads = 0 or -t 0 in kick). The default setting is auto where thread pinning is only enabled if more than half the logical cores are being used.
    This can also be manually set to always on or off by setting the new global option options.pin_threads to on, off, or auto. Note that, if client code, for instance a custom shader, spawns their own threads manually (with pthread_create or similar), these threads will inherit the same thread affinity, which totally breaks the point of spawning threads; in these situations they can either set options.pin_threads to off or they can create their threads with the Arnold API AiThreadCreate() which will un-pin the created thread. (#2733)
  • pin_threads
    Arnold can pin threads on linux and Windows so they don’t jump between multiple processors. This can improve scalability in modern machines multiple processors. It can be set to off, on or auto. By default is set to auto, meaning that if the number of threads is more than half the number of logical cores on the machine, arnold will pin the threads.
  • Adjustable thread priority in OS X: OS X now allows for options.thread_priority to adjust the priority of the render threads. It defaults to lowest, which is lower than the system default that was previously being used. Previously this option only existed in Windows.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s