When rendering from the command-line of your 3d app with Redshift, you can specify the GPU devices to use for the rendering job. When specifying the GPU devices from the command-line, the Redshift preferences.xml file is not updated, so running your 3d app in interactive mode will still use the GPU devices that you specified in the System tab of the Redshift render options.
Several render managers including Deadline and Royal Render natively support GPU selection when rendering with Redshift. Selecting only a subset of available GPUs for a job is useful for example to render multiple frames simultaneously on a single machine for optimal scaling.
Prerequisites
To use the Houdini command-line tools, you need to open the Houdini 'Command Line Tools' application (available as a shortcut from the start menu) in Windows.
In Linux, you'll need to source the Houdini environment as follows:
source houdini_setup
Syntax / Example
For example, using 'hbatch', the most basic command-line render session without scripts to load a scene, set the enabled GPUs and render the Redshift ROP node, can be:
> hbatch mySceneFile.hip
> Redshift_setGPU -s 011
> render /out/myRedshiftROP
Please note that the -s 001 parameter after the Redshift_setGPU command means that, on a system with 3 GPUs, the first GPU should be disabled ('0') while the second and third GPU should be enabled ('1').
Alternatively, you can write a script file like:
mread mySceneFile.hip
Redshift_setGPU -s 011
render /out/myRedshiftROP
And execute it using:
> hbatch myScriptFile
How do I determine my GPU device ids?
There are a number of ways to determine the device ids associated with each of your GPUs.
One option is to open prefences.xml from C:\ProgramData\Redshift in a text editor and inspect the value of "AllCudaDevices". For example:
<preference name="AllComputeDevices" type="string" value="0:Quadro K5000,1:Quadro 6000," />
In this case the Quadro K5000 is device 0, while the Quadro 6000 is device 1.