Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Hide content
productmaya

Prerequisites (Windows only)

Your Redshift installation for Maya needs to be configured to run correctly from the command-line. This step is required for all command-line rendering with Maya and Redshift and is not directly related to command-line GPU selection. This requires that the full path to Maya's Render.exe must be part of your PATH environment variable. If you have multiple versions of Maya installed on your machine, the path to the Maya version you are rendering with must come before the path to other Maya versions.

Syntax

Code Block
Render.exe -r redshift -gpu <device_id_array> <scene_file>

Where <device_id_array> is a list of the GPU device ids you wish to render with. The syntax for this array is 'mel style' - for example use {0,2} to render on devices 0 and 2.

Example

To render scene c:\path\to\scenetorender.ma on GPU device 1 only

Code Block
Render.exe -r redshift -gpu {1} c:\path\to\scenetorender.ma

Same scene rendered using GPU device 0 and 1:

Code Block
Render.exe -r redshift -gpu {0,1} c:\path\to\scenetorender.ma
Info

On Linux and macOS, the curly braces around the GPU device id array may need to be escaped to prevent the shell from changing the syntax.

Code Block
Render -r redshift -gpu \{0,1\} /path/to/scenetorender.ma



Hide content
product3dsmax

Prerequisites

Due to the nature of the fixed command-line parameters available for 3dsmaxcmd.exe, GPU selection for command-line rendering requires the GPU selection to be coded into a pre-render script, which is then passed to 3dsmaxcmd.exe and executed prior to rendering.

Syntax

Code Block
3dsmaxcmd.exe <scene_file> -preRenderScript:<script_file>

Where <script_file> is the relative path to a MaxScript file containing a call to the command rsSetCudaDevices. The rsSetCudaDevices command takes a single array parameter in MaxScript synyax. The creation of the MaxScript file can be done directly from the command-line as shown in the examples below.

Example

To render scene c:\path\to\scenetorender.max on GPU device 1 only

Code Block
echo rsSetCudaDevices #(1) > rsSetCudaDevices.ms3dsmaxcmd.exe c:\path\to\scenetorender.ma –preRenderScript: rsSetCudaDevices.ms

Same scene rendered using GPU device 0 and 1:

Code Block
echo rsSetCudaDevices #(0,1) > rsSetCudaDevices.ms3dsmaxcmd.exe c:\path\to\scenetorender.ma –preRenderScript: rsSetCudaDevices.ms


...