How to specify gpu on cluster

For example, I want to run my program on one node in cluster, and the node have 4 gpus. But the second gpu is already in use (by other user). So I need to not use that gpu.
So how can I specify using the first, third and forth gpu?

If your application is called app.py, you should be able to do something like

CUDA_VISIBLE_DEVICES=0,2,3 python app.py

OK, thanks very much.
I’ll try it the next time I meet this problem :smile: