OpenCL not available after 'suspend/resume' cycle. Is there an easy work around?

Thanks for spending the time, with examples I can copy, to explain in detail why you have libOpenCL.so.

The version of darktable that had been experiencing OpenCL availability problems (4.6.1) is one I compiled my self on this PC. Running the first locate command you showed gives this result on this PC:
tony@MS-7D15:~$ ls -l locate libOpenCL.so

lrwxrwxrwx 1 root root 18 Sep 30 2021 /usr/lib/i386-linux-gnu/libOpenCL.so.1 → libOpenCL.so.1.0.0
-rw-r–r-- 1 root root 80124 Sep 30 2021 /usr/lib/i386-linux-gnu/libOpenCL.so.1.0.0
lrwxrwxrwx 1 root root 18 Aug 8 2023 /usr/lib/x86_64-linux-gnu/libOpenCL.so.1 → libOpenCL.so.1.0.0
-rw-r–r-- 1 root root 69288 Sep 30 2021 /usr/lib/x86_64-linux-gnu/libOpenCL.so.1.0.0
lrwxrwxrwx 1 root root 14 Aug 8 2023 /usr/share/man/man7/libOpenCL.so.7.gz → libOpenCL.7.gz
lrwxrwxrwx 1 root root 18 Mar 19 08:35 /var/lib/flatpak/runtime/org.gnome.Platform/x86_64/45/e66d066758b2a7b50a1cac032041fc1569c428f7cff988dcba554b3c035a191d/files/lib/x86_64-linux-gnu/libOpenCL.so.1 → libOpenCL.so.1.0.0
-rwxr-xr-x 2 root root 190344 Mar 11 19:39 /var/lib/flatpak/runtime/org.gnome.Platform/x86_64/45/e66d066758b2a7b50a1cac032041fc1569c428f7cff988dcba554b3c035a191d/files/lib/x86_64-linux-gnu/libOpenCL.so.1.0.0

libOpenCl.so is not listed.

See also this screen shot:

Again, libOpenCL.so does not appear.

And I certainly was not aware that I had to install the package ocl-icd-opencl-dev:amd64: prior to compiling darktable. Even now Synaptic tells me that this package is not installed

yet somehow my compiled version of dt 4.6.1 has OpenCL support in it. I don’t understand how this can be.

The absence of libOpenCL.so is not the problem, as you have libOpenCL.so.1, as darktable-cltest tells you:
"0.0161 [opencl_init] opencl library libOpenCL.so.1 found on your system and loaded, preference ‘default path’ "
(my system doesn’t have libOpenCL.so and darktable works with openCL). Darktable links to this library, and won’t compile openCL support without it.

Then there is the issue of having all the bits needed byopenCL needs at a lower level. You do not need all the parts of the driver to compile darktable, but you will need them for any program using openCL.
Darktable compilation will not warn you when anything at that level is missing

Darktable_cltest does tell you there is a problem at that level:
“0.0200 [opencl_init] 0 platforms detected, error: unknown OpenCL error”.
What the exact issue is, is impossible to tell from here, as we can’t see which packages you actually have installed (name and version, make sure versions match, and that when there is an upgrade, you upgrade all packages to the same version number)

As problems happens after a sleep/resume, and reloading the nvidia driver gets openCL working again, it looks like there’s a problem at the driver level, where the hardware isn’t restarted properly on resume (unfortunately not all that uncommon under linux).

1 Like