To Affinity And Beyond

Version: Deadline 8.0, 9.0

Overview

Today we are going to deep dive into Deadline's affinity settings for CPU and the relative newcomer to the block, GPU. In a nutshell, CPU or GPU affinity allows you to control which CPU cores or GPU cards are available to a Deadline Slave. For example, you could restrict a single Deadline Slave to only be allowed to have certain CPU or GPU affinity. If you are running multiple Slaves on the same machine, then each Slave can receive different affinity settings. Each Slave can also have its affinity settings overridden by the Local Slave Settings as well. Don't forget that CPU affinity is only applicable to Microsoft ® Windows ® and Linux ® platforms and completely ignored on Apple ® Mac OS X ®. GPU affinity works across all 3 platforms and is only limited by the functionality of the applicable rendering application.

Let's take a look at CPU affinity before we dive into GPU affinity to see what is possible in Deadline. Finally, we will review the more advanced and exclusive features that Deadline provides for dynamic GPU slot rendering!

CPU Affinity

Typically, CPU affinity is used to divide up the CPU cores to be used by a Deadline Slave, allowing for some of these cores to be used for either another process (which could be another Deadline Slave processing another job) or for the local user to ensure they have an equal number of cores to continue working locally. Let's look at permanently configuring a Deadline Slave to use only certain CPU cores, no matter what job it picks up to render.

The CPU affinity settings for a Slave can be accessed via the Slaves Panel -> Modify Slave Properties... -> CPU Affinity section. These settings affect the number of CPUs the Slave renders with (Windows and Linux only):

  • Override CPU Affinity: Enable this option to override which CPUs the Slave and its child processes are limited to. By default, Deadline Slave will use all CPUs if this option is disabled.

  • Specify Number of CPUs to Use: Use this spin box if you just want to limit the number of CPUs used, and you aren't concerned with which specific CPUs are used.

  • Check Individual CPUs to Use: Use these buttons, as well as the checkboxes beside each CPU, if you want to explicitly pick which CPUs are used. This is useful if you are running multiple Slaves on the same machine and you want to give each of them their own set of CPUs.

    • Check All: Checks all the available CPUs.
    • Check None: Unchecks all the available CPUs.
    • Invert: Checks all unchecked CPUs and unchecks all checked CPUs.

For administrators, the CPU affinity of multiple Slaves can be controlled by first selecting multiple Slaves in the Slaves Panel, and then editing their settings.

Within some of our specific application plugins we also explicitly control certain environment variable overrides to ensure CPU affinity works correctly. An example of this situation can be seen in our Autodesk ® 3dsmax ® and 3dsCmd plugins where we handle the VRAY_USE_THREAD_AFFINITY variable and set it to 0, so that Deadline's CPU affinity is respected.

For scripters, if you have a custom plugin in Deadline, you can use our Scripting API to query if a Slave's CPU affinity is being overridden at render time and if so, what CPU affinity has been applied:

GPU Affinity

Why control GPU affinity? Well, many modern VFX workstations and indeed render nodes are being equipped with multiple graphics cards for faster compute of common activities such as rendering. However, it can sometimes be advantageous to divide up the number of graphics cards to either render different Deadline GPU jobs simultaneously via running multiple Deadline Slaves or divide the number GPU cards up PER render thread (more on that later). For example, the 3D scene requires a certain amount of vRAM which can only be accommodated by a certain GPU spec card, or better throughput can be achieved for certain scene files in a multi-GPU machine by dividing the equal spec GPU cards evenly across Deadline Slave instances to allow potentially multiple jobs to process simultaneously.

Deadline's GPU affinity is hardware agnostic. So, Deadline supports both AMD ® OpenCL and NVIDIA ® CUDA here.

The GPU affinity settings for a Slave can be accessed via the Slaves Panel -> Modify Slave Properties... -> GPU Affinity section. These settings can affect the number of GPU cards the Slave uses when rendering:

  • Override GPU Affinity: Enable this option to override which GPUs the rendering process is limited to. Note that not all renderers support this. By default, Deadline Slave will use all GPUs if this option is disabled.

  • Specify Number of GPUs to Use: Use this spin box if you just want to limit the number of GPUs used, and you aren't concerned with which specific GPUs are used.

  • Check Individual GPUs to Use: Use these buttons, as well as the checkboxes beside each GPU, if you want to explicitly pick which GPUs are used. This is useful if you are running multiple Slaves on the same machine and you want to give each of them their own set of GPUs.

    • Check All: Checks all the available GPUs.
    • Check None: Unchecks all the available GPUs.
    • Invert: Checks all unchecked GPUs and unchecks all checked GPUs.

Make sure to configure the GPU affinity settings based on the number of GPUs the machine actually has. Typically, GPU 0 is your display card which is the graphics card being used to actively drive your display monitor(s).

For administrators, the GPU affinity of multiple Slaves can be controlled by first selecting multiple Slaves in the Slaves Panel, and then editing their settings.

Note that unlike CPU affinity, GPU affinity isn't automatically applied to all renders. It is up to the individual Deadline application plugins to pull this information from the Slave's at render time and pass them to the renderer.

Just like earlier for scripters, if you have a custom plugin in Deadline, you can use our Scripting API to query if a Slave's GPU affinity is being overridden at render time and if so, what GPU affinity has been applied:

Local Overrides

Both CPU and GPU affinity can have a localized override applied to it by the local user on that machine. This is accessed via Local Slave Controls via either Deadline Monitor or via Deadline Launcher, running in your system tray. These settings can provide a local override to control the CPU/GPU affinity of the Slave(s) running on your machine. This is useful if you wish to continue working on your local machine but restrict the amount of compute being available to any Deadline Slave running in the background.

GPU - Not just for 3D

Here's the list of current application plugins where we support GPU affinity:

As a side note, Adobe ® After Effects GPU rendering via their "Mercury Engine" is supported in Deadline assuming your Slave has a compliant graphics card installed and you are running the latest graphics drivers. If not, After Effects will silently fallback to using the CPU at render time.

If there is a certain Deadline plugin that you think the GPU affinity settings could be applied to, please email Deadline Support and let us know!

Finally, don't forget that GPU compute isn't just for 3D imagery! Deadline provides support for GPU acceleration of the Altus Denoiser...

...and REDLine video transcoding!

GPU - Thread Mapping

GPU affinity is useful, but requires you to up front configure the GPU affinity for each of your potential GPU Slaves. An alternative approach for some of our plugins is to ad-hoc dynamically map the current Render Thread (a Deadline Slave can have up to 16 render threads) to 1 or more GPU slots in the machine running Slave on a PER job basis. Let's have a look at our User Manual snippet below to see how that works for Maya:

Note: Ensure you only use one of these settings at any one time! You can't combine the Slave centric GPU Affinity with the GPUs Per Task or Select GPU Devices setting below.

Ensure you only use one of these settings at any one time! You can't combine the Slave centric GPU Affinity with the GPUs Per Task or Select GPU Devices setting below.

  • GPUs Per Task: If set to 0 (the default), then the GPU renderer will be responsible for automatically choosing the GPUs used during rendering. If this is set to 1 or greater, then each task for the job will be assigned specific GPUs. This can be used in combination with concurrent tasks to get a distribution over the GPUs. For example:
    • If this is set to 1, then tasks rendered by the Slaves' thread 0 would use GPU 0, thread 1 would use GPU 1, etc.
    • If this is set to 2, then tasks rendered by the Slaves' thread 0 would use GPUs {0,1}, thread 1 would use GPUs {2,3}, etc.
  • Select GPU Devices: A comma separated list of specific GPU device ID(s) can be entered instead of using the above 'GPUs Per Task' option (which must be set to "0"). Valid examples include: "0" or "1" or "0,1" or "2,4" without the quotation marks. Note: "Concurrent Tasks" must be set to "1" only.

Summary

This was a quick overview of CPU and GPU affinity in Deadline. CPU affinity isn't new in network rendering terms but still provides an important and regularly, useful configuration for render farms. GPU rendering is gaining considerable ground in today's cutting-edge CG studios and hopefully this blog post highlighted some important and unique features that Deadline offers. Feel free to get in touch to request any additional affinity requests via our Support Forum and Support Ticket systems.

AMD and OpenCL are registered trademarks or trademarks of AMD, Inc., and/or its subsidiaries and/or affiliates in the USA and/or other countries.

NVIDIA and CUDA are registered trademarks or trademarks of NVIDIA, Inc., and/or its subsidiaries and/or affiliates in the USA and/or other countries.

Autodesk, 3ds Max, Maya and Softimage are registered trademarks or trademarks of Autodesk, Inc., and/or its subsidiaries and/or affiliates in the USA and/or other countries.

Innobright and Altus are registered trademarks or trademarks of Innobright, Inc., and/or its subsidiaries and/or affiliates in the USA and/or other countries.

MAXON and CINEMA 4D are registered trademarks or trademarks of MAXON Computer GmbH in Germany and/or other countries.

Side Effects and Houdini are registered trademarks of Side Effects Software and/or its subsidiaries and/or affiliates in Canada and/or other countries.

OTOY and Octane are registered trademarks or trademarks of OTOY, Inc., and/or its subsidiaries and/or affiliates in the USA and/or other countries.

RED Digital Cinema and RED are registered trademarks or trademarks of RED Digital Camera, Inc., and/or its subsidiaries and/or affiliates in the USA and/or other countries.

Redshift Rendering Technologies and Redshift are registered trademarks or trademarks of Redshift Rendering Technologies, Inc., and/or its subsidiaries and/or affiliates in the USA and/or other countries.

Chaos Group and V-Ray are registered trademarks or trademarks of Chaos Software Ltd. in Bulgaria and/or other countries.

Adobe and After Effects are registered trademarks or trademarks of Adobe, Inc., and/or its subsidiaries and/or affiliates in the USA and/or other countries.

Microsoft, Windows are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.

Apple, Mac and Mac OS are trademarks of Apple Inc., registered in the U.S. and other countries.

Linux is a registered trademark of Linus Torvalds in the U.S. and other countries.

All other brand names, product names, or trademarks belong to their respective holders.