AMDGPU OpenCL

Hi, I’m running OpenSuse Leap 15.1 (only just upgraded from 15.0)

I believe I have a AMD R9 370 oem (From Dell XPS 8700 desktop) graphics card. ‘lsmod | grep -i amd’ reports :

01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Curacao PRO [Radeon R7 370 / R9 270/370 OEM]
01:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Oland/Hainan/Cape Verde/Pitcairn HDMI Audio [Radeon HD 7000 Series]

I’ve been running the open source AMDGPU drivers for a few years now and all has been well. I’ve also been running the latest kernels from the rep https://download.opensuse.org/repositories/Kernel:/stable/standard/ . The latest I’ve ran was 5.4.0. I want to use OpenCL with darktable and Openshot. First I tried installing the pocl and mesa drivers, but no luck.

So then I read that I needed the AMDGPU-PRO drivers but could get away with just installing the opencl parts. I downloaded AMDGPU-PRO-19.30 drivers and installed the zypper repo and the opencl packages. I did this by using the script “amdgpu-pro-install --opencl=legacy,pal --headless” and also manually using the Software Manager app. Each time the packages and dependencies were installed. However, through debugging I found that the amdgpu-dkms-19.30-844693.noarch.rpm package would fail with multiple errors. After some further reading I read the AMDGPU-PRO driver would only work with a 4.x Kernel.

I’ve now installed the kernel-default package for 4.12.14-lp151.28.32.1-x86-64 along with the source packages etc. Now when I install the AMDGPU-PRO drivers for OpenCL the packages install correctly and the dkms part is compiled successfully. But when I reboot the AMDGPU driver can not be inserted to the kernel, I get the following error message in the dmesg :
6.434181] amdgpu: Unknown symbol __pcpu_unique_kfd_processes_srcu_srcu_data (err 0)

I’ve not been able to find any trace of the above symbol in kernel source code. I normally boot the kernel with the following amdgpu specific kernel params:
radeon.si_support=0 radeon.cik_support=0 amdgpu.si_support=1 amdgpu.cik_support=1 amdgpu.dc=1 amdgpu.ppfeaturemask=0xfffd7fff amdgpu.dpm=1

but while trying to solve this problem I’ve tried booting with:
radeon.si_support=0 radeon.cik_support=0 amdgpu.si_support=1 amdgpu.cik_support=1 amdgpu.dc=1 amdgpu.ppfeaturemask=0xfffd7fff
radeon.si_support=0 radeon.cik_support=0 amdgpu.si_support=1 amdgpu.cik_support=1
and “” (ie none)

None of which change the situation with the kernel being unable to insert the amdgpu driver and receiving the dmesg error:
6.434181] amdgpu: Unknown symbol __pcpu_unique_kfd_processes_srcu_srcu_data (err 0)

Please help - I’m tearing my hair out. Do I need a later driver than 4.12? I can’t find any opensuse kernel drivers after 4.12 but I know I’ve run 4.18 and 4.20 from the kernel:stable repo in the past (Why aren’t these kernels preserved in an archive repo???)

Hi
The kernel stable repo moves forward…

So, your card is GCN 1.0 and if not mistaken a Southern Island one, so set the cik to 0 as this is for GCN 2.0 cards.

You haven’t installed the OSS opencl libs rather than the amdgpu pro ones (which as far as I know, won’t work with the card…).

Hi Thanks for your response.

I’ll try changing the CIK setting. (but I’m doubtful).

What do you mean I haven’t installed the OSS opencl drivers?? I’ve installed the following packages:

Mesa-libOpenCL
libOpenCL1
libclc
pocl

The only other packages available are:

beignet - for Intel GPUs
clFFT - opencl Fast Fourier Transforms (???)

I’ve also tried the AMDGPU-PRO drivers. None seem to work. Am I missing something are there some other packages that should be installed? Other repositories??

Mesa doesn’t work due to a ‘missing image’ problem (after duckduckgo’ing Mesa doesn’t seem compatible yet)

Should I only ever have one OpenCL library installed perhaps??

What about ROCm is that something I should be using? I’m so confused.

Ok I’ve tried with the AMDGPU-PRO opencl drivers and setting CIK=0 but no change.

When the AMDGPU-PRO OpenCL driver is installed, the following packages are all installed at the same time:
amdgpu-pro-versionlist amdgpu-core amdgpu-dkms amdgpu-pro-core clinfo-amdgpu-pro libdrm-amdgpu libdrm-amdgpu-common libopencl-amdgpu-pro opencl-amdgpu-pro-comgr opencl-amdgpu-pro-icd opencl-orca-amdgpu-pro-icd

Then when the system boots, the amdgpu driver can not be inserted due to the error:
6.434181] amdgpu: Unknown symbol __pcpu_unique_kfd_processes_srcu_srcu_data (err 0)

If the module isn’t being inserted then I don’t believe the params (cik etc) would have any affect.

This is the output of running darktable-cltest when the amdgpu-pro driver is not installed


0.011263 [opencl_init] opencl related configuration options:
0.011272 [opencl_init] 
0.011274 [opencl_init] opencl: 1
0.011276 [opencl_init] opencl_library: ''
0.011278 [opencl_init] opencl_memory_requirement: 768
0.011280 [opencl_init] opencl_memory_headroom: 300
0.011282 [opencl_init] opencl_device_priority: '*/!0,*/*/*'
0.011284 [opencl_init] opencl_mandatory_timeout: 200
0.011286 [opencl_init] opencl_size_roundup: 16
0.011289 [opencl_init] opencl_async_pixelpipe: 0
0.011290 [opencl_init] opencl_synch_cache: 0
0.011293 [opencl_init] opencl_number_event_handles: 25
0.011295 [opencl_init] opencl_micro_nap: 1000
0.011298 [opencl_init] opencl_use_pinned_memory: 0
0.011300 [opencl_init] opencl_use_cpu_devices: 0
0.011303 [opencl_init] opencl_avoid_atomics: 0
0.011305 [opencl_init] 
0.011401 [opencl_init] could not find opencl runtime library 'libOpenCL'
0.011436 [opencl_init] could not find opencl runtime library 'libOpenCL.so'
0.011525 [opencl_init] found opencl runtime library 'libOpenCL.so.1'
0.011542 [opencl_init] opencl library 'libOpenCL.so.1' found on your system and loaded
DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [2]
param: 4, val: 0
DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [2]
param: 4, val: 0
cl_get_gt_device(): error, unknown device: 0
DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [2]
param: 4, val: 0
DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [2]
param: 4, val: 0
cl_get_gt_device(): error, unknown device: 0
0.065148 [opencl_init] found 3 platforms
DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [2]
param: 4, val: 0
cl_get_gt_device(): error, unknown device: 0
0.065370 [opencl_init] could not get device id size: -1
0.065375 [opencl_init] found 2 devices
0.065389 [opencl_init] discarding device 0 `AMD Radeon(TM) HD8800 Series (PITCAIRN, DRM 3.27.0, 4.12.14-lp151.28.32-default, LLVM 7.0.1)' due to missing image support.
0.065400 [opencl_init] discarding CPU device 1 `pthread-Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz'.
0.065403 [opencl_init] no suitable devices found.
0.065405 [opencl_init] FINALLY: opencl is NOT AVAILABLE on this system.
0.065407 [opencl_init] initial status of opencl enabled flag is OFF.


this is the output of clinfo when the amdgpu-pro driver is not installed

cl_get_gt_device(): error, unknown device: 0
cl_get_gt_device(): error, unknown device: 0
Number of platforms                               3
  Platform Name                                   Clover
  Platform Vendor                                 Mesa
  Platform Version                                OpenCL 1.1 Mesa 18.3.2
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_icd
  Platform Extensions function suffix             MESA

  Platform Name                                   Portable Computing Language
  Platform Vendor                                 The pocl project
  Platform Version                                OpenCL 1.2 pocl 1.4, RelWithDebInfo, LLVM 7.0.1, RELOC, SLEEF, DISTRO, POCL_DEBUG
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_icd
  Platform Extensions function suffix             POCL

  Platform Name                                   Intel Gen OCL Driver
  Platform Vendor                                 Intel
  Platform Version                                OpenCL 2.0 beignet 1.3
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store cl_khr_3d_image_writes cl_khr_image2d_from_buffer cl_khr_depth_images cl_khr_spir cl_khr_icd cl_int
el_accelerator cl_intel_subgroups cl_intel_subgroups_short cl_khr_gl_sharing
  Platform Extensions function suffix             Intel
cl_get_gt_device(): error, unknown device: 0

  Platform Name                                   Clover
Number of devices                                 1
  Device Name                                     AMD Radeon(TM) HD8800 Series (PITCAIRN, DRM 3.27.0, 4.12.14-lp151.28.32-default, LLVM 7.0.1)
  Device Vendor                                   AMD
  Device Vendor ID                                0x1002
  Device Version                                  OpenCL 1.1 Mesa 18.3.2
  Driver Version                                  18.3.2
  Device OpenCL C Version                         OpenCL C 1.1 
  Device Type                                     GPU
  Device Profile                                  FULL_PROFILE
  Device Available                                Yes
  Compiler Available                              Yes
  Max compute units                               20
  Max clock frequency                             925MHz
  Max work item dimensions                        3
  Max work item sizes                             256x256x256
  Max work group size                             256
  Preferred work group size multiple              64
  Preferred / native vector sizes                 
    char                                                16 / 16      
    short                                                8 / 8       
    int                                                  4 / 4       
    long                                                 2 / 2       
    half                                                 8 / 8        (cl_khr_fp16)
    float                                                4 / 4       
    double                                               2 / 2        (cl_khr_fp64)
  Half-precision Floating-point support           (cl_khr_fp16)
    Denormals                                     No
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 No
    Round to infinity                             No
    IEEE754-2008 fused multiply-add               No
    Support is emulated in software               No
  Single-precision Floating-point support         (core)
    Denormals                                     No
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 No
    Round to infinity                             No
    IEEE754-2008 fused multiply-add               No
    Support is emulated in software               No
    Correctly-rounded divide and sqrt operations  No
  Double-precision Floating-point support         (cl_khr_fp64)
    Denormals                                     Yes
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 Yes
    Round to infinity                             Yes
    IEEE754-2008 fused multiply-add               Yes
    Support is emulated in software               No
  Address bits                                    64, Little-Endian
  Global memory size                              3221225472 (3GiB)
  Error Correction support                        No
  Max memory allocation                           1717986918 (1.6GiB)
  Unified memory for Host and Device              No
  Minimum alignment for any data type             128 bytes
  Alignment of base address                       32768 bits (4096 bytes)
  Global Memory cache type                        None
  Image support                                   No
  Local memory type                               Local
  Local memory size                               32768 (32KiB)
  Max number of constant args                     16
  Max constant buffer size                        1717986918 (1.6GiB)
  Max size of kernel argument                     1024
  Queue properties                                
    Out-of-order execution                        No
    Profiling                                     Yes
  Profiling timer resolution                      0ns
  Execution capabilities                          
    Run OpenCL kernels                            Yes
    Run native kernels                            No
  Device Extensions                               cl_khr_byte_addressable_store cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_fp64 cl_khr_fp16

  Platform Name                                   Portable Computing Language
Number of devices                                 1
  Device Name                                     pthread-Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
  Device Vendor                                   GenuineIntel
  Device Vendor ID                                0x6c636f70
  Device Version                                  OpenCL 1.2 pocl HSTR: pthread-x86_64-unknown-linux-gnu-haswell
  Driver Version                                  1.4
  Device OpenCL C Version                         OpenCL C 1.2 pocl
  Device Type                                     CPU
  Device Profile                                  FULL_PROFILE
  Device Available                                Yes
  Compiler Available                              Yes
  Linker Available                                Yes
  Max compute units                               8
  Max clock frequency                             4000MHz
  Device Partition                                (core)
    Max number of sub-devices                     8
    Supported partition types                     equally, by counts
    Supported affinity domains                    (n/a)
  Max work item dimensions                        3
  Max work item sizes                             4096x4096x4096
  Max work group size                             4096
  Preferred work group size multiple              <getWGsizes:1200: create kernel : error -45>
  Preferred / native vector sizes                 
    char                                                16 / 16      
    short                                               16 / 16      
    int                                                  8 / 8       
    long                                                 4 / 4       
    half                                                 0 / 0        (n/a)
    float                                                8 / 8       
    double                                               4 / 4        (cl_khr_fp64)
  Half-precision Floating-point support           (n/a)
  Single-precision Floating-point support         (core)
    Denormals                                     Yes
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 Yes
    Round to infinity                             Yes
    IEEE754-2008 fused multiply-add               Yes
    Support is emulated in software               No
    Correctly-rounded divide and sqrt operations  Yes
  Double-precision Floating-point support         (cl_khr_fp64)
    Denormals                                     Yes
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 Yes
    Round to infinity                             Yes
    IEEE754-2008 fused multiply-add               Yes
    Support is emulated in software               No
  Address bits                                    64, Little-Endian
  Global memory size                              31524831232 (29.36GiB)
  Error Correction support                        No
  Max memory allocation                           8589934592 (8GiB)
  Unified memory for Host and Device              Yes
  Minimum alignment for any data type             128 bytes
  Alignment of base address                       1024 bits (128 bytes)
  Global Memory cache type                        Read/Write
  Global Memory cache size                        8388608 (8MiB)
  Global Memory cache line size                   64 bytes
  Image support                                   Yes
    Max number of samplers per kernel             16
    Max size for 1D images from buffer            536870912 pixels
    Max 1D or 2D image array size                 2048 images
    Max 2D image size                             16384x16384 pixels
    Max 3D image size                             2048x2048x2048 pixels
    Max number of read image args                 128
    Max number of write image args                128
  Local memory type                               Global
  Local memory size                               4194304 (4MiB)
  Max number of constant args                     8
  Max constant buffer size                        4194304 (4MiB)
  Max size of kernel argument                     1024
  Queue properties                                
    Out-of-order execution                        Yes
    Profiling                                     Yes
  Prefer user sync for interop                    Yes
  Profiling timer resolution                      1ns
  Execution capabilities                          
    Run OpenCL kernels                            Yes
    Run native kernels                            Yes
  printf() buffer size                            16777216 (16MiB)
  Built-in kernels                                (n/a)
  Device Extensions                               cl_khr_byte_addressable_store cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_3d_image_writes cl_khr_fp64 cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_fp64


  Platform Name                                   Intel Gen OCL Driver
Number of devices                                 0

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  Clover
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   Success [MESA]
  clCreateContext(NULL, ...) [default]            Success [MESA]
  clCreateContext(NULL, ...) [other]              Success [POCL]
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_DEFAULT)  Success (1)
    Platform Name                                 Clover
    Device Name                                   AMD Radeon(TM) HD8800 Series (PITCAIRN, DRM 3.27.0, 4.12.14-lp151.28.32-default, LLVM 7.0.1)
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  Success (1)
    Platform Name                                 Clover
    Device Name                                   AMD Radeon(TM) HD8800 Series (PITCAIRN, DRM 3.27.0, 4.12.14-lp151.28.32-default, LLVM 7.0.1)
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL)  Success (1)
    Platform Name                                 Clover
    Device Name                                   AMD Radeon(TM) HD8800 Series (PITCAIRN, DRM 3.27.0, 4.12.14-lp151.28.32-default, LLVM 7.0.1)

ICD loader properties
  ICD loader Name                                 OpenCL ICD Loader
  ICD loader Vendor                               OCL Icd free software
  ICD loader Version                              2.2.12
  ICD loader Profile                              OpenCL 2.2


So I either need to get the AMDGPU-PRO driver working with kernel 4.12 somehow ie fix the error :

6.434181] amdgpu: Unknown symbol __pcpu_unique_kfd_processes_srcu_srcu_data (err 0)

Or I need to install other opensource drivers (but i’m not sure what that is or where to get it from).

Help with either of the two points above will be most helpful.

Looking at the Hardware compatibility documentation for ROCm (https://rocm.github.io/hardware.html) it doesn’t look like my GPU is compatible with ROCm’s OpenCL driver.

So does that just leave trying to get the AMDGPU-PRO driver working with kernel 4.12 ?

Hi
Install the clinfo package and check…

I’m on Tumbleweed here, but I see;


clinfo

Number of platforms                               1
  Platform Name                                   Clover
  Platform Vendor                                 Mesa
  Platform Version                                OpenCL 1.1 Mesa 19.2.6
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_icd
  Platform Extensions function suffix             MESA

  Platform Name                                   Clover
Number of devices                                 2
  Device Name                                     AMD CARRIZO (DRM 3.33.0, 5.3.12-1-default, LLVM 9.0.0)
....
....
  Device Name                                     AMD Radeon (TM) R7 M340 (ICELAND, DRM 3.33.0, 5.3.12-1-default, LLVM 9.0.0)
  Device Vendor                                   AMD
  Device Vendor ID                                0x1002
  Device Version                                  OpenCL 1.1 Mesa 19.2.6
  Driver Version                                  19.2.6
  Device OpenCL C Version                         OpenCL C 1.1 
  Device Type                                     GPU
  Device Profile                                  FULL_PROFILE

Well ahead of you, The clinfo output is posted above.

Hi
I would suggest removing the AMDGPU-Pro stuff and stick with the oss driver, your card is not really supported.

Have a read here looks like some command line options, user witha GCN 1.0 card reports success(?);
https://redmine.darktable.org/issues/11702

Hi
So it’s a bug in OpenCL…

https://bugs.freedesktop.org/show_bug.cgi?id=87738

https://gitlab.freedesktop.org/mesa/mesa/issues/130

AMD dropped support for a GCN 1.
You can use older driver with an older OS. Maybe openSUSE 42.1 is suitable for GCN1 + AMD’s proprietary driver.

AFAIK OpenShot has no support for a GPGPU (OpenCL).

You can use GPGPU (OpenCL) for darktable with a Leap 15.1 and AMD’s proprietary driver if it has support for a SLE 15.

AMD often makes new versions of a graphic cards by replacing its BIOS and bumping up its numbers.
So it is possible to obtain AMD driver support by replacing BIOS firmware of a graphic card to appropriate newer version.
Maybe it is possible to cheat video driver to force it working on an older chips.

Hi,
I have same type of questions,
HW:


OS: openSUSE Leap 15.1 x86_64
Kernel: 4.12.14-lp151.28.32-default
CPU: Intel i3-6100 (4) @ 3.700GHz
GPU: AMD ATI Radeon RX 460 4GB
only modification from defaults is XFCE 4.14 from official repos

I tried to install AMD GPU-pro driver because of low framerates in Dota2 and CS:go. difference from dual boot win is huge. Tried couple of times from official guides and every time pro is installed and amdgpu is in use.
Is there a better guide for 15.1?