-
Notifications
You must be signed in to change notification settings - Fork 6.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: --gpu-device-id commandline argument doesn't work with HIP/ROCm (AMD) backend #3734
Comments
okay this seems to be an AMD/HIP specific issue. I found the root cause to be the env variable set by the argument in Line 80 in d7439b2
When using HIP/ROCm backend it needs to be HIP_VISIBLE_DEVICES instead of CUDA_VISIBLE_DEVICES .proof here (fooocus_env) axt@weilichskann ~/zeugs/AI/Fooocus $ CUDA_VISIBLE_DEVICES=1 python
Python 3.10.15 (main, Sep 20 2024, 14:16:53) [GCC 13.3.1 20240614] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.cuda.device_count()
2 (fooocus_env) axt@weilichskann ~/zeugs/AI/Fooocus $ HIP_VISIBLE_DEVICES=1 python
Python 3.10.15 (main, Sep 20 2024, 14:16:53) [GCC 13.3.1 20240614] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.cuda.device_count()
1 So I locally changed the code to reflect that but sadly it's causing a segfault.
How to proceed from here? Any ideas concerning debugging this further? I'm not very versed in Fooocus and its development |
ComfyUI suffers from the same issue. comfyanonymous/ComfyUI#5585 |
Checklist
What happened?
when starting Fooocus with e.g. --gpu-device-id 1 it will state that it does that in the log but then uses device 0 anyways
Steps to reproduce the problem
What should have happened?
Fooocus should use the device specified with --gpu-device-id
What browsers do you use to access Fooocus?
Mozilla Firefox, Google Chrome
Where are you running Fooocus?
Locally
What operating system are you using?
Gentoo Linux
Console logs
Fooocus:
rocm-smi -i:
Torch (confirm switching device is possible):
Additional information
I have two discrete GPUs (device id 0 and 1), integrated graphics are disabled via bios and not exposed to the system or used in any way
The text was updated successfully, but these errors were encountered: