GPU渲染

GPU 渲染能够使用你的显卡进行渲染,而不是CPU。这会加快渲染速度,因为如今GPU的设计旨在能够胜任大量运算方面的应用。另一方面,由于显存容量有限,它们在渲染复杂场景时也有一些限制,并且在使用相同的显卡进行显示和渲染时会出现交互性问题。

To enable GPU rendering, go into the Preferences ‣ System ‣ Cycles Render Devices, and select either CUDA, OptiX or OpenCL. Next, you must configure each scene to use GPU rendering in Properties ‣ Render ‣ Device.

支持的硬件

Blender supports different technologies to render on the GPU depending on the particular GPU manufacture.

Nvidia

CUDA and OptiX are supported for GPU rendering with Nvidia graphics cards.

CUDA

CUDA requires 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. CUDA GPU rendering is supported on Windows, macOS, and Linux.

OptiX

For RTX graphics cards with hardware ray tracing support (e.g. Turing), OptiX can be used for better performance. OptiX support is still experimental and does not yet support all features, see below for details.

OptiX requires Geforce or Quadro RTX graphics card with recent Nvidia drivers, and is supported on Windows and Linux.

AMD

OpenCL is supported for GPU rendering with AMD graphics cards. Blender supports graphics cards with GCN generation 2 and above. To make sure your GPU is supported, see the list of GCN generations with the GCN generation and supported graphics cards.

Windows 和 Linux 支持 AMD OpenCL GPU 渲染,但在 macOS 上不受支持。

支持特性和限制

CUDA和OpenCL渲染支持与CPU渲染相同的所有功能,但以下两项除外:

  • 开放着色语言。

  • 高级的体积光采样以降低噪点。

OptiX support is experimental and does not yet support the following features:

  • 烘焙

  • 分路路径追踪

  • 环境光遮蔽(AO)和倒角着色器节点

  • 结合CPU + GPU渲染

常见问题

为什么在渲染过程中Blender没有反应?

While a graphics card is rendering, it cannot redraw the user interface, which makes Blender unresponsive. We attempt to avoid this problem by giving back control over to the GPU as often as possible, but a completely smooth interaction cannot be guaranteed, especially on heavy scenes. This is a limitation of graphics cards for which no true solution exists, though we might be able to improve this somewhat in the future.

如果可能的话,最好配备多个GPU,其中的一个用于显示界面,另一个用于渲染。

为什么场景是通过CPU渲染的,而不是GPU?

There maybe be multiple causes, but the most common is that there is not enough memory on your graphics card. Typically while using GPU rendering the GPU can only use the amount of memory that is on the GPU. This is usually much smaller than the amount of system memory the CPU can access. With CUDA and OptiX 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. This feature does not work for OpenCL rendering.

多个GPU可以用于渲染吗?

可以。打开 用户设置 ‣ 系统 ‣ 计算设备面板 ,按需进行设置即可。

多个GPU能够增加显存容量吗?

不能,每个GPU只能访问自身的显存。

What renders faster, Nvidia or AMD, CUDA, OptiX or OpenCL?

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.

报错信息

In case of problems, be sure to install the official graphics drivers from the Nvidia or AMD website, or through the package manager on Linux.

不支持的GNU版本!不支持gcc 4.5及以上版本!

在Linux系统下,根据你的GCC版本,你可能会收到此错误。有两种可能的解决方案:

使用备用编译器

如果安装了与安装的CUDA工具包版本兼容的较旧GCC,则可以使用它而不是默认编译器。这是通过在启动Blender时设置 CYCLES_CUDA_EXTRA_CFLAGS 环境变量来完成的。

从命令行启动Blender,如下所示:

  1. CYCLES_CUDA_EXTRA_CFLAGS="-ccbin gcc-x.x" blender

(替换兼容GCC编译器的名称或路径)。

删除兼容性检查

如果以上方法都不管用,在 /usr/local/cuda/include/host_config.h 中删除如下行内容即可

  1. #error -- unsupported GNU version! gcc 4.7 and up are not supported!

这将允许Cycles在第一次尝试使用GPU进行渲染时成功编译CUDA渲染内核。成功构建内核后,你可以像往常一样启动Blender,CUDA内核仍将用于渲染。

CUDA错误:无效的内核图像

如果您在Windows 64位系统下遇到此错误信息,请务必使用64位的Blender版本,而不要使用32位版本。

CUDA错误:内核编译失败

如果您有新的Nvidia显卡尚未支持您安装的Blender版本和CUDA工具包,则可能会出现此错误。在这种情况下,Blender可能会尝试为您的图形卡动态构建内核并失败。

在这种情况下,您可以:

  1. 检查最新的Blender版本(官方或 实验版本) 是否支持您的图形卡。

  2. 如果您自己构建Blender,请尝试下载并安装更新的CUDA开发人员工具包。

通常用户不需要安装CUDA工具箱,因为Blender带有预编译的内核。

CUDA错误:内存不足

This usually means there is not enough memory to store the scene for use by the GPU.

Note

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.

NVIDIA OpenGL驱动与显示驱动程序失去连接

如果同时使用GPU来显示与渲染,Windows系统在GPU渲染计算时间方面存在局限。如果您的场景非常复杂,那么Cycles引擎就需要占用过多的GPU时间。通过降低性能面板中的平铺尺寸值可以让此问题得到缓解,但真正的解决方案只有使用多个相对独立的显卡分别进行界面显示与渲染。

另外一种解决方案是增大失去相应的等待时间;这会使在渲染计算力非常大的场景的时候,让用户界面的反应慢很多。 更多请参考.

CUDA 错误: 在 cuCtxSynchronize() 中的未知错误

一个未知的错误可能有很多原因,但有一种可能性是它超时。请参阅上述答案以获取解决方案。