NVIDIA CUDA

How to restrict CUDA devices to be used during DCV stream encoding?

Is very common to share GPU devices with a lot of services, but sometimes some applications use a good amount of resources or need to switch between Compute and Graphic mode, which can cause issues with DCV Server and other non-DCV services. This is expected due CUDA design and can be mitigated applying some rules to avoid two services causing conflicts.

Linux

Edit the /etc/dcv/dcv.conf file and under [display] section you can set:

cuda-devices=['0', '4'] 

This means that DCV can just use the GPUs 0 and 4. If you leave the variable empty, the DCV will try to get the GPU 0 and, if is not possible, it will try the next one (1), then (2) etc, and eventually return to 0, until is possible to pick an available device.

This configuration is similar of CUDA_VISIBLE_DEVICES environment CUDA var; The difference is that it will be just applied in the DCV service (dcv.conf).