OpenCL problems again (Solved)

So now it seems to be my turn to ask for some OpenCL help, as OpenCL is not working. I just got a new laptop and installed Linux Mint 22 on it. It’s got an Nvidia RTX 4060 GPU, and I have the Nvidia 550 driver installed via Driver Manager. Darktable is 4.8.1 from OBS.

On my old laptop, I have darktable 4.9, also from OBS, and also Nvidia 550 and OpenCL is working fine.

On the new one, darktable reports OpenCL as not available, and clinfo just says:

~$ clinfo
Number of platforms 0

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

I was reading this thread and tried as suggested
dpkg -l | grep ^ii|grep -i nvidia which returns this on both systems:

> ~$ dpkg -l | grep ^ii|grep -i nvidia
> ii  libnvidia-cfg1-550:amd64                   550.107.02-0ubuntu0.24.04.1                amd64        NVIDIA binary OpenGL/GLX configuration library
> ii  libnvidia-common-550                       550.107.02-0ubuntu0.24.04.1                all          Shared files used by the NVIDIA libraries
> ii  libnvidia-compute-550:amd64                550.107.02-0ubuntu0.24.04.1                amd64        NVIDIA libcompute package
> ii  libnvidia-compute-550:i386                 550.107.02-0ubuntu0.24.04.1                i386         NVIDIA libcompute package
> ii  libnvidia-decode-550:amd64                 550.107.02-0ubuntu0.24.04.1                amd64        NVIDIA Video Decoding runtime libraries
> ii  libnvidia-decode-550:i386                  550.107.02-0ubuntu0.24.04.1                i386         NVIDIA Video Decoding runtime libraries
> ii  libnvidia-egl-wayland1:amd64               1:1.1.13-1build1                           amd64        Wayland EGL External Platform library -- shared library
> ii  libnvidia-egl-wayland1:i386                1:1.1.13-1build1                           i386         Wayland EGL External Platform library -- shared library
> ii  libnvidia-encode-550:amd64                 550.107.02-0ubuntu0.24.04.1                amd64        NVENC Video Encoding runtime library
> ii  libnvidia-encode-550:i386                  550.107.02-0ubuntu0.24.04.1                i386         NVENC Video Encoding runtime library
> ii  libnvidia-extra-550:amd64                  550.107.02-0ubuntu0.24.04.1                amd64        Extra libraries for the NVIDIA driver
> ii  libnvidia-fbc1-550:amd64                   550.107.02-0ubuntu0.24.04.1                amd64        NVIDIA OpenGL-based Framebuffer Capture runtime library
> ii  libnvidia-fbc1-550:i386                    550.107.02-0ubuntu0.24.04.1                i386         NVIDIA OpenGL-based Framebuffer Capture runtime library
> ii  libnvidia-gl-550:amd64                     550.107.02-0ubuntu0.24.04.1                amd64        NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
> ii  libnvidia-gl-550:i386                      550.107.02-0ubuntu0.24.04.1                i386         NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
> ii  nvidia-compute-utils-550                   550.107.02-0ubuntu0.24.04.1                amd64        NVIDIA compute utilities
> ii  nvidia-dkms-550                            550.107.02-0ubuntu0.24.04.1                amd64        NVIDIA DKMS package
> ii  nvidia-driver-550                          550.107.02-0ubuntu0.24.04.1                amd64        NVIDIA driver metapackage
> ii  nvidia-firmware-550-550.107.02             550.107.02-0ubuntu0.24.04.1                amd64        Firmware files used by the kernel module
> ii  nvidia-kernel-common-550                   550.107.02-0ubuntu0.24.04.1                amd64        Shared files used with the kernel module
> ii  nvidia-kernel-source-550                   550.107.02-0ubuntu0.24.04.1                amd64        NVIDIA kernel source package
> ii  nvidia-prime                               0.8.17.2                                   all          Tools to enable NVIDIA's Prime
> ii  nvidia-prime-applet                        1.4.2                                      all          An applet for NVIDIA Prime
> ii  nvidia-settings                            510.47.03-0ubuntu4                         amd64        Tool for configuring the NVIDIA graphics driver
> ii  nvidia-utils-550                           550.107.02-0ubuntu0.24.04.1                amd64        NVIDIA driver support binaries
> ii  screen-resolution-extra                    0.18.3                                     all          Extension for the nvidia-settings control panel
> ii  xserver-xorg-video-nvidia-550              550.107.02-0ubuntu0.24.04.1                amd64        NVIDIA binary Xorg driver

So the same packages are installed on both. Any idea why I have no OpenCL on the new machine and how to get it to work? Anything more you need to know?

What about darktable -d opencl and darktable-cltest?

Ah, of course.

darktable-cltest:

~$ darktable-cltest
darktable 4.8.1
Copyright (C) 2012-2024 Johannes Hanika and other contributors.

Compile options:
  Bit depth              -> 64 bit
  Debug                  -> DISABLED
  SSE2 optimizations     -> ENABLED
  OpenMP                 -> ENABLED
  OpenCL                 -> ENABLED
  Lua                    -> ENABLED  - API version 9.3.0
  Colord                 -> ENABLED
  gPhoto2                -> ENABLED
  GMIC                   -> ENABLED  - Compressed LUTs are supported
  GraphicsMagick         -> ENABLED
  ImageMagick            -> DISABLED
  libavif                -> DISABLED
  libheif                -> ENABLED
  libjxl                 -> ENABLED
  OpenJPEG               -> ENABLED
  OpenEXR                -> ENABLED
  WebP                   -> ENABLED

See https://www.darktable.org/resources/ for detailed documentation.
See https://github.com/darktable-org/darktable/issues/new/choose to report bugs.

     0,0151 [dt_get_sysresource_level] switched to 1 as `default'
     0,0152   total mem:       15610MB
     0,0152   mipmap cache:    1951MB
     0,0152   available mem:   7805MB
     0,0152   singlebuff:      121MB
     0.0175 [opencl_init] opencl disabled via darktable preferences
     0.0175 [dt_dlopencl_init] could not find default opencl runtime library 'libOpenCL'
     0.0176 [dt_dlopencl_init] could not find default opencl runtime library 'libOpenCL.so'
     0.0176 [opencl_init] opencl library 'libOpenCL.so.1' found on your system and loaded, preference 'default path'
     1.0589 [opencl_init] 0 platforms detected, error: Unknown OpenCL error
     1.0589 [opencl_init] FINALLY: opencl PREFERENCE=OFF is NOT AVAILABLE and NOT ENABLED.

darktable -d opencl:

~$ darktable -d opencl
darktable 4.8.1
Copyright (C) 2012-2024 Johannes Hanika and other contributors.

Compile options:
  Bit depth              -> 64 bit
  Debug                  -> DISABLED
  SSE2 optimizations     -> ENABLED
  OpenMP                 -> ENABLED
  OpenCL                 -> ENABLED
  Lua                    -> ENABLED  - API version 9.3.0
  Colord                 -> ENABLED
  gPhoto2                -> ENABLED
  GMIC                   -> ENABLED  - Compressed LUTs are supported
  GraphicsMagick         -> ENABLED
  ImageMagick            -> DISABLED
  libavif                -> DISABLED
  libheif                -> ENABLED
  libjxl                 -> ENABLED
  OpenJPEG               -> ENABLED
  OpenEXR                -> ENABLED
  WebP                   -> ENABLED

See https://www.darktable.org/resources/ for detailed documentation.
See https://github.com/darktable-org/darktable/issues/new/choose to report bugs.

     0,0379 [dt_get_sysresource_level] switched to 1 as `default'
     0,0379   total mem:       15610MB
     0,0379   mipmap cache:    1951MB
     0,0379   available mem:   7805MB
     0,0379   singlebuff:      121MB
     0.0404 [opencl_init] opencl disabled via darktable preferences
     0.0405 [dt_dlopencl_init] could not find default opencl runtime library 'libOpenCL'
     0.0405 [dt_dlopencl_init] could not find default opencl runtime library 'libOpenCL.so'
     0.0406 [opencl_init] opencl library 'libOpenCL.so.1' found on your system and loaded, preference 'default path'
     1.1136 [opencl_init] 0 platforms detected, error: Unknown OpenCL error
     1.1136 [opencl_init] FINALLY: opencl PREFERENCE=OFF is NOT AVAILABLE and NOT ENABLED.

Seems like they both do the same?

Since you have nvidia-prime are you sure your GPU is switched on before launching DT?

Yes, it’s on “Nvidia on demand”, just like on the old laptop, where it works.

Can you just turn it “on” instead of “on demand”?

There is some OS issue going on since clinfo is not finding the GPU. Do you have secure boot on? Sometimes I need to restart the system.

I tried, but no difference.

What is safeboot, is it the same as Secureboot? I think it is on. I have restarted the systems many times, no difference.

Yes, I too suspect something on the OS level. If we don’t find a solution, I might just install Mint 21.3 and see if that helps. I haven’t done much on this machine yet so no big deal, but it would be nice to avoid.

Isn’t there a package named something like nvidia-opencl?

Not that I can see. I find nvidia-opencl-dev, which is not installed and should not be necessary either.

I think you should ask in the Mint Forums for nvidia help.

Yeah, maybe I’ll try that. Thanks to both of you, though.

Update: I went to the Mint forums and I found a pinned post about these things. It was a Secureboot issue, I had overlooked a configuration step. So now opencl works, and also my external monitor, which suffered from the same issue.

It’s so much easier to be lazy and come here first, since I stop by here every day, but I should of course have gone to the Mint forums first.

In case others have this problem, here’s a link to the forum post:
https://forums.linuxmint.com/viewtopic.php?t=424779

3 Likes