You are not logged in.
I'm experiencing an issue where various applications freeze or lag after the system resumes from suspend. These freezes only start after the first suspend/resume cycle following a boot, i.e. they do not occur prior to suspend.
Symptoms:
GPU-accelerated applications (e.g., kitty, Firefox, and Electron apps) often freeze for 5–10 seconds the first time they are displayed or interacted with. By "freeze" I mean that they can't be interacted with, and the visual rendering does not seem to happen until suddenly everything works for the particular window.
When switching i3 desktops post-resume, windows appear blank or contain residue graphics. They "wake up" only after several seconds.
Different instances of the same application (kitty being a good example) unfreeze separately, meaning that if an application has not been "seen" (the i3 desktop with it has been activated, and sometimes even mouse-over is necessary), then it stays in the frozen state and will not start the "unfreezing".
xscreensaver sometimes freezes right after resume as well.
The mouse remains responsive during these freezes (not sure in xscreensaver, as it's not visible there)
These symptoms have led me to believe that this somehow relates to the GPU rendering of the windows.
Details:
WM: i3
Terminal: kitty
Kernel: Problem observed on linux, linux-lts, and linux-zen. Mainly running linux-lts.
Disk setup: NVMe drive with LUKS on BTRFS. Clone of this setup on SSD behaves the same.
GPU: Nvidia GTX 2060
Miscellaneous notes:
Switching kernels does not seem to help, although I recall linux-zen occasionally exhibiting the problem a slightly shorter time.
BTRFS scrub shows no filesystem errors.
Observed crashes in Electron apps via journalctl, although not sure if that has any relevance ("systemd-coredump[...] Process electron dumped core").
Monitored dmesg and journalctl — no seemingly relevant errors (e.g. GPU-related) immediately around the time of freezing.
I would guess that maybe the reinitialization of the GPU might not be happening properly, but I can't be sure.
Has anyone seen similar behavior or do you have ideas for how to debug this?
Thanks in advance!
Offline
Forgot to add the current versions of Linux and Nvidia:
linux: 6.13.8.arch1-1
nvidia-dkms: 570.133.07-1
Offline
I've realized that since I have many instances of Kitty – different instances on different desktops – after a system resume I have multiple instances of applications that I can trigger the freezing behavior on, on demand.
This means that if I knew what system logging/metrics utility I should be looking at, I could have it ready and then switch to one of the still "unvisited" Kitty instances, watch it be frozen for a moment, and then check the relevant logging/metrics utility to know what happened at that time.
Do you guys have an idea of what I could use for this?
Offline
GPU-accelerated applications (e.g., kitty, Firefox, and Electron apps) often freeze for 5–10 seconds the first time they are displayed or interacted with.
GPU: Nvidia GTX 2060
I would guess that maybe the reinitialization of the GPU might not be happening properly
It's gonna be around https://wiki.archlinux.org/title/NVIDIA … er_suspend which is probably also enabled by default.
If you've enough RAM, to store the VRAM in /tmp instead of /var/tmp
You could also try to disable it - but you'll likely just end up w/ broken textures (that get fixed on a window resize)
Offline
You're right, "cat /proc/driver/nvidia/params | sort" gives "PreserveVideoMemoryAllocations: 1".
I found this thread on the kitty issue tracker: https://github.com/kovidgoyal/kitty/issues/8251
Adding the `sync_to_monitor no` actually, just like for the "fmazur" person in that thread, seems to resolve the problem for kitty.
I've lately been experiencing freezes even long after resume, as if there was some degradation happening over time. I can not right now say whether this is also resolved for kitty with this `sync_to_monitor no`.
xscreensaver still freezes on resume, however.
I'm currently guessing that it's some sort of GPU reinitialization delay, or vsync related. Not sure where to go from here.
Offline
You can disable vsync in the driver by exporting "__GL_SYNC_TO_VBLANK=0" - did you try to disable the VRAM preservation or store it in the RAM?
Offline
I did not try the VRAM preservation yet, no, sorry. I did try to set VSYNC, although through "nvidia-settings", which didn't seem to do the trick.
Sorry to not follow up well on your recommendations.
However!
The two categories of applications that were misbehaving were kitty and Electron apps, at least from what I could tell.
Kitty seems to have improved after the change that I listed above, and seems no longer exhibit the freezes, unless there's an Electron app on the same desktop.
Today I stumbled across this Github issue for the Electron repository: https://github.com/electron/electron/issues/30654. Based on that issue, for some reason, the notification daemon might be the culprit. I killed "dunst", did a suspend-resume, and from what I can tell, the issue with the Electron apps is gone! This is with VSYNC enabled.
I'll have to report back to see if this state lasts, but I'm currently experiencing a very promising absence of freezes, even with rapid cycling between the desktops right after a resume.
Offline
Update: dunst removed, replaced with "xfce4-notifyd". Problems still present.
Will need to try recommendation from seth.
Offline