Building Blender/GPU Binaries

= Building Cycles with GPU Binaries =

For GPU accelerated rendering with Cycles on various graphics cards, additional build configuration is needed.

CUDA
Install CUDA Toolkit 11. 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:

Linux
Install the 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.

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).

Windows
The HIP SDK for building AMD GPU binaries is not currently publicly available, we hope this will be released soon.

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:

Pre-compiled GPU kernels
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 an Offline Compiler for OpenCL (make sure the dGPU version is used - with the dgpu in the name). 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.