Many of us had amdgpu and want to utilize the OpenCL support of it, but sadly installing rocm
is not as straight forward as it should be, and only recently ubuntu jammy supported officially. There is many custom work that modify .deb
packages to resolve crazy dependency hell. Im following amd rocm install guide, you may want to look around that web if you are not using ubuntu, in this post i will simplify the guide to ubuntu only.
Get amdgpu-install
scripts
$ wget https://repo.radeon.com/amdgpu-install/5.3/ubuntu/jammy/amdgpu-install_5.3.50300-1_all.deb
$ sudo apt install amdgpu-install_5.3.50300-1_all.deb
This may change if new version released keep watching amd rocm install guide
Setup rocm
repo for ubuntu jammy
$ wget -q -O - https://repo.radeon.com/rocm/rocm.gpg.key | sudo apt-key add -
$ echo 'deb [arch=amd64] https://repo.radeon.com/amdgpu/5.3/ubuntu jammy main' | sudo tee /etc/apt/sources.list.d/amdgpu.list
Check available version https://repo.radeon.com/rocm/apt/ , ubuntu jammy supported from 5.3.0 + only.
To change version replace the 5.3
to another number, ex: 5.3.1
Install kernel headers
$ sudo apt install linux-headers-`uname -r` linux-modules-extra-`uname -r`
Install the rocm
$ sudo amdgpu-install --usecase=rocm --rocmrelease=5.3.0
This gonna take a while, take a coffee
Installing different version available by replace --rocmrelease=5.3.0
to some other number, ex: --rocmrelease=5.3.1
Install rocm
clinfo
$ sudo amdgpu-install --usecase=opencl --rocmrelease=5.3.0
If already had clinfo
installed please remove it, as normal clinfo will not see ROCm
status.
Add yourself to video
and render
group
usermod -aG render your-username
usermod -aG video your-username
A simple reboot.
Checking rocm
installation, by using clinfo
or specifically at /opt/rocm-5.3.0/opencl/bin/clinfo
command you can see that OpenCL already enabled.
My device not supported
You can check if your device supported here rocm hardware and software reference
There also many --usecase
from amdgpu-install
if you need to
sources: