hi, I have 8 gpus but want to use 4 gpus whose id are 4,5,6,7 to train a model, what should I do?
You can use the CUDA_VISIBLE_DEVICES environment variable.
@ppwwyyxx sorry, could you please explain more clearly? How can I use CUDA_VISIBLE_DEVICES environment variable?
I trie to set cfg.MODEL.DEVICE = 'cuda:3' but bug arised as follw:
RuntimeError: CUDA out of memory. Tried to allocate 238.00 MiB (GPU 3; 15.90 GiB total capacity; 15.20 GiB already allocated; 1.88 MiB free; 9.25 MiB cached)
I'm sure that GPU 3 is empty.
You can google CUDA_VISIBLE_DEVICES. such as https://stackoverflow.com/questions/39649102/how-do-i-select-which-gpu-to-run-a-job-on
You need to use smaller batch size if running on fewer GPUs, as mentioned in https://github.com/facebookresearch/detectron2/blob/master/GETTING_STARTED.md#train-a-standard-model
good job
You can google
CUDA_VISIBLE_DEVICES. such as https://stackoverflow.com/questions/39649102/how-do-i-select-which-gpu-to-run-a-job-onYou need to use smaller batch size if running on fewer GPUs, as mentioned in https://github.com/facebookresearch/detectron2/blob/master/GETTING_STARTED.md#train-a-standard-model
Which file should I add CUDA_VISIBLE_DEVICES when I first try with demo?
Which file should I add
CUDA_VISIBLE_DEVICESwhen I first try with demo?
You could either do
CUDA_VISIBLE_DEVICES=2,3 python xxx.py
or like it's mentioned in the stackoverflow link above first run
export CUDA_VISIBLE_DEVICES=0,2 then run the python script
python xxx.py
How can i set it if I want to use GPU 3,4:
cfg.MODEL.DEVICE = 'cuda:3'