guided-diffusion icon indicating copy to clipboard operation
guided-diffusion copied to clipboard

CUDA_VISIBLE_DEVICES not working?

Open pantDevesh opened this issue 1 year ago • 8 comments

Despite setting CUDA_VISIBLE_DEVICES, it continues to use GPUs from the index 0. How can I ensure that the code uses specific GPUs as intended?

pantDevesh avatar Sep 23 '23 21:09 pantDevesh

I encountered the same problem

Schnabel-8 avatar Oct 13 '23 12:10 Schnabel-8

This is also a problem for me. I google it. Someone says we need to set CUDA_VISIBLE_DEVICES before import torch. However, even in my "super_train.py", I set CUDA_VISIBLE_DEVICES before importing other libraries. CUDA_VISIBLE_DEVICES still does not work. Looking into it. If I fix it, I will update here.

HuangruiChu avatar Oct 18 '23 02:10 HuangruiChu

I write os.environ["CUDA_VISIBLE_DEVICES"]="1" before line 45,it works,I don't know it is right or wrong

whitebeacon avatar Nov 06 '23 12:11 whitebeacon

Same question~

Kerio99 avatar Nov 07 '23 08:11 Kerio99

I write os.environ["CUDA_VISIBLE_DEVICES"]="1" before line 45,it works,I don't know it is right or wrong

Hi, I wonder which .py file did you change ?

Kerio99 avatar Nov 07 '23 08:11 Kerio99

I modified 'os.environ["CUDA_VISIBLE_DEVICES"] = f"{MPI.COMM_WORLD.Get_rank() % GPUS_PER_NODE}"' in 'dist_util.py' at line 27 to 'os.environ["CUDA_VISIBLE_DEVICES"]="1"' in order to specify the GPU for training.

Kerio99 avatar Nov 07 '23 08:11 Kerio99

Hello everyone, i meet the same question, i have solved the problem. Please take all the codes in dist_util.py change to openai/improved-diffusion dist_util.py

hhsupremehh627 avatar Mar 22 '24 07:03 hhsupremehh627