dinov2 icon indicating copy to clipboard operation
dinov2 copied to clipboard

can only use one cuda on local executor

Open PeterYang-niubidehen opened this issue 1 year ago • 3 comments

somehow I could only use one cuda on a local executor, and it's always cuda 0 no matter which GPU I specify it to use. Does anybody know why this happens?

PeterYang-niubidehen avatar Aug 14 '23 08:08 PeterYang-niubidehen

I believe we would need information on what you are trying to do to possibly help.

patricklabatut avatar Aug 23 '23 21:08 patricklabatut

@patricklabatut if I use the commond like this: ''' export CUDA_VISIBLE_DEVICES=1 python dinov2/run/eval/linear.py --xxxx ''' it will still use the GPU:0 for linear trainning. I have try to change the local_rank in def _set_from_local(self) from init.py, but it raise another error. Any solution?

Luoxsh6 avatar Oct 19 '23 05:10 Luoxsh6

@patricklabatut if I use the commond like this: ''' export CUDA_VISIBLE_DEVICES=1 python dinov2/run/eval/linear.py --xxxx ''' it will still use the GPU:0 for linear trainning. I have try to change the local_rank in def _set_from_local(self) from init.py, but it raise another error. Any solution?

python xxx.py, this will only set up the 'local run', which is single node and gpu run. You can check this in dinov2/distributed/init _set_from_local()

try using torchrun and set the --nproc_node as your number of gpu. Also, export CUDA_VISIBLE_DEVICES first

junlinguo avatar May 21 '24 14:05 junlinguo