AMD ROCm OpenCL and Linux Kernel 4.18

Hello,

starting with Linux Kernel 4.18 the ROCm OpenCL driver works!

All you need are the following packages:

hsa-rocr-dev-1.1.8-15-ge851b7a-Linux.rpm
hsakmt-roct-1.0.8-1-ge3dd067-Linux.rpm
rocm-opencl-1.2.0-2018071635.x86_64.rpm
rocm-opencl-devel-1.2.0-2018071635.x86_64.rpm

from Index of /rocm/yum/rpm/

If you don’t have an RPM based system, you can also extract the files from the RPMs.

$ clinfo                                   
Number of platforms                               1           
  Platform Name                                   AMD Accelerated Parallel Processing
  Platform Vendor                                 Advanced Micro Devices, Inc.
  Platform Version                                OpenCL 2.0 AMD-APP (2482.3)
1 Like

Hey Andreas,
thanks for these hints. Still, I cant get it to work. I added the apt repository to my sources and ran the ROCm install script according to this site: GitHub - ROCm/ROCm: AMD ROCm™ Software - GitHub Home. Afterwards I found this advice and checked that these packages are installed (and successfully found all of them):
hsa-rocr-dev (version 1.1.9-87-g1566fdd)
hsakmt-roct (version 1.0.9-171-g4be439e)
rocm-opencl (version 1.2.0-2019070446)
rocm-opencl-dev (not devel, version 1.2.0-2019070446)

When running darktable with darktable -d opencl it still says

0.033948 [opencl_init] opencl related configuration options:
0.033959 [opencl_init]
0.033960 [opencl_init] opencl: 1
0.033961 [opencl_init] opencl_library: ‘’
0.033963 [opencl_init] opencl_memory_requirement: 768
0.033964 [opencl_init] opencl_memory_headroom: 300
0.033968 [opencl_init] opencl_device_priority: ‘/!0,//
0.033971 [opencl_init] opencl_mandatory_timeout: 200
0.033973 [opencl_init] opencl_size_roundup: 16
0.033975 [opencl_init] opencl_async_pixelpipe: 0
0.033978 [opencl_init] opencl_synch_cache: 0
0.033979 [opencl_init] opencl_number_event_handles: 25
0.033990 [opencl_init] opencl_micro_nap: 1000
0.033994 [opencl_init] opencl_use_pinned_memory: 0
0.033995 [opencl_init] opencl_use_cpu_devices: 0
0.033996 [opencl_init] opencl_avoid_atomics: 0
0.033999 [opencl_init]
0.034062 [opencl_init] could not find opencl runtime library ‘libOpenCL’
0.034092 [opencl_init] could not find opencl runtime library ‘libOpenCL.so’
0.034124 [opencl_init] could not find opencl runtime library ‘libOpenCL.so.1’
0.034127 [opencl_init] no working opencl library found. Continue with opencl disabled
0.034128 [opencl_init] FINALLY: opencl is NOT AVAILABLE on this system.
0.034132 [opencl_init] initial status of opencl enabled flag is OFF.

Is there any kind of driver that I need to install prior to installing ROCm? sudo lshw -c video gives

Beschreibung: VGA compatible controller
Produkt: Vega 10 XT [Radeon RX Vega 64]
Hersteller: Advanced Micro Devices, Inc. [AMD/ATI]
Physische ID: 0
Bus-Informationen: pci@0000:28:00.0
Version: c3
Breite: 64 bits
Takt: 33MHz
Fähigkeiten: pm pciexpress msi vga_controller bus_master cap_list rom
Konfiguration: driver=amdgpu latency=0
Ressourcen: irq:58 memory:e0000000-efffffff memory:f0000000-f01fffff ioport:e000(Größe=256) memory:fca00000-fca7ffff memory:c0000-dffff

Thanks for your help,
Oskar

You need to install the standard opencl packag too. The libOpenCL.so.1 is a wrapper loading the vendor specifc implementation. This is not available on your system …

What package name should I look for (KDE Neon, so APT or snap), just opencl?

krikkit:~ # ll /usr/lib64/libOpenCL.so.1.0.0 
-rwxr-xr-x 1 root root 137400 Feb  2 05:34 /usr/lib64/libOpenCL.so.1.0.0
krikkit:~ # rpm -qf /usr/lib64/libOpenCL.so.1.0.0
ocl-icd-2.2.12-3.fc30.x86_64

Sorry, still couldn’t get it to work :confused:
I installed ocl-icd-dev and a few other packages that sounded correct and tried to extract the libopencl files mentioned by you in another thread from the amdgpu-pro driver. But I can still neither find the folder /usr/lib64 on my system nor does darktable find the libopencl.so files and the latter.
Thanks for your help again,
Oskar

No /usr/lib64???

Um, are you running a 32-bit-only distro release?

Edit: Naming conventions can differ. It could be /usr/libx86_64-linux-gnu/

I’m running KDE Neon 5.16 64bit. My darktable installation was done via snap.
I do see the folders /usr/lib, /usr/lib32, /usr/libexec and /usr/libx32, but none of them contains the libopencl.so.1.0.0. Both the lib and the libx32 folder contain lots of libraries of that naming scheme so I guess I could just add the missing opencl lib here?

Does a snap install even work with openCL? Last I checked a few months ago, it didn’t.

Edit: Adding OpenGL/GPU support to a snap - doc - snapcraft.io

The snap must ship openCL inside the snap.

I now uninstalled the darktable snap package, restarted, added the debruijn repository, installed the apt version and restarted again. When starting darkable now I get a segfault (see file attached). Should I report this somewhere or is there an obvious solution?
darktable_bt_D4864Z.txt (75.6 KB)

Just to be sure, remove ~/.cache/darktable and ~/.config/darktable - usually darktable just spits out an error if the database is newer than the current version from my memory, but maybe you’ve found a corner case.

If it still crashes, not sure… I wouldn’t be able to look at that log until much later this week.

Thanks for your help. It didn’t help, unfortunately. I’ll try to compile the master version and see if that runs…