Using AMD Open Source and the amdgpu-pro OpenCL driver for image processing

I have an AMD grahpics card and use the great Open Source driver which comes with my Linux distribution. However for image processing I want the OpenCL support of my graphics card. Currently that’s only provided by the amdgpu-pro driver. However it is possible to just extract the files needed for OpenCL and use them. Here is how to do this:

  1. Go to https://support.amd.com/en-us/download
  2. Select Desktop Graphics
  3. Select your product family: e.g. RX series
  4. Select your produt e.g. RX 4xx
  5. Choose a platform, SLED or RHEL and download the package

Extracting

For extracting the required libraries, I use Midnight Commander (mc). You can use them to browse the RPMs. From the following RPM you need to copy the mentioned libraries to `/opt/amdgpu-pro/lib64/`

  • noarch/ids-amdgpu-pro-1.0.0-492261.noarch.rpm
    amdgpu.ids -> /opt/amdgpu-pro/share/libdrm/
  • x86_64/libopencl-amdgpu-pro-17.40-492261.x86_64.rpm
    libOpenCL.so -> /opt/amdgpu-pro/lib64/
    libOpenCL.so.1 -> /opt/amdgpu-pro/lib64/
  • x86_64/libopencl-amdgpu-pro-icd-17.40-492261.x86_64.rpm
    amdocl64.icd -> /etc/OpenCL/vendors
    libamdocl12cl64.so -> /opt/amdgpu-pro/lib64/
    libamdocl64.so -> /opt/amdgpu-pro/lib64/
  • x86_64/libdrm-amdgpu-pro-2.4.82-492261.x86_64.rpm
    libdrm.so.2 -> /opt/amdgpu-pro/lib64/
    libdrm.so.2.4.0 -> /opt/amdgpu-pro/lib64/
    libdrm_amdgpu.so.1 -> /opt/amdgpu-pro/lib64/
    libdrm_amdgpu.so.1.0.0 -> /opt/amdgpu-pro/lib64/
    libdrm_radeon.so.1 -> /opt/amdgpu-pro/lib64/
    libdrm_radeon.so.1.0.1 -> /opt/amdgpu-pro/lib64/
    libkms.so.1 -> /opt/amdgpu-pro/lib64/
    libkms.so.1.0.0 -> /opt/amdgpu-pro/lib64/

Running

Now you can run e.g darktable with the following command and enjoy OpenCL support:

LD_LIBRARY_PATH=/opt/amdgpu-pro/lib64 darktable

Leave a Reply

Your email address will not be published. Required fields are marked *