[GH-ISSUE #10152] RX580 #32420

Closed
opened 2026-04-22 13:40:06 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @dpblnt on GitHub (Apr 6, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/10152

I just spend some hours to build ollama for RX580, which is disabled on purpose.
ollama works perfectly with rocBLAS-5.7.1-r2 on gfx803
Why do all that work to disable it if it works?

Originally created by @dpblnt on GitHub (Apr 6, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/10152 I just spend some hours to build ollama for RX580, which is disabled on purpose. ollama works perfectly with rocBLAS-5.7.1-r2 on gfx803 Why do all that work to disable it if it works?
GiteaMirror added the feature request label 2026-04-22 13:40:06 -05:00
Author
Owner

@Abdulhanan535 commented on GitHub (Apr 7, 2025):

I was about to build it, glad I checked.

<!-- gh-comment-id:2782175429 --> @Abdulhanan535 commented on GitHub (Apr 7, 2025): I was about to build it, glad I checked.
Author
Owner

@robertrosenbusch commented on GitHub (Apr 13, 2025):

@dpblnt @Abdulhanan535 : Just a hint.... RX570/580/590 are all the same on Polaris/gfx803 family.

on discover/gpu.go on line #73 you should change on Ollama v0.6.5.

var RocmComputeMajorMin = "9" to var RocmComputeMajorMin = "8" (someone decided to not support gfx803 on Ollama anymore and wanna support abroad gfx9xx^.^)

  • This short change on Ollama SourceCode could be save lifetime on gfx803 :P

The next thing:

  • gfx803 isnt a part to compile on ollama/CMakePresets.json on line #59
  • gfx803 isnt a part to compile on ollama//CMakeLists.txt on line #100

After this short changes and adds.. you are able to (re-)compile your RX5X0 aka gfx803 from git and use without any probs on good well known working ROCm :P

Just a hint, it works fine on ROCm 6.3 and recompile rocBLAS, but beware, there are some issues on Kernel 6.12 and 6.13 to use /dev/kfd and /dev/dri . But i guess i repeat myself again and again ^.^


Cheers, Robert Rosenbusch

<!-- gh-comment-id:2800113943 --> @robertrosenbusch commented on GitHub (Apr 13, 2025): @dpblnt @Abdulhanan535 : Just a hint.... RX570/580/590 are all the same on Polaris/gfx803 family. on `discover/gpu.go` on[ line #73 ](https://github.com/ollama/ollama/blob/main/discover/gpu.go) you should change on Ollama v0.6.5. `var RocmComputeMajorMin = "9"` to `var RocmComputeMajorMin = "8"` (**someone decided** to not support [gfx803 on Ollama anymore ](https://github.com/likelovewant/ollama-for-amd/issues/51 )and wanna support abroad gfx9xx^.^) - This short change on Ollama SourceCode could be save lifetime on gfx803 :P The next thing: - `gfx803` isnt a part to compile on `ollama/CMakePresets.json` on [line #59](https://github.com/ollama/ollama/blob/main/CMakePresets.json) - `gfx803` isnt a part to compile on `ollama//CMakeLists.txt` on line [#100](https://github.com/ollama/ollama/blob/main/CMakeLists.txt) After this short changes and adds.. you are able to (re-)compile your RX5X0 aka gfx803 from git _and_ use without any probs on good well known working ROCm :P Just a hint, it works fine on ROCm 6.3 and recompile rocBLAS, but beware, there are some issues on Kernel 6.12 and 6.13 to use `/dev/kfd` and `/dev/dri` . But i guess i repeat myself again and again ^.^ --- Cheers, Robert Rosenbusch
Author
Owner

@dpblnt commented on GitHub (Apr 14, 2025):

I was not able to make it work on rocm6.1, so I changed back to 5.7
As you mention RocmComputeMajorMin has to be set from 9 to lower.
I also had to disable some rocm detection in discover/amd_linux.go
then I build with

export CGO_LDFLAGS="-L$(pwd)/build3/lib/ollama -L$(pwd)/build3/ml/backend/ggml/ggml/src/ggml-hip -lggml-hip -Wl,-rpath,$(pwd)/build3/lib/ollama"
export CGO_CFLAGS="-I$(pwd)/build3 -I$(pwd)/ml/backend/ggml/ggml/include"
export CXX=/usr/bin/hipcc
export CC=/usr/lib/llvm/17/bin/clang
export CGO_ENABLED=1

rm -rf build3
mkdir build3
cd build3

cmake ..  -G Ninja -DCMAKE_C_COMPILER=clang DCMAKE_CXX_COMPILER=clang++  -DAMDGPU_TARGETS=gfx803
cmake --build . --config Release
cd ..
go clean -cache
go generate ./..
go build -o ollama

and run with

export ROC_ENABLE_PRE_VEGA=1
export HSA_OVERRIDE_GFX_VERSION="8.0.3"
export LD_LIBRARY_PATH=$PA/build3/lib/ollama

<!-- gh-comment-id:2800565525 --> @dpblnt commented on GitHub (Apr 14, 2025): I was not able to make it work on rocm6.1, so I changed back to 5.7 As you mention RocmComputeMajorMin has to be set from 9 to lower. I also had to disable some rocm detection in discover/amd_linux.go then I build with ``` export CGO_LDFLAGS="-L$(pwd)/build3/lib/ollama -L$(pwd)/build3/ml/backend/ggml/ggml/src/ggml-hip -lggml-hip -Wl,-rpath,$(pwd)/build3/lib/ollama" export CGO_CFLAGS="-I$(pwd)/build3 -I$(pwd)/ml/backend/ggml/ggml/include" export CXX=/usr/bin/hipcc export CC=/usr/lib/llvm/17/bin/clang export CGO_ENABLED=1 rm -rf build3 mkdir build3 cd build3 cmake .. -G Ninja -DCMAKE_C_COMPILER=clang DCMAKE_CXX_COMPILER=clang++ -DAMDGPU_TARGETS=gfx803 cmake --build . --config Release cd .. go clean -cache go generate ./.. go build -o ollama ``` and run with ``` export ROC_ENABLE_PRE_VEGA=1 export HSA_OVERRIDE_GFX_VERSION="8.0.3" export LD_LIBRARY_PATH=$PA/build3/lib/ollama ```
Author
Owner

@dhiltgen commented on GitHub (Jul 5, 2025):

Old AMD GPU support is tracked via #2453

<!-- gh-comment-id:3040275358 --> @dhiltgen commented on GitHub (Jul 5, 2025): Old AMD GPU support is tracked via #2453
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#32420