A general description of how to do this is given here . You want to use option 1, which is displayed below:
Option 1: Use two GPUs (RECOMMENDED)
If two GPUs can be available in the system, then X processing can be processed on one GPU, while CUDA tasks are executed on the other. This ensures full interactivity and interference-free X, while ensuring unhindered CUDA execution.
To accomplish this:
• The X display must be forced on to one GPU using the BusID parameter in the corresponding Device section of the xorg.conf file. In addition, any other sections of the "Device" must be deleted. For instance:
BusID "PCI:34:0:0"
GPU PCI identifiers can be determined from the lspci command or from the nvidia-smi -a command.
• CUDA processing must be forcibly transferred to another GPU, for example, using the CUDA_VISIBLE_DEVICES environment variable before running any CUDA applications. For instance:
export CUDA_VISIBLE_DEVICES="1"
(Select a numeric option to select a GPU that is not an X-GPU)
source share