OpenCL & AMD Vega 8

Hello,

I have an Amd Ryzen 5 3500u laptop with an integrated Vega 8 graphics card. Under Windows the OpenCL is activated normally, the startup is much slower than with Linux, but then the development is faster and more fluid.
After failures with Debian 11, I tried several distributions without success and ended up keeping Linux Mint LMDE 5.

Do you have a solution to propose, here is the result of the clinfo command,
thank you for your help,
Christian

cc@cc:~$ clinfo
Number of platforms                              1
  Platform Name                                  Clover
  Platform Vendor                                Mesa
  Platform Version                                OpenCL 1.1 Mesa 20.3.5
  Platform Profile                                FULL_PROFILE
  Platform Extensions                            cl_khr_icd
  Platform Extensions function suffix            MESA

  Platform Name                                  Clover
Number of devices                                1
  Device Name                                    AMD Radeon™ Vega 8 Graphics (RAVEN, DRM 3.40.0, 5.10.0-18-amd64, LLVM 11.0.1)
  Device Vendor                                  AMD
  Device Vendor ID                                0x1002
  Device Version                                  OpenCL 1.1 Mesa 20.3.5
  Driver Version                                  20.3.5
  Device OpenCL C Version                        OpenCL C 1.1
  Device Type                                    GPU
  Device Profile                                  FULL_PROFILE
  Device Available                                Yes
  Compiler Available                              Yes
  Max compute units                              8
  Max clock frequency                            1200MHz
  Max work item dimensions                        3
  Max work item sizes                            256x256x256
  Max work group size                            256
  Preferred work group size multiple (kernel)    64
  Preferred / native vector sizes               
    char                                                16 / 16     
    short                                                8 / 8     
    int                                                  4 / 4     
    long                                                2 / 2     
    half                                                0 / 0        (n/a)
    float                                                4 / 4     
    double                                              2 / 2        (cl_khr_fp64)
  Half-precision Floating-point support          (n/a)
  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                          2254857830 (2.1GiB)
  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                        67108864 (64MiB)
  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

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  Clover
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)  Success [MESA]
  clCreateContext(NULL, ...) [default]            Success [MESA]
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_DEFAULT)  Success (1)
    Platform Name                                Clover
    Device Name                                  AMD Radeon™ Vega 8 Graphics (RAVEN, DRM 3.40.0, 5.10.0-18-amd64, LLVM 11.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™ Vega 8 Graphics (RAVEN, DRM 3.40.0, 5.10.0-18-amd64, LLVM 11.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™ Vega 8 Graphics (RAVEN, DRM 3.40.0, 5.10.0-18-amd64, LLVM 11.0.1)

ICD loader properties
  ICD loader Name                                OpenCL ICD Loader
  ICD loader Vendor                              OCL Icd free software
  ICD loader Version                              2.2.14
  ICD loader Profile                              OpenCL 3.0

Salut/Hallo @Christian-B

You will find some info here: Can't use OpenCL with AMD APU due to 256 MB detected (and possibly 217.6 MB per allocation limit) · Issue #11401 · darktable-org/darktable · GitHub

Have fun!
Claes in Lund, Sweden

Has there been a change to the AMD drivers recently though?
Blender 3.3 now runs on Vega APUs and discrete chips…
Blender 3.3 Release notes

edit: ah sorry, this is HIP and not OpenCL related methinks.

Post the darktable-cltest info

Hello,

Thank you very much for your help, here is the info of the “darktable-cltest” command :

$ /opt/darktable/bin/darktable-cltest
[dt_get_sysresource_level] switched to 3 as `unrestricted'
  total mem:       13940MB
  mipmap cache:    1742MB
  available mem:   223046MB
  singlebuff:      13940MB
  OpenCL tune mem: OFF
  OpenCL pinned:   OFF
[opencl_init] opencl related configuration options:
[opencl_init] opencl: ON
[opencl_init] opencl_scheduling_profile: 'default'
[opencl_init] opencl_library: 'default path'
[opencl_init] opencl_device_priority: '*/!0,*/*/*/!0,*'
[opencl_init] opencl_mandatory_timeout: 400
[opencl_init] opencl_synch_cache: active module
[opencl_init] opencl library 'libOpenCL' found on your system and loaded
[opencl_init] found 1 platform
[opencl_init] found 1 device

[dt_opencl_device_init]
   DEVICE:                   0: 'AMD Radeon(TM) Vega 8 Graphics (RAVEN, DRM 3.40.0, 5.10.0-18-amd64, LLVM 11.0.1)'
   CANONICAL NAME:           amdradeontmvega8graphicsravendrm3400510018amd64llvm1101
   PLATFORM NAME & VENDOR:   Clover, Mesa
   DRIVER VERSION:           20.3.5
   DEVICE VERSION:           OpenCL 1.1 Mesa 20.3.5
   DEVICE_TYPE:              GPU
   *** The OpenCL driver doesn't provide image support. See also 'clinfo' output ***
[opencl_init] no suitable devices found.
[opencl_init] FINALLY: opencl is NOT AVAILABLE on this system.
[opencl_init] initial status of opencl enabled flag is OFF.

Greetings from Brussels
Christian

I dont use AMD GPU, but this is your current issue. I think I read a post around and GPU and some flags to enable the openCL.

Hello,

Thanks for the link, but in all honesty, I don’t understand much of it. Moreover, my English is not optimal… :wink:
I also tried with the AMD-GPU-PRO driver on Debian 11, which gave me an unstable machine.

below is the output of clinfo,

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

  Platform Name                                   Clover
Number of devices                                 1
  Device Name                                     AMD Radeon(TM) Vega 8 Graphics (RAVEN, DRM 3.40.0, 5.10.0-18-amd64, LLVM 11.0.1)
  Device Vendor                                   AMD
  Device Vendor ID                                0x1002
  Device Version                                  OpenCL 1.1 Mesa 20.3.5
  Driver Version                                  20.3.5
  Device OpenCL C Version                         OpenCL C 1.1 
  Device Type                                     GPU
  Device Profile                                  FULL_PROFILE
  Device Available                                Yes
  Compiler Available                              Yes
  Max compute units                               8
  Max clock frequency                             1200MHz
  Max work item dimensions                        3
  Max work item sizes                             256x256x256
  Max work group size                             256
  Preferred work group size multiple (kernel)     64
  Preferred / native vector sizes                 
    char                                                16 / 16      
    short                                                8 / 8       
    int                                                  4 / 4       
    long                                                 2 / 2       
    half                                                 0 / 0        (n/a)
    float                                                4 / 4       
    double                                               2 / 2        (cl_khr_fp64)
  Half-precision Floating-point support           (n/a)
  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                           2254857830 (2.1GiB)
  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                        67108864 (64MiB)
  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

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  Clover
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   Success [MESA]
  clCreateContext(NULL, ...) [default]            Success [MESA]
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_DEFAULT)  Success (1)
    Platform Name                                 Clover
    Device Name                                   AMD Radeon(TM) Vega 8 Graphics (RAVEN, DRM 3.40.0, 5.10.0-18-amd64, LLVM 11.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) Vega 8 Graphics (RAVEN, DRM 3.40.0, 5.10.0-18-amd64, LLVM 11.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) Vega 8 Graphics (RAVEN, DRM 3.40.0, 5.10.0-18-amd64, LLVM 11.0.1)

ICD loader properties
  ICD loader Name                                 OpenCL ICD Loader
  ICD loader Vendor                               OCL Icd free software
  ICD loader Version                              2.2.14
  ICD loader Profile                              OpenCL 3.0

Greetings from Brussels,
Christian