This page will help you configure V-Ray for GPU rendering. For help with common questions, please see the Frequently Asked Questions page.

 

Page Contents ×

Overview


GPU rendering allows V-Ray to perform the raytracing calculations on the GPUs installed in the system, rather than the CPU. Since GPUs are specifically designed for massively parallel calculations, they can speed up the rendering process by an order of magnitude.

To enable GPU rendering, select the CUDA option for the Production engine parameter in the VRay tab of the Maya Render Settings window. You can use it with both Progressive and Bucket Sampler types.

 

Supported Hardware and Drivers


V-Ray GPU offers rendering with NVIDIA CUDA platform.

Below is a list of tests we have performed and the results:

  • NVIDIA – For NVIDIA GPUs always prefer using CUDA, since it runs faster and has more supported features. The CUDA engine is supported only in 64-bit builds of V-Ray for Maxwell, Pascal-, Turing- or Volta-based NVIDIA cards.
  • Hybrid Rendering (running CUDA on GPU and CPU): Starting with V-Ray 3.6, V-Ray GPU CUDA rendering can be performed on CPUs and NVIDIA GPUs at the same time. Using the Select Devices for V-Ray GPU Rendering you can enable your CPUs as CUDA devices and allow the CUDA code to combine your CPUs and GPUs to utilize all available resources.

Rendering on multiple GPUs is supported and by default IPR for GPU will use all available CUDA devices. See the sections below how to choose devices to run IPR GPU on.

 

If V-Ray GPU cannot find a supported GPU device on the system, it will silently fall back to CPU code. To see if the V-Ray render server is really rendering on the GPU, check out its console output.

When rendering, the output window provides information about your current driver version. If the version is not compatible with V-Ray GPU, you will find a message with the recommended version.

Тo use NVLINK on supported hardware, NVLINK devices must be set to TCC mode. This is recommended for Pascal, Volta and Turning-based Quadro models. For GeForce RTX cards, a SLI setup is sufficient. Also note that to prevent performance loss, not all data is shared between devices.

Though GPU rendering with CUDA on MacOS devices is no longer supported, the advanced users can bring back the old behavior by using the following environment variable: VRAY_MAC_GPU. Enabling this environment variable is at your own risk!

 

Choosing Which Devices to Use for Rendering


You may not want to use all available GPU devices for rendering, especially if you have multiple GPUs and you want to leave one of them free for working on the user interface or you may want to combine your CPU and GPU together (see the Hybrid Rendering section below). To do this, you can use the supplied GUI tool, which you can find here depending on your OS:

Windows: vray_gpu_device_select from this location: Program Files/Autodesk/Mayannnn/vray/bin (where nnnn is the maya version)

Linux: start vray_gpu_device_select from this location: /usr/autodesk/mayannnn/vray/bin/ (where nnnn is the maya version)


 

After changing this option, you need to restart Maya and/or any Standalone DR servers (if any are running) for the changes to take effect. If the Standalone DR server is running as a service, you may need to restart it.

 

Choose Devices from Command-Line Interface


The vray_gpu_device_select.exe can be used from the command-line interface of your OS.

From the console navigate to the bin folder (see the paths listed above) and run vray_gpu_device_select with -help argument to see a full list of options.

FlagDescription
-helpPrints the usage options.
-listOutputs all available devices on the system, separated by newlines

-all - Outputs all available devices
-enabled - Outputs only the devices that V-Ray GPU will use

-set="LIST_OF_DEVICES"Sets the devices that V-Ray GPU will use.
LIST_OF_DEVICES is semicolon separated list of device names, that you want V-Ray GPU to use. You could use part of device name in the list. After success, the operation outputs in stdout the names of the devices that V-Ray GPU will use, separated by newlines.

 

 

Example:

vray_gpu_device_select -set="NVIDIA CUDA GeForce GTX 750 Ti GPU index0; NVIDIA CUDA GeForce GTX 1080 GPU index1;"

You can use only the name of the card as a value for the -set. For example, -set="GeForce" will use all GeForce CUDA GPUs available.

 

All NVIDIA GPUs:

vray_gpu_device_select -set="nvidia"

Sets all NVIDIA GPUs available on the system. 

 

CUDA CPUs:

vray_gpu_device_select -set="c++/cpu"

Sets all available CUDA CPUs to be used from V-Ray GPU. 

In order to render in Hybrid mode, c++/cpu should be the first entry in the list and GPU entries should come after. 

On Linux, after changing the selected devices, you have to execute:

source /etc/profile.d/vrayrt_opencl_device.sh

or if using csh:

source /etc/profile.d/vrayrt_opencl_device.csh

in order to update the environment in the current shell.


For help on choosing CUDA devices with MEL, see the vray gpuDeviceSelect page.

Balancing the GPU Load


If you have only one GPU on your system, you may find that the user interface becomes sluggish and unresponsive while IPR is rendering on the GPU. To alleviate this problem, reduce the Rays per pixel and/or the Ray bundle size parameters in the Performance section of the IPR renderer settings in the Maya Render Setup dialog. For example, you can try values like 64/1 or 32/1. This will break up the data passed to the GPU into smaller chunks so that the user interface requests can be processed faster. However note, that this will reduce the rendering speed. Turn on the statistics display to check the difference in render speed and to find the optimal settings for your system.

 

Hybrid Rendering with CPUs and the CUDA Engine


Starting in 3.60, V-Ray GPU can perform hybrid rendering with the CUDA engine utilizing both the CPU and NVIDIA GPUs. V-Ray can now execute the CUDA source on the CPU, as though the CPU was another CUDA device. To enable the hybrid rendering mode, simply enable the C++/CPU device from the list of CUDA devices.

The hybrid rendering mode does not require any special drivers. Furthermore, you can use the CPU as a CUDA device even if you don't have an NVIDIA GPU and/or NVIDIA drivers installed. Meaning, this mode can be used on computers that don't even have GPUs. The hybrid render engine running on a CPU supports the same features as the regular V-Ray GPU CUDA engine.

 

References