I'm having trouble understanding and controlling openCL

I have a new PC with a fairly high-end graphics card, an nVidia RTX 2060 with 6 GB RAM. At first, it was using the open source nouveau driver, and darktable did not detect availability of openCL. Then, I installed the proprietary nVidia driver, and darktable then detected and used openCL.

However, I just now rechecked, and darktable no longer detects openCL. I double-checked that the proprietary nVidia driver is still in use, and it is. So, I don’t understand why darktable is no longer detecting openCL. Can anyone help me understand and correct this, please?

darktable version: 3.2.1
OS: openSUSE Tumbleweed, up-to-date

08:00.0 VGA compatible controller: NVIDIA Corporation TU104 [GeForce RTX 2060] (rev a1) (prog-if 00 [VGA controller])

Kernel driver in use: nvidia

I have a relatively old nVidia card (GeForce GTX 770) but one that’s recent enough that it should be supported by the latest driver. However I had issues where if I stopped using darktable for 20-30 seconds and then went back it threw an error and reverted to CPU. I ended up having to go back to the legacy driver (340xx series) and now I don’t have any problems. So if possible it’s worth trying one of the older 340xx or 390xx driver series and see if that resolves the problem.

Try rerunning from the command line with -d opencl and see what gets output.

1 Like

darktable -d opencl
0.075370 [opencl_init] opencl related configuration options:
0.075378 [opencl_init]
0.075379 [opencl_init] opencl: 1
0.075381 [opencl_init] opencl_scheduling_profile: ‘default’
0.075382 [opencl_init] opencl_library: ‘’
0.075383 [opencl_init] opencl_memory_requirement: 768
0.075385 [opencl_init] opencl_memory_headroom: 400
0.075386 [opencl_init] opencl_device_priority: ‘/!0,///!0,*’
0.075387 [opencl_init] opencl_mandatory_timeout: 200
0.075388 [opencl_init] opencl_size_roundup: 16
0.075389 [opencl_init] opencl_async_pixelpipe: 0
0.075390 [opencl_init] opencl_synch_cache: active module
0.075391 [opencl_init] opencl_number_event_handles: 25
0.075393 [opencl_init] opencl_micro_nap: 1000
0.075394 [opencl_init] opencl_use_pinned_memory: 0
0.075395 [opencl_init] opencl_use_cpu_devices: 0
0.075396 [opencl_init] opencl_avoid_atomics: 0
0.075396 [opencl_init]
0.075461 [opencl_init] could not find opencl runtime library ‘libOpenCL’
0.075479 [opencl_init] could not find opencl runtime library ‘libOpenCL.so’
0.075532 [opencl_init] found opencl runtime library ‘libOpenCL.so.1’
0.075545 [opencl_init] opencl library ‘libOpenCL.so.1’ found on your system and loaded
0.097885 [opencl_init] could not get platforms: -1001
0.097893 [opencl_init] FINALLY: opencl is NOT AVAILABLE on this system.
0.097895 [opencl_init] initial status of opencl enabled flag is OFF.

And, these libraries exist on my system:
find /usr -name OpenCL

I’ve had problems recently with OpenCL crashing. This happens most frequently when the computer wakes from suspend. Closing Darktable, typing “sudo rmmod nvidia_uvm; sudo modprobe nvidia_uvm” and restarting Darktable fixes the problem. However, I haven’t investigated further.

1 Like

Thanks, @Frank_Lepore . I think a reboot may be in order.

Two minutes later: Yes, rebooting the host got openCL working again, systemwide and for darktable.

Something(s) new I learned while troubleshooting: LibreOffice uses openCL, too. And, separately, there is a clinfo package and tool that shows the overall status of openCL on the system. I also learned that my nVidia card has 1,920 Cuda cores for processing.