OOTDiffusion icon indicating copy to clipboard operation
OOTDiffusion copied to clipboard

multi gpus error

Open TigerHH6866 opened this issue 1 year ago • 1 comments

i have 2GPUs 3080x2

log

(ootd) root@autodl-container-200a43b416-549738af:~/autodl-tmp/OOTDiffusion-main/run# python gradio_ootd.py Loading pipeline components...: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 7/7 [00:01<00:00, 5.47it/s] text_config_dict is provided which will be used to initialize CLIPTextConfig. The value text_config["id2label"] will be overriden. text_config_dict is provided which will be used to initialize CLIPTextConfig. The value text_config["bos_token_id"] will be overriden. text_config_dict is provided which will be used to initialize CLIPTextConfig. The value text_config["eos_token_id"] will be overriden. Traceback (most recent call last): File "/root/autodl-tmp/OOTDiffusion-main/run/gradio_ootd.py", line 24, in openpose_model_dc = OpenPose(1) File "/root/autodl-tmp/OOTDiffusion-main/preprocess/openpose/run_openpose.py", line 32, in init torch.cuda.set_device(gpu_id) File "/root/miniconda3/envs/ootd/lib/python3.10/site-packages/torch/cuda/init.py", line 350, in set_device torch._C._cuda_setDevice(device) RuntimeError: CUDA error: invalid device ordinal CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect. For debugging consider passing CUDA_LAUNCH_BLOCKING=1. Compile with TORCH_USE_CUDA_DSA to enable device-side assertions.

TigerHH6866 avatar Apr 25 '24 02:04 TigerHH6866

Hey, the issue is because OpenPose, Parsing and OOTDifussionDC have device_id as an input in init. It's really strange why someone left code like. Anyways to fix that issue temporary, you can just change 1 to 0 (default device_id when you have 1 GPU)

340415359-60f5f0e7-72b5-470b-bb00-6e9b63236412

mike2505 avatar Jun 17 '24 18:06 mike2505