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

You may also like...

3 Responses

  1. Marko says:

    Please,
    can you update youre blog to the current version of the amdgpu-pro?
    “amdgpu-pro-18.40-697810-rhel-7.4”
    I can’t find ids-amdgpu-pro-, libdrm-amdgpu-pro- rpms …
    Greetings Marko

  2. You should use ROCm in the meantime -> https://github.com/RadeonOpenCompute/

    hsa-ext-rocr-dev-1.1.9-15-g848be2f-Linux.rpm
    hsa-rocr-dev-1.1.9-15-g848be2f-Linux.rpm
    hsakmt-roct-1.0.9-8-g238782c-Linux.rpm
    rocm-opencl-1.2.0-2018111657.x86_64.rpm

    Those are the once I use …

  3. Marko says:

    My GPU is a “Radeon R7 M260X”.

    It’s not supportet by ROCm:
    https://rocm.github.io/install.html#supported-gpus

    Damned, my laptop is just two years old … :o(

Leave a Reply

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