OpenCL Dead after suspend with Darktable

Hi all,
I’ve got a strange problem with Manjaro which doesn’t occur with other distrubutions.
Installed is the follwoing configuration:
Gnome 3.38.4
GeForce GTX 1050
OpenCL 1.2 CUDA
Kernel: Linux manjaro 5.9.16-1
Darktable 3.41 (not flatpak → AUR Repo)
Nvidia Driver: 460.56

If I’m starting from suspend, everything is fine and OpenCL for Darktable is available. If I’m starting from suspend with Darktable, Open CL stops working and the only thing that helps is a reboot. If Darktable is closed and I start it after suspend, I’m fine and everything works well. It seems to be a Manjaro problem because it does not happen with any other distribution. I don’t get an error or anything, OpenCl just stops working. A reload of the modules is not possible and I’ve found no hint with Google or whatever how to fix that.

Is anyone here who has an idea?

Thanks in advance
items

Hi,

I have seen a behaviour that opencl gets disabled in the past also with other distribution.

Not occurding here in manjaro as of today :wink:

I remember from those times, that a web search brought me to commands to reload nvidia_uvm, that allowed to restart opencl without reboot.
Not sure if this would applicable also for your manjaro setup, but perhaps an area to review:
sudo modprobe -r nvidia_uvm && sudo modprobe nvidia_uvm

Hi,
I’ve tried your solution a few months ago and I always got the message that it is not possible because the module is “in use”. But however, it works now and Open Cl is back :slight_smile:

Great, thanks a lot!

Unfortunatley it just worked once:
When I do it now I got the same message like the last times:
modprobe: FATAL: Module nvidia_uvm is in use.

Do you have an idea how to solve it and why it has just worked for one time? I have just one graphic card, so I thinks this is why I can’t remove the module before reloading it. But it works a few minutes ago and I can’t repeat it. Is there a way to force the reload maybe?

Hi,

no glue actually. Did you check the output of “darktable-cltest”?
I remember that this also helped when I had such issues in a way that it forces the building of the cl modules.
But as said: currently I have no issues with disappearing opencl with manjaro.
I nevertheless use darktable-git from AUR and am on NVIDIA 460.56 with a GeForce GTX 1060 adapter.

Ok, this is interesting, thank you DerMateng!

I can reload the module if Darktable is not up and running. So I suppose it is not the graphic card that uses the module but it is DT. If I close DT a reload is no problem. So I’m fine for this moment, because a reboot is not necessary. We’ve got almost the same configuration (You have a 1060, I have a 1050 but we both use the 460.56 driver) and maybe I should try the git Version you are using. It is DT 3.5 but maybe this will help. I’ve found some hints in the internet, but not a solution that really fixes the issue.

I’m a distrohopper so I’m setting up the system very often and I already had this issue with all other Manjaro installations in the last months (either KDE, Cinnamon etc.) but never with Ubuntu, Fedora, PopOS etc. Got absolutely no idea what went wrong here…

Hi,

I don’t think this really is related to the dt version. Be careful when changing to git-version. Backup configs and database. There is no way back from 3.5xx to release version as the database structure changes! so backup…backup…
As said, interesintg here that I (knocking on wood) have not seen a deactivated opencl with manjaro, but have seen it in the past with MX Linux (older NVidia drivers …)

Ok, thats really an important hint about the database! Thanks again!

I’ve also written a script which does the reload automatically after the suspend but of course it doesn’t work, because DT is running. But anyway, the annoying reboot is history now and so I’m fine :slight_smile:

The solution is not perfect but it works without reboot. Put this into a shell script:

    #!/bin/sh
    dt=$(pidof darktable)
    kill $dt
    sudo modprobe -r nvidia_uvm && sudo modprobe nvidia_uvm
    darktable &

copy the script into /usr/bin and make it excecutable (chmod 755 nvidia.sh). After suspend you can call the script by typing nvidia.sh and Dt will be closed, the necessary modules will be reloaded and Dt will start again. Unfortunately “modprobe…” requires the root password but this is easier than doing all this manually.