gbtb / nix-stable-diffusion

Flake for running SD on NixOS
113 stars 21 forks source link

How to enable ROCm support for some AMD GPUs (hipErrorNoBinaryForGpu) #7

Closed turion closed 1 year ago

turion commented 1 year ago

I followed your instructions, but they didn't work:

$ nix develop .#invokeai.amd

$ python scripts/preload_models.py 
/opt/amdgpu/share/libdrm/amdgpu.ids: No such file or directory
/opt/amdgpu/share/libdrm/amdgpu.ids: No such file or directory
"hipErrorNoBinaryForGpu: Unable to find code object for all current devices!"
Aborted (Speicherabzug geschrieben)
turion commented 1 year ago

Workaround seems to be to prepend HSA_OVERRIDE_GFX_VERSION=10.3.0 (https://stackoverflow.com/questions/73575955/pytorch-hiperrornobinaryforgpu-unable-to-find-code-object-for-all-current-devi), I don't really understand what it does though.

gbtb commented 1 year ago

Hm, interesting. I have 6900xt and for me it works without an issue (except for slow start and warning about missing database or something). I'm curious, what is your GPU model ? Because it seems that for some GPUs are officially supported by ROCM, and some require this env variable to trick the driver into thinking that GPU has supported architecture - https://github.com/RadeonOpenCompute/ROCm/search?q=%27HSA_OVERRIDE_GFX_VERSION&type=issues .

turion commented 1 year ago

Seems like I have a Ryzen 5650U with integrated GPU..? If that's a thing.

gbtb commented 1 year ago

Yep, you could expect some limitations on integrated GPUs. Well, I'll pin this issue for reference to other folks who might face the same problem.

queezle42 commented 1 year ago

I have the same problem with an RX 5700 (i.e. a dedicated GPU).

HSA_OVERRIDE_GFX_VERSION=10.3.0 still works as a fix.

Lord-Valen commented 1 year ago

This should be in an FAQ section of the README imo.

@gbtb