What's needed for an OpenCL accelerated darktable in Manjaro?

Hi! My GTX 970M mostly gives me the option to “activate OpenCL support” in darktable.

However, after a few days (or hours) of uptime it becomes grayed out and I must reboot Manjaro KDE to get the option back. It’s the same with NVENC in OBS.

I don’t start OBS or darktable with prime-run, but I’ve tried to and it doesn’t seem to make any difference. Once the OpenCL option is gone I have to reboot.

I wonder if I have all the packages needed for stable OpenCL acceleration in darktable. I’m using the proprietary Nvidia drivers and I have have the following packages when searching for “nvidia” in pamac:

  • nvidia-prime
  • nvidia-utils
  • lib32-nvidia-utils
  • linux510-nvidia
  • mhwd-nvidia
  • mhwd-nvidia-390xx
  • mhwd-nvidia-470xx
  • opencl-nvidia

I saw somewhere that the (4 GB!) cuda package was also recommended. I don’t have optimus-manager. Are any of these recommended or necessary? Am I missing anything else?

Why on earth would it grey out? Sounds as if something is not really stable.

It is a long time since I was using Manjaro, I’ll see if I can dig up some notes from that time. One thing needed in those days, I recall, was ocl-icd.

– a little later –

Found it:

Have fun!
Claes in Lund, Sweden

There have been a few OpenCL-related topics. Your card or your machine could be running out of memory. You could increase the opencl memory headroom parameter.

I’m on a tram now, but search for opencl in recent topics (the past two months).

Edit: found this

If your computer goes to suspend/standby/sleep while darktable is active, opencl will be disable and you need to reboot. I think it’s and Nvidia “bug”. I think there is some experimental script or so to prevent this for Fedora.
The only way to prevent this is closing darktable if you know that your PC will suspend.

1 Like

Thank you @betazoid! I was able to reproduce the error with you information. Once I close the lid while darktable is running it’s goodbye to OpenCL and only a restart works. Arghh… This is extremely frustrating. I mean, it’s a laptop. :neutral_face:

1 Like

If that is the case, unloading and reloading (some of the) nvidia modules might work. I’ve already turned my computer off for the night. Try lsmod, rmmod and modprobe.

1 Like

Thanks! I’ll try to explore that. If you come up with something when you’re at the computer, I’m all ears. :slight_smile:

Don’t know if this could work on Manjaro:

sudo rmmod nvidia_uvm
sudo modprobe nvidia_uvm

I’ll give it a try tomorrow.

EDIT: This is giving me high hopes. Not elegant, but better than reboot.

facing same issue on manjaro linux. the temporary fix mentioned here works.

1 Like

The cuda package isn’t required for darktable. I would advise reading the Arch Linux Wiki and linked topics if you haven’t already.

1 Like
sudo rmmod nvidia_uvm
sudo modprobe nvidia_uvm

Did the trick. OpenCL is available in darktable again after disappearing due to closing the lid.

I guess I just need to automate this when opening the lid and getting the machine out of sleep.

2 Likes

Or close darktable before putting the machine to sleep?

You have too high thoughts about my ability to remember simple things. :slight_smile:
But yeah, darktable has to be restarted anyway. Or else it won’t find OpenCL again after doing:

It’s a very welcome alternative to rebooting the computer for those times you forget to exit every OpenCL accelerated application before closing the lid.