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 Worker. For example, you could restrict a single Deadline Worker to only be allowed to have certain CPU or GPU affinity. If you are running multiple Workers on the same machine, then each Worker can receive different affinity settings. Each Worker can also have its affinity settings overridden by the Local Worker 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 Worker, allowing for some of these cores to be used for either another process (which could be another Deadline Worker 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 Worker to use only certain CPU cores, no matter what job it picks up to render.
The CPU affinity settings for a Worker can be accessed via the Workers Panel -> Modify Worker Properties... -> CPU Affinity section. These settings affect the number of CPUs the Worker renders with (Windows and Linux only):
- Override CPU Affinity: Enable this option to override which CPUs the Worker and its child processes are limited to. By default, Deadline Worker 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 Workers on the same machine and you want to give each of them their own set of CPUs.
For administrators, the CPU affinity of multiple Workers can be controlled by first selecting multiple Workers in the Workers 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 Worker's CPU affinity is being overridden at render time and if so, what CPU affinity has been applied:
- DeadlinePlugin.OverrideCpuAffinity(): Gets if the Worker is overriding its CPU affinity. Returns [bool]: True if the Worker is overriding its CPU affinity.
- DeadlinePlugin.CpuAffinity(): Gets the Worker's CPU affinity if OverrideCpuAffinity is True. Returns [int list]: The list of CPU ids.
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 Workers 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 Worker 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 Worker can be accessed via the Workers Panel -> Modify Worker Properties... -> GPU Affinity section. These settings can affect the number of GPU cards the Worker 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 Worker 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 Workers on the same machine and you want to give each of them their own set of 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 Workers can be controlled by first selecting multiple Workers in the Workers 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 Worker'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 Worker's GPU affinity is being overridden at render time and if so, what GPU affinity has been applied:
- DeadlinePlugin.OverrideGpuAffinity(): Gets if the Worker is overriding its GPU affinity. Returns [bool]: True if the Worker is overriding its GPU affinity.
- DeadlinePlugin.GpuAffinity(): Gets the Worker's GPU affinity if OverrideGpuAffinity is True. Returns [int list]: The list of GPU ids.
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 Worker 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 Worker(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 Worker running in the background.
GPU - NOT JUST FOR 3D
Here's the list of current application plugins where we support GPU affinity:
- Autodesk ® 3ds Command
- Autodesk ® 3ds Max
- Innobright ® Altus
- MAXON ® CINEMA 4D
- Side Effects ® Houdini
- Autodesk ® Maya
- OTOY ® Octane
- RED ® REDLine
- Redshift Rendering Technologies ®
- Autodesk ® Softimage
- Chaos Group ® VraySpawner
As a side note, Adobe ® After Effects GPU rendering via their "Mercury Engine" is supported in Deadline assuming your Worker 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 Worker's. An alternative approach for some of our plugins is to ad-hoc dynamically map the current Render Thread (a Deadline Worker can have up to 16 render threads) to 1 or more GPU slots in the machine running Worker 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 Worker 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:
- 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.
Comments
0 comments
Article is closed for comments.