Yesterday I installed Fedora 32 and It’s been great, except for the OpenCL part in my Radeon card… So as I could not find any decent guide in the internet on how to do this on Fedora 32 I’ve decided to write one myself. This will install the necesary files from the amdgpu-pro driver to use OpenCL in Fedora but keep the open source video driver that comes with the system.
First download the latest driver from the AMD website for RedHat/CentOS 8.xx
At the time of writing this it’s driver 20.20. Then uncompress it into the
/var/local directory, and rename the directory to
amdgpu (or whatever you want, just make sure to remember it for creating the local repo)
cd /var/local tar xf /path/to/amdgpu-pro-xx-xx-xxxxxx-rhel-x.x.tar.xz mv amdgpu-pro-xx-xx-xxxxxx-rhel-x.x amdgpu
Now create the local repo file in
/etc/yum.repos.d/amdgpu.repo containing the following lines (note the name of the directory in
[amdgpu] name=AMDGPU Packages baseurl=file:///var/local/amdgpu/ enabled=1 skip_if_unavailable=1 gpgcheck=0 cost=500 metadata_expire=300
And now just install the necesary packages for getting OpenCL to work:
If you have a POLARIS card or older (I tested this because I have 580):
dnf install libdrm-amdgpu libdrm-amdgpu-common clinfo-amdgpu-pro opencl-amdgpu-pro-comgr amdgpu-pro-core opencl-orca-amdgpu-pro-icd libopencl-amdgpu-pro
If you have a VEGA card or newer (I didn’t test this but it should work in theory):
dnf install libdrm-amdgpu libdrm-amdgpu-common clinfo-amdgpu-pro opencl-amdgpu-pro-comgr amdgpu-pro-core opencl-amdgpu-pro-icd libopencl-amdgpu-pro
In either case it will fail to install the
amdgpu-core dependency but it doesn’t matter because it’s not needed for using OpenCL. (Plus we want to keep the amdgpu driver that’s already included in the kernel)
Now at last, if you have the Mesa runtime for OpenCL installed just rename the
mesa.icd file to something else in
/etc/OpenCL/vendors so the system uses the AMD driver OpenCL runtime.
mv /etc/OpenCL/vendors/mesa.icd /etc/OpenCL/vendors/mesa.icd.bk
And that’s it! If you need to upgrade the OpenCL runtime you could theoretically replace the
/var/local/amdgpu files with the files from the newest RedHat driver and run a normal upgrade using
Here is the output of the
darktable-cltest running on my machine for those who are curious.