ROCm OpenCL not working for kernel 5.3?

Sometime ago following this thread I was able to get OpenCL working for my Ubuntu 18.04 (then on kernel 4.18).

Yesterday I upgrade my long forgotten PC and OpenCL is not working anymore. Clinfo returning:

clinfo -v
Number of platforms: 1
Platform Profile: FULL_PROFILE
Platform Version: OpenCL 2.1 AMD-APP (3052.0)
Platform Name: AMD Accelerated Parallel Processing
Platform Vendor: Advanced Micro Devices, Inc.
Platform Extensions: cl_khr_icd cl_amd_event_callback cl_amd_offline_devices

Platform Name: AMD Accelerated Parallel Processing
ERROR: clGetDeviceIDs(-1)

I’m not that surprised… This is why I hate to upgrade my fully operational system but I wanted to get Darktable 3.0…

I’m on Ubuntu 18.04.3 LTS with kernel Linux dev 5.3.0-26-generic. Since rock-dkms does not compile under 5.3 I’m using kernel provided amdgpu driver.

ROCm packages installed now:

hsakmt-roct 1.0.9-298-gea01eb3
hsakmt-roct-dev 1.0.9-298-gea01eb3
hsa-ext-rocr-dev 1.1.9.0-rocm-rel-3.0-6-7128d0d
hsa-rocr-dev 1.1.9.0-rocm-rel-3.0-6-7128d0d
rocm-opencl 2.0.0-rocm-rel-3.0-6-9a4afec
rocm-opencl-dev 2.0.0-rocm-rel-3.0-6-9a4afec

additionaly

ocl-icd-libopencl1
ocl-icd-opencl-dev

from Ubuntu.

However AMDGPU-PRO 19.50 despite that the kernel module does not compile either brings opencl back again.

I saw on ROCm issue tracker request for supporting kernel 5.3.

Does anybody user somehow ROCm for OpenCL on kernel 5.3?

Try ROCm 3.0 - maybe it has fixes for you? If as you said in opencl support for darktable - #32 by maf it used to work with your card+cpu+mobo config then it’s most likely as you’ve said kernel/module incompatibility.

To install ROCm with OpenCL and OpenCL Image support, you have do the following five steps:

  1. Add the 2.10.0 repo to your package manager (3.0 doesn’t work). To do that for zypper on openSUSE create the following file:

    /etc/zypp/repos.d/rocm.repo

    [rocm]
    name=Radeon Open Compute
    enabled=1
    autorefresh=0
    baseurl=http://repo.radeon.com/rocm/zyp/2.10.0/
    type=rpm-md
    
  2. Install the required packages using:

    zypper in rocm-opencl hsa-ext-rocr-dev
    
  3. Create /etc/ld.so.conf.d/rocm-opencl.conf with the following content:

    /opt/rocm/hsa/lib/
    /opt/rocm/lib
    /opt/rocm/lib64
    /opt/rocm/opencl/lib/x86_64
    
  4. To load the new paths into the linker run: ldconfig

  5. And last but not least create an OpenCL ICD file using:

    echo libamdocl64.so > /etc/OpenCL/vendors/amdocl64.icd
    

I’m on Kernel 5.4.14.

1 Like

does this method work on ubuntu 20.04lts with kernal 5.4.0-28-generic ?

As of today, the regular rocm install works on my Kubuntu 20.04. One of the kernel updates a few days ago must have fixed it.

1 Like