BUG: rendering broken after waking from suspend

I want to report a long-standing bug that I’ve been seeing for the past couple of years on different versions of nvidia Linux drivers, different kernels, and different nVidia cards. After suspending the computer (e.g. with sudo echo mem > /sys/power/state) and then waking up rendering of applications that render on the GPU is broken. Here are some concrete examples:

  1. When Firefox is fully rendered with hardware acceleration (layers.acceleration.force-enabled set to true in about:config) the whole interface disappears after waking from suspend and playing a video (say, on YT). The browser doesn’t crash. It is fully responsive but otheriwse the whole application window renders as black surface, leaving only the window decoration. The only way to recover is to restart the browser. This is fully detailed in a Firefox bug report here.

  2. Similar problem happens with Chromium, except there only the web page turns black and the application interface remains intact. Scrolling the page restores some of its elements and refreshing the page results in it being rendered correctly, so unlike with Firefox it is possible to recover without restarting the application. Here’s a screenshot of broken Chromium rendering with some of the page elements have been restored with scrolling:

  1. When emulating a 3D game using RetroArch the rendering scene turns to black after suspend. Additionally, rendering of RetroArch interface also becomes broken with all icons not being displayed at all.

Not all GPU-rendering apps exhibit problems though. Discord and Vivaldi seem to work fine. EDIT I take back what I said about Vivaldi. After putting to sleep and waking up the whole application window sometimes turns black and recovers to normal after a second or so.

As stated earlier, I’ve been consistently experiencing these issues on nvidia hardware. Currently I can reproduce the above problems on:

  • Quadro M2000M, drivers 418.152, kernel 4.19
  • GeForce RTX 2070 Super, driver 440.100, kernel 5.7

Attaching nvidia-bug-report output for the latter.

nvidia-bug-report.log.gz (940.0 KB)

Is there a known workaround for these issues?

I had the same problem for a while and it’s getting worse with the latest version, now after suspension chrome display is completely corrupted and it has to be restarted.

GeForce GTX 1050
Driver Version: 450.66
Kernel: 5.8.5-arch1-1

Same issue. I tried the new power management which was supposed to resolve it but has not improved things for me.

GeForce GTX 1650
Driver Version: 440.100
Kernel: 5.6.0-1023-oem

Use the provided systemd scripts for power management. They work for me.

Sadly, they don’t for me. I’ve tried setting up the scripts following the instructions in the documentation but it Just Doesn’t Work. Not even sure how to debug this, but I suspect the suspend scripts might not be running before suspending.

Interestingly, the documentations says:

NVIDIA kernel drivers are designed to act conservatively, and normally only save essential video memory allocations.

Is there a way to control the amount of video memory saved at suspend? Applications on my system typically allocate ~220MB so being able to save 250-300MB would probably suffice for me. This doesn’t seem like a huge amount.