CUDA Pro Tip: Control GPU Visibility with CUDA_VISIBLE_DEVICES

Originally published at: https://developer.nvidia.com/blog/cuda-pro-tip-control-gpu-visibility-cuda_visible_devices/

As a CUDA developer, you will often need to control which devices your application uses. In a short-but-sweet post on the Acceleware blog, Chris Mason writes: Does your CUDA application need to target a specific GPU? If you are writing GPU enabled code, you would typically use a device query to select the desired GPUs.…

Hi, does the CUDA_VISIBLE_DEVICE permits to be sure to activate the desired GPU for a specific calculation if OPTIMUS technology is present?