How can I disable a specific device from using CUDA under Ubuntu?

How and what do I set the environment variable: CUDA_VISIBLE_DEVICES

i’ve got a gtx 480 as device 0 and a 8600 as device 1. I’d like to only have gtx 480 as a CUDA enabled device.

Have you tried setting the compute mode to ‘prohibited’ for the 8600 using the nvidia-smi tool?


with an r256 driver, it’s

CUDA_VISIBLE_DEVICES=0 ./application

Does CUDA_VISIBLE_DEVICES replace the compute mode or is it in addition to? I couldn’t find any documentation about it in 3.1.

I think it’s only documented in the release notes as I’ve been busy and kind of forgot to write much documentation for it. It works in addition to compute mode–it’s just a bit more flexible and allowed me to be significantly lazier when developing some applications.