This configuration is for GPUs that are not supported by Ollama by default. In my case, it's an RX 6000 series.
The installation is exclusive to Arch Linux, but the configuration is the same.
- If you have another distro, try to investigate how install rocm, rest is same config
sudo pacman -Syu
sudo pacman -S rocm-core rocm-hip-sdk rocm-opencl-sdk rocm-opencl-runtime
#Optional repository from AUR
paru -S rocm-core rocm-hip-sdk rocm-opencl-runtime
echo 'export HSA_OVERRIDE_GFX_VERSION=10.3.0' >> ~/.bashrc
echo 'export ROCM_PATH=/opt/rocm' >> ~/.bashrc
echo 'export AMDGPU_TARGETS=gfx1031' >> ~/.bashrc
source ~/.bashrc
---------
echo 'export HSA_OVERRIDE_GFX_VERSION=10.3.0' >> ~/.zshrc
echo 'export ROCM_PATH=/opt/rocm' >> ~/.zshrc
echo 'export AMDGPU_TARGETS=gfx1031' >> ~/.zshrc
source ~/.zshrc
sudo systemctl edit --full ollama.service
[Service]
Environment="HSA_OVERRIDE_GFX_VERSION=10.3.0"
Environment="ROCM_PATH=/opt/rocm"
Environment="AMDGPU_TARGETS=gfx1031"
sudo systemctl daemon-reload
sudo systemctl restart ollama