Is ROCM backend build for Windows is actually usable?

#71 · open · 4 comments

View on GitHub ↗

DalekoDaleko

I am having troubles running ROCM backend build with AMD Radeon RX 7900 XTX. After some troubleshooting, I have a suspicion, that the backend package isn't actually targeting the correct platform. Here is why I suspect so: https://github.com/DarthAffe/StableDiffusion.NET/blob/9fd65e14ae09dca5d8f5c965ef525e95143e9f31/.github/workflows/backends.yml#L153 has **-DGGML_HIP=ON** -DAMDGPU_TARGETS="gfx1100;gfx1101;gfx1030" preprocessor directives set. Where as instruction is https://github.com/leejet/stable-diffusion.cpp/blob/636d3cb6ff25d1ffa7267e5f6dac9f2925945606/docs/hipBLAS_on_Windows.md and the respective source code use **-DSD_HIPBLAS=ON** -DAMDGPU_TARGETS=gfx1100 and GGML_HIP is only referenced in https://github.com/leejet/ggml/blob/83835ffaa0f2e68bc8530bd0a7584711789dc23b/README.md.

Comments

DalekoDaleko

Specifically, when running with Windows rocm backend I could see that the correct backend library is loaded from the rocm subfolder. But it always defaults to CPU backend as if there was no other backend option enabled in the code. P.S. I see that Linux build is using a different, possibly correct set of defines.

DalekoDaleko

I am very much certain that the [ROCKM](https://www.nuget.org/packages/StableDiffusion.NET.Backend.Rocm) package is incomplete due to its incorrect build settings for Windows. As a workaround which seems to work, one could unzip the content of [sd-master-636d3cb-bin-win-rocm-x64.zip](https://github.com/leejet/stable-diffusion.cpp/releases/download/master-504-636d3cb/sd-master-636d3cb-bin-win-rocm-x64.zip) from https://github.com/leejet/stable-diffusion.cpp/releases into runtimes\win-x64\native\rocm6 and that seems to do the trick for now.

DarthAffe

I have to admit that I've no idea how usable all builds except cpu and windows-cuda are (these are the only ones I can test). I know that rocm worked in the past but a lot has changed since then. With sd.cpp now including more build-targets in the main repo I adopted them as good as possible. I'd expect the build to work now with v6.

DalekoDaleko

Thank you for looking into this. I tried the new build, it does seem to be a more complete version (the size of the stable-diffussion.dll matches), but as it is configured to look for the dependencies in the same folder, it fails to find the hipblas.dll/rocblas.dll and the respective TensileLibrary files. I assume there is a way to make it find the shared files somewhere in the system but I personally worked this around by just using the exact build drop structure from sd-master. See my working structure on the left vs the new v.6.0 backend structure on the right in the screenshot (the subfolders are empty on the right). Imho it would be easier to work around all of these troubles if the dependency resolution logic was a bit more configurable rather than being statically hardcoded in the binaries to use some environment variables. <img width="1787" height="439" alt="Image" src="https://github.com/user-attachments/assets/9859e6d2-0928-4968-b556-bafc98a9890e" />