Frequent system freezes when app switches to full-screen mode

When an app goes into full-screen mode, Nvidia driver very frequently crashes and freezes the whole system, requiring a reboot. This did not use to happen, but it has been happening lately (I’m guessing as of 570.144) with a very high probability. I think it’s more likely to happen when the system has been running for some amount of time, because right after it crashes and I reboot, it doesn’t happen a second time.

Examples of apps that have crashed as soon as they switch to full screen:

  • No Man’s Sky running via Steam/Proton,
  • Remmina RDP client.

When the crash happens, the picture on the screen remains frozen. The system usually remains responsive to Caps Lock (the light toggles when pressing the key) and to Magic SysRq combinations, but there’s no way to get it back into a usable state. Switching to console mode does not work. SysRq+I can sometimes reset the graphics and the picture changes, but the only thing that shows up is some garbled image. Eventually the system completely freezes and stops responding to anything.

I’m using Bazzite with KDE and Wayland.

Relevant logs (captured after rebooting):
nvidia-bug-report.log.gz (686.6 KB)
nvidia_crash_journalctl_boot-1.log (17.0 KB)
nvidia_crash_dmesg.log (106.1 KB)

At the time of the crash this shows up in the log (the Pageflip error keeps repeating):

May 11 19:44:50 muon kwin_wayland[2268]: kwin_scene_opengl: Could not delete texture because no context is current
May 11 19:44:51 muon kwin_wayland[2268]: kwin_wayland_drm: Pageflip timed out! This is a bug in the nvidia-drm kernel driver
May 11 19:44:51 muon kwin_wayland[2268]: kwin_wayland_drm: Please report this at https://forums.developer.nvidia.com/c/gpu-graphics/linux
May 11 19:44:51 muon kwin_wayland[2268]: kwin_wayland_drm: With the output of 'sudo dmesg' and 'journalctl --user-unit plasma-kwin_wayland --boot 0'

However, I can see some critical-looking errors towards the beginning of the log, which could be the cause of the issue and why subsequently there’s a crash the next time I switch to full-screen (this is pure speculation, but it’s worth looking into, given that right after a reboot it tends to not crash).

May 11 00:42:56 muon kwin_wayland[2268]: kf.config.core: "\"restore1\" - conversion of \"-20,79.2,20.799999999999997,20.799999999999997\" to QRect failed"
May 11 00:42:56 muon kwin_wayland[2268]: kf.config.core: "\"fsrestore1\" - conversion of \"0,0,0,0\" to QRect failed"
May 11 00:42:56 muon kwin_wayland[2268]: kf.windowsystem: static bool KX11Extras::mapViewport() may only be used on X11
May 11 00:44:12 muon kwin_wayland[2268]: kf.windowsystem: static bool KX11Extras::mapViewport() may only be used on X11
May 11 00:44:13 muon kwin_wayland[2268]: kf.windowsystem: static bool KX11Extras::mapViewport() may only be used on X11
May 11 00:44:59 muon kwin_wayland[2268]: kf.windowsystem: static bool KX11Extras::mapViewport() may only be used on X11
May 11 00:45:49 muon kwin_wayland[2268]: kf.windowsystem: static bool KX11Extras::mapViewport() may only be used on X11
May 11 00:45:49 muon kwin_wayland[2268]: kwin_scene_opengl: 0x501: GL_INVALID_VALUE error generated. <levels>, <width> and <height> must be 1 or greater.
May 11 00:45:49 muon kwin_wayland[2268]: kwin_scene_opengl: Invalid framebuffer status:  "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT"
May 11 00:45:49 muon kwin_wayland[2268]: kwin_scene_opengl: 0x502: GL_INVALID_OPERATION error generated. Framebuffer name must be generated before being bound.
May 11 00:45:49 muon kwin_wayland[2268]: kwin_scene_opengl: 0x506: GL_INVALID_FRAMEBUFFER_OPERATION error generated. Operation is not valid because a bound framebuffer is not framebuffer complete.
May 11 00:45:49 muon kwin_wayland[2268]: kwin_scene_opengl: 0x501: GL_INVALID_VALUE error generated. <levels>, <width> and <height> must be 1 or greater.
...
May 11 17:07:07 muon kscreenlocker_greet[174907]: qt.qpa.wayland: Could not create EGL surface (EGL error 0x3003)
May 11 17:07:07 muon kscreenlocker_greet[174907]: Failed to write to the pipe: Bad file descriptor.

This just happened again. Here’s another set of logs:
nvidia_crash1_dmesg.log (104.9 KB)
nvidia_crash1_journalctl_boot-1.log (686.5 KB)
nvidia-bug-report.log.gz (450.8 KB)

Is anybody reading this forum where Nvidia system logs tell us to post Nvidia crash reports to?

Here’s another set:
nvidia_crash2_dmesg.log (107.8 KB)
nvidia_crash2_journalctl_boot-1.log (6.5 MB)
nvidia-bug-report.log.gz (487.0 KB)

Lately (as of KDE 6.3.5?) I’ve able to been able to partly reset the GPU using SysRq+I. The Plasma session restarts and video mostly looks intact after the restart, except there graphics are glitchy and mouse cursor isn’t getting drawn (though the mouse itself is responsive and I can do things “blindly”). The system isn’t really usable in this state, so I’m forced to reboot anyway, but this is somewhat better than how it was a week ago.

It just happened again. This time I was able to capture logs after SysRq+I but before rebooting:
nvidia_crash3_dmesg.log (134.9 KB)
nvidia_crash3_journalctl_boot-0.log (1.3 MB)
nvidia-bug-report.log.gz (537.1 KB)

I have the same issues on Linux Mint 22.1 after the updates 550.144 and 570.144 came up in the update manager
Everything was working absolutely fine on the 550.120 driver, and now no single full-screen app works without hanging or freezing every 5 minutes. I tried both 550.144 and 570.144 drivers - both have this issue. Thankfully, I did a timeshift backup before installing those updates and easily restored my system.

I play Dota2 on Steam, and it freeze if you wil switch to desktop and then back to a game. But it unfreeze only the moment you will press alt+tab

my specs core i7-8750H + geforece gtx1060m and im runnin X11, not wayland
switching to full-screen windowed mode fixes the problem but not for long

This may be related:

I just realized what’s causing this (but not how to fix it). It’s sleep. After a fresh reboot, I can full-screen whatever I want as many times as I want. But after a brief sleep and wakeup, the first full-screen will crash the GPU, even something as simple as full-screening a YouTube video. Then after a reboot it’ll work fine again, until the next sleep.

I checked that PreserveVideoMemoryAllocations is set to 1, so lack of video memory preservation is not what’s causing this, it has to be something else.

Btw, I have a 5070 Ti, in case that makes any difference.

I found a “workaround”:

echo s2idle | sudo tee /sys/power/mem_sleep

This isn’t great obviously as it prevents deep sleep, but it’s better than crashing and having to reboot after every resume.

Nvidia, please fix the issue, pleeeeeaaaaase.

Still happening with 570.153.02.

I’m happy to report that the issue appears to be fixed in the 575 driver.

For the sake of information sharing, here are a few more details. With driver versions up to 570 the issue was 100% reproducible with KDE, but not with Gnome. With KDE it happened 100% of the time after full-screening a YT video after returning from suspend. This happened consistently with any Linux distro and any BIOS settings. With Gnome it happened a lot less (only after full-screening a few times, or maybe logging out and back in), but it still happened. With the 575 driver it doesn’t seem to happen at all anymore, Gnome or KDE. So I guess I’ll go ahead and close the issue.