Building Cycles with GPU Binaries¶
For GPU accelerated rendering with Cycles on various graphics cards, additional build configuration is needed.
NVIDIA¶
CUDA¶
Install CUDA Toolkit 11 or 12. Newer versions may work but are not tested as well, older versions will not work.
Change the CMake configuration to enable building CUDA binaries:
If you will be using the build only on your own computer, you can
compile just the kernel needed for your graphics card, to speed up
building. For that you need to edit CYCLES_CUDA_BINARIES_ARCH
in the
CMake configuration, and leave only the architecture needed for your
GPU.
OptiX¶
For rendering with OptiX to take advantage of hardware acceleration in RTX cards, you need to install the OptiX SDK 7.3. This is supported on Windows and Linux currently.
CUDA must first be set up as described above.
Change the CMake configuration to enable building with OptiX and point to the OptiX installation directory:
Incompatible Compilers¶
When using relatively new GCC versions, the CUDA toolkit may not yet be compatible with them.
For example CUDA toolkit 12 was not initially compatible with GCC 13. To solve this an older GCC version can be used.
In this example GCC 12 would work, and make
can be run with the following
arguments to specify a different compiler version:
Debug Builds¶
ASAN interferes with CUDA availability. Disable it to avoid CUDA errors on initialization.
AMD¶
Linux¶
Install ROCm 5.x with the HIP compiler, use the most recent version to get important bug fixes. Instructions by AMD. Some Linux distributions may also provide this as packages. Installing drivers is not required for compiling, only for running.
Change the CMake configuration to enable building CUDA binaries:
If you will be using the build only on your own computer, you can
compile just the kernel needed for your graphics card, to speed up
building. For that you need to edit CYCLES_HIP_BINARIES_ARCH
in the
CMake configuration, and leave only the needed for your
GPU (this list is
incomplete unfortunately, so it may not be trivial to find your GPU).
Rocky Linux¶
The following commands are used on the buildbot machines. Kernel drivers are left out, since these machines do not have AMD GPUs.
sudo sh -c 'echo "[ROCm]
name=ROCm
baseurl=https://repo.radeon.com/rocm/yum/5.7.3/main
enabled=1
gpgcheck=1
exclude=rock-dkms
gpgkey=https://repo.radeon.com/rocm/rocm.gpg.key" > /etc/yum.repos.d/rocm.repo'
sudo rpm --import https://repo.radeon.com/rocm/rocm.gpg.key
sudo yum install -y hip-devel rocm-llvm rocm-core rocm-device-libs5.7.3.x86_64
Windows¶
Install the HIP SDK for
windows. By default the installer creates the environment variable
HIP_PATH
which is used in cmake for locating the SDK location.
To enable building HIP kernels set:
To enable building HIPRT kernels (hardware accelerated ray tracing) set:
Intel¶
OneAPI support is available on Windows & Linux, for Intel Arc GPUs. Building must be done using precompiled libraries, which includes the compiler for OneAPI (there is currently no Intel provided SDK that works with Blender).
Enable it in the build configuration as follows:
Ahead-of-Time Compilation¶
It is possible to compile GPU kernels in an ahead-of-time manner as a step of Blender build process. In order to do so the following options should be enabled:
On Windows it is also required to download Offline Compiler for
OpenCL.
The path to it is either to be provided using OCLOC_INSTALL_DIR
CMake variable, or the ocloc is to be placed to
win64_vc15/dpcpp/lib/ocloc
.
Apple¶
GPU rendering with Metal on Apple requires no extra build steps, the kernels are compiled at runtime.