- Building Cycles with GPU Binaries
- NVIDIA
- CUDA
- OptiX
- Debug Builds
- AMD
- Linux
- Windows
- Intel
- Pre-compiled GPU kernels
- Apple
- How to Install NVIDIA Cuda Toolkit on Linux for Blender 2.8 Cycles
- Download the NVIDIA CUDA Toolkit
- Install the NVIDIA CUDA Toolkit
- Post-Installation Actions
- Configure NVIDIA CUDA Toolkit on Linux for Blender 2.8 Cycles
- GPU Rendering
- Rendering Technologies
- CUDA – NVIDIA
- OptiX – NVIDIA
- HIP – AMD
- oneAPI – Intel
- Metal – Apple (macOS)
- Limitations
- Frequently Asked Questions
- Why is Blender unresponsive during rendering?
- Why does a scene that renders on the CPU not render on the GPU?
- Can multiple GPUs be used for rendering?
- Would multiple GPUs increase available memory?
- What renders faster?
- Error Messages
- Error: Out of memory
- The NVIDIA OpenGL driver lost connection with the display driver
- Unsupported GNU version
- CUDA Error: Kernel compilation failed
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:
WITH_CYCLES_CUDA_BINARIES=ON
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:
WITH_CYCLES_DEVICE_OPTIX=ON OPTIX_ROOT_DIR=/path/to/NVIDIA-OptiX-SDK-7.x.x-xxx
Debug Builds
ASAN interferes with CUDA availibility. Disable it to avoid CUDA errors on initialization.
AMD
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:
WITH_CYCLES_HIP_BINARIES=ON
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:
WITH_CYCLES_DEVICE_ONEAPI=ON
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:
WITH_CYCLES_ONEAPI_BINARIES=ON
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.
How to Install NVIDIA Cuda Toolkit on Linux for Blender 2.8 Cycles
Installing the NVIDIA Cuda Toolkit on Linux for Blender Cycles rendering is actually easy and straightforward. Unfortunately, the NVIDIA documentation is not so easy or straightforward. I wrote this article primarily as a reference for myself as this is a process I have done before and will definitely do again. I hope you also find it useful.
If you have any edits or feedback, please let me know @jarednielsen.
Download the NVIDIA CUDA Toolkit
Select the following (if you’re running an Ubuntu-based distro, such as Linux Mint 64bit):
- Linux
- x86_64
- Ubuntu, latest version (18.04)
- deb [local]
- Download
Install the NVIDIA CUDA Toolkit
After the installer finishes downloading, run the following commands from the command line, replacing with your version of CUDA (you can skip the first command if the .deb file opens after it finishes downloading):
sudo dpkg -i cuda-repo-version>.deb sudo apt-key add /var/cuda-repo-version>/7fa2af80.pub sudo apt-get update sudo apt-get install cuda
As the installation process nears completion, you will see a message:
***************************************************************************** *** Reboot your computer and verify that the NVIDIA graphics driver can *** *** be loaded. *** *****************************************************************************
Post-Installation Actions
After rebooting, check to see if the NVIDIA daemon is running:
systemctl status nvidia-persistenced
If you get the error message:
Failed to start NVIDIA Persistence Daemon.
If you encounter any issues, consult the post-installation actions documentation
Configure NVIDIA CUDA Toolkit on Linux for Blender 2.8 Cycles
Open Blender and under Edit, select Preferences.
In the Preferences panel select System menu option and within it, General.
Under Cycles Compute Device, select CUDA.
You can now close the Preferences panel and render away!
Want to level up your problem solving skills? I write a bi-weekly newsletter about programming, problem solving and lifelong learning. Join now
GPU Rendering
GPU rendering makes it possible to use your graphics card for rendering, instead of the CPU. This can speed up rendering because modern GPUs are designed to do quite a lot of number crunching. On the other hand, they also have some limitations in rendering complex scenes, due to more limited memory, and issues with interactivity when using the same graphics card for display and rendering.
To enable GPU rendering, go into the Preferences ‣ System ‣ Cycles Render Devices , and select either CUDA, OptiX, HIP, oneAPI, or Metal. Next, you must configure each scene to use GPU rendering in Properties ‣ Render ‣ Device .
Rendering Technologies
Blender supports different technologies to render on the GPU depending on the particular GPU manufacturer and operating system.
CUDA – NVIDIA
CUDA is supported on Windows and Linux and requires a Nvidia graphics cards with compute capability 3.0 and higher. To make sure your GPU is supported, see the list of Nvidia graphics cards with the compute capabilities and supported graphics cards.
OptiX – NVIDIA
OptiX is supported on Windows and Linux and requires a Nvidia graphics cards with compute capability 5.0 and higher and a driver version of at least 470. To make sure your GPU is supported, see the list of Nvidia graphics cards.
OptiX takes advantage of hardware ray-tracing acceleration in RTX graphics cards, for improved performance.
HIP – AMD
HIP is supported on Windows and Linux and requires a AMD graphics card with the Vega architecture or newer. Both discrete GPUs and APUs are supported.
- Radeon VII
- Radeon RX Vega Series
- Radeon RX 5000 Series
- Radeon RX 6000 Series
- Radeon RX 7000 Series
- Radeon Pro WX 9100
- Radeon Pro W6000 Series
- Windows: Radeon Software 21.12.1 or Radeon PRO Software 21.Q4
- Linux: Radeon Software 22.10 or ROCm 5.3
Please refer to AMD’s website for more information about AMD graphics cards and their architectures.
On Windows, experimental hardware ray-tracing support is available with the most recent drivers. This can be enabled in the preferences. However there are currently known issues regarding hair rendering and degenerate triangle shapes.
The Clip extension mode in Image Texture Node is not supported for HIP.
oneAPI – Intel
oneAPI is a computation library that is supported on Windows and Linux and requires a Intel® Arc™ graphics card with the Xe HPG architecture. Hardware acceleration for ray-tracing is supported.
- Windows: Intel Graphics Driver XX.X.101.4314
- Linux: intel-level-zero-gpu package 1.3.25812, typically available through the intel-compute-runtime package XX.XX.25812
Please refer to Intel’s website for more information about Intel graphics cards and their architectures.
Metal – Apple (macOS)
Metal is supported on Apple computers with Apple Silicon, AMD and Intel graphics cards. macOS 13.0 or newer is required to support all features and graphics cards.
Light Trees and Shadow Caustics are not supported when using an AMD graphics card with Metal.
Limitations
- Path Guiding is not supported on any GPU.
- Open Shading Language is only supported for OptiX, with some limitations listed in the documentation.
Frequently Asked Questions
Why is Blender unresponsive during rendering?
On older GPU generations, graphics cards can only either render or draw the user interface. This can make Blender unresponsive while it is rendering. Heavy scenes can also make Blender unresponsive on newer GPUs, when using a lot of memory or executing expensive shaders, however this is generally less of a problem.
The only complete solution for this is to use a dedicated GPU for rendering, and another for display.
Why does a scene that renders on the CPU not render on the GPU?
There may be multiple causes, but the most common one is that there is not enough memory on your graphics card. Typically, the GPU can only use the amount of memory that is on the GPU (see Would multiple GPUs increase available memory? for more information). This is usually much smaller than the amount of system memory the CPU can access. With CUDA, OptiX, HIP and Metal devices, if the GPU memory is full Blender will automatically try to use system memory. This has a performance impact, but will usually still result in a faster render than using CPU rendering.
Can multiple GPUs be used for rendering?
Yes, go to Preferences ‣ System ‣ Compute Device Panel , and configure it as you desire.
Would multiple GPUs increase available memory?
Typically, no, each GPU can only access its own memory.
The exception is NVIDIA GPUs connected with NVLink, where multiple GPUs can share memory at a small performance cost. This is can be enabled with Distributed Memory Across Devices in the preferences.
What renders faster?
This varies depending on the hardware used. Different technologies also have different compute times depending on the scene tested. For the most up to date information on the performance of different devices, browse the Blender Open Data resource.
Error Messages
In case of problems, be sure to install the official graphics drivers from the GPU manufacturers website, or through the package manager on Linux. The graphics drivers provided by the computer manufacturer can sometimes be outdated or incomplete.
Error: Out of memory
This usually means there is not enough memory to store the scene for use by the GPU.
One way to reduce memory usage is by using smaller resolution textures. For example, 8k, 4k, 2k, and 1k image textures take up respectively 256MB, 64MB, 16MB and 4MB of memory.
The NVIDIA OpenGL driver lost connection with the display driver
If a GPU is used for both display and rendering, Windows has a limit on the time the GPU can do render computations. If you have a particularly heavy scene, Cycles can take up too much GPU time. Reducing Tile Size in the Performance panel may alleviate the issue, but the only real solution is to use separate graphics cards for display and rendering.
Another solution can be to increase the time-out, although this will make the user interface less responsive when rendering heavy scenes. Learn More Here.
Unsupported GNU version
On Linux, depending on your GCC version you might get this error. See the Nvidia CUDA Installation Guide for Linux for a list of supported GCC versions. There are two possible solutions to this error:
Use an alternate compiler
If you have an older GCC installed that is compatible with the installed CUDA toolkit version, then you can use it instead of the default compiler. This is done by setting the CYCLES_CUDA_EXTRA_CFLAGS environment variable when starting Blender.
Launch Blender from the command line as follows:
CYCLES_CUDA_EXTRA_CFLAGS="-ccbin gcc-x.x" blender
(Substitute the name or path of the compatible GCC compiler).
Remove compatibility checks
If the above is unsuccessful, delete the following line in /usr/local/cuda/include/host_config.h :
#error -- unsupported GNU version! gcc x.x and up are not supported!
This will allow Cycles to successfully compile the CUDA rendering kernel the first time it attempts to use your GPU for rendering. Once the kernel is built successfully, you can launch Blender as you normally would and the CUDA kernel will still be used for rendering.
CUDA Error: Kernel compilation failed
This error may happen if you have a new NVIDIA graphics card that is not yet supported by the Blender version and CUDA toolkit you have installed. In this case Blender may try to dynamically build a kernel for your graphics card and fail.
- Check if the latest Blender version (official or experimental builds) supports your graphics card.
- If you build Blender yourself, try to download and install a newer CUDA developer toolkit.
Normally users do not need to install the CUDA toolkit as Blender comes with precompiled kernels.
© Copyright : This page is licensed under a CC-BY-SA 4.0 Int. License. Last updated on 07/13/2023.