[396.45] GPU lockup (screen freeze) after resume from hibernation / suspend

I have been experiencing GPU lockups after resuming from hibernation on KUbuntu 18.04.

When this happens, the display freezes except for the mouse cursor. It is possible to ssh into the computer but killing X does not update the display either.

These lockups seem to happen at a random time after hibernation. Sometimes the computer works correctly for hours after resuming, sometimes the lockup happen a few seconds after resuming. Actions that are prone to trigger the lockup are :

  • hovering over some task in KDE/Plasma panel and causing the miniature of the application window to be displayed (when a lockup happens, it is often when I do this, but doing this does not systematically incur a lockup) ;
  • with Spectacle (screenshot utility), start selecting a rectangular region (this has systematically caused a lockup when tried after resuming from hibernation/suspend).

Following https://wiki.ubuntu.com/X/Troubleshooting/Freeze I tried with the latest graphics drivers from the graphics-drivers PPA, the latest version of Xorg in the xorg-edgers PPA and the latest available kernel (4.17.0-996-generic).

Attached are some logs, including a partial log produced by nvidia-bug-report. Indeed, the script could not complete. Inspection of the running processes with a second ssh connection while the script was hanging up shows that the blocking point is

cat /proc/driver/nvidia/./gpus/0000:01:00.0/information

. Indeed, trying to manually read that file in the ssh console also caused it to hang. Of course doing this in normal operation works and gives

Model:           Quadro K620
IRQ:             127
GPU UUID:        GPU-ea026ffc-2c0d-1301-c365-b1cceeb45601
Video BIOS:      82.07.7a.00.1a
Bus Type:        PCIe
DMA Size:        40 bits
DMA Mask:        0xffffffffff
Bus Location:    0000:01:00.0
Device Minor:    0

nvidia-bug-report.log.gz (111 KB)
Xorg.0.log (45.3 KB)
dmesg.log (91.9 KB)
journalctl.log (501 KB)

The same problem seems to arise with my laptop, running a Geforce 840M with driver 390.77.