omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

Suspend/resume causes compositor freeze on NVIDIA hybrid GPU laptops

Open KrisKind75 opened this issue 8 months ago • 10 comments

Issue Draft: Suspend/resume freeze on NVIDIA hybrid GPU laptops

Repo: https://github.com/basecamp/omarchy


Title

Suspend/resume causes compositor freeze on NVIDIA hybrid GPU laptops (nvidia-utils freeze workaround)

Body

Summary

After suspend/resume, Hyprland and Wayland clients (waybar, hyprlock) freeze or crash. The screen shows a stale frame (e.g. the lock screen) but no input is accepted. Mouse cursor may still move. The only recovery is killing Hyprland or a hard reboot.

Root Cause

nvidia-utils (590.48.01) installs a systemd drop-in that disables user session freezing during suspend:

# /usr/lib/systemd/system/systemd-suspend.service.d/10-nvidia-no-freeze-session.conf
[Service]
Environment="SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=false"

systemd itself warns about this on every suspend:

User sessions remain unfrozen on explicit request ($SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=0).
This is not recommended, and might result in unexpected behavior, particularly
in suspend-then-hibernate operations or setups with encrypted home directories.

Because user sessions are not frozen, Wayland clients continue running while the GPU is being suspended by nvidia-suspend.service. When the GPU disappears mid-operation, clients crash (waybar SIGABRT) or the compositor hangs with a stale framebuffer.

Reproduction

  1. NVIDIA hybrid GPU laptop (Intel + NVIDIA), nvidia-open-dkms installed
  2. Lock screen or just close lid (triggers suspend via logind)
  3. Wait a few seconds, then resume (open lid / press key)
  4. Lock screen appears but keyboard input is dead. Mouse cursor may still move.
  5. Only recovery: kill Hyprland from TTY (Ctrl+Alt+F3) or hard reboot

Reproduced multiple times, 100% consistent.

Attempted Fixes

  • Overriding the drop-in with SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=true: Did not resolve the issue (compositor still froze on resume, possibly because NVIDIA driver itself doesn't handle frozen sessions well).
  • Killing hyprlock/walker after resume: Doesn't help because the compositor itself is frozen, not just the lock screen.

Current Workaround

Disable suspend on lid close entirely:

# /etc/systemd/logind.conf.d/lid-lock.conf
[Login]
HandleLidSwitch=lock
HandleLidSwitchExternalPower=lock

This locks the screen on lid close without suspending. Users can still hibernate manually (which does a full shutdown/restore and avoids the GPU state issue).

Environment

  • Omarchy: v3.4.1
  • Hyprland: 0.54.0
  • Aquamarine: 0.10.0
  • Kernel: 6.18.13-arch1-1
  • NVIDIA: nvidia-open-dkms 590.48.01-4
  • GPU: Intel Arc (Meteor Lake) + NVIDIA RTX 4080 Max-Q
  • Laptop: ASUS (ROG/Zephyrus style, dual GPU with HDMI on NVIDIA)

Relevant Logs

Suspend entry:

systemd-logind: The system will suspend now!
systemd-sleep: User sessions remain unfrozen on explicit request
kernel: PM: suspend entry (s2idle)

Resume + crash:

kernel: PM: suspend exit
systemd-coredump: Process (waybar) of user 1000 dumped core. [SIGABRT]

Hyprland crash report (when restarting after freeze):

terminate called after throwing an instance of 'std::runtime_error'
  what(): CBackend::create() failed!
aquamarine: Session is not active, waiting for 5s
aquamarine: Session timeout reached
aquamarine: Session could not be activated in time
aquamarine: DRM Backend failed

Suggestion

This seems like a systemic issue with nvidia-utils disabling session freezing. Possible approaches:

  1. Omarchy-level workaround: Add a post-resume hook that restarts the compositor gracefully if it detects a frozen state
  2. Document the issue for NVIDIA hybrid GPU users with a recommended logind override
  3. Upstream to NVIDIA/Hyprland: The FREEZE_USER_SESSIONS=false workaround may have been necessary for older drivers but seems to cause more problems than it solves with current nvidia-open-dkms + Wayland compositors
  4. Investigate hibernate as alternative: systemctl hibernate does a full power cycle and should avoid the GPU state issue entirely — could be the recommended sleep mode for NVIDIA laptops

Related

  • systemd warning: https://github.com/systemd/systemd/issues/31292
  • NVIDIA Wayland suspend issues are widely reported in the Hyprland community

KrisKind75 avatar Mar 03 '26 16:03 KrisKind75

Desktop multi-GPU data point (not a laptop)

Same root cause confirmed on a desktop with dual NVIDIA GPUs — not a hybrid/laptop setup.

Environment:

  • GPUs: RTX 3090 Ti (card2, DP-5 @ 2560x1440 165Hz) + RTX 4060 (card1, HDMI-A-2 @ 1920x1080 60Hz)
  • Driver: nvidia-open-dkms 590.48.01-4
  • Hyprland: 0.54.1, Hyprlock 0.9.2, Hypridle 0.1.7
  • Kernel: 6.19.6-arch1-1
  • Omarchy: latest

Confirmed: The 10-nvidia-no-freeze-session.conf drop-in exists at /usr/lib/systemd/system/systemd-suspend.service.d/.

Symptoms:

  • Hyprlock crashes with SIGSEGV every ~5 minutes (matching the idle lock timeout), repeatedly respawned by hypridle
  • Hyprland log shows drm: Cannot commit when a page-flip is awaiting on the RTX 4060 (HDMI-A-2) during modesetting after resume
  • All input devices are removed/re-added during suspend cycle (libseat disabling seat)
  • Screensaver (Ghostty-based org.omarchy.screensaver) sometimes persists as an orphaned window after hyprlock crash, making it appear the lock screen is "stuck"

Coredump backtrace (SIGSEGV in hyprlock):

Stack trace of thread 1922228:
#0  0x0000556219d2efdd (/usr/bin/hyprlock + 0x78fdd)
#1  libstdc++.so.6 + 0xe55a4
#2  libc.so.6 + 0x9697a  (raise/abort)
#3  libc.so.6 + 0x11a2bc

Stack trace of thread 1922141 (main):
#0  libc.so.6 + 0x9ef32 (ppoll)
#1-#3  libc.so.6 (futex/pthread)
#4  _ZNSt6thread4joinEv (std::thread::join)
#5  /usr/bin/hyprlock + 0x67f43
#6  /usr/bin/hyprlock + 0x577d5
#7-#8  libc.so.6 (exit path)
#9  /usr/bin/hyprlock + 0x69484
#10 /usr/bin/hyprlock + 0x2482f (main)

The crash is in std::thread::join during hyprlock's exit/cleanup path — consistent with a GPU resource (EGL context or DRM buffer) being invalidated while a render thread is still using it.

Workaround applied locally:

  • Kill screensaver before launching hyprlock in hypridle's lock_cmd
  • Add 1s delay in after_sleep_cmd before dpms on to let DRM connector re-enumeration settle

This extends the scope of this issue beyond hybrid laptops — any multi-GPU NVIDIA desktop with the nvidia-utils session freeze drop-in is affected.

amlucas0xff avatar Mar 16 '26 12:03 amlucas0xff

Still exists here (a PC not a laptop with a new RTX 3080 GPU and a fresh installation)

AhmadNajiKam avatar May 30 '26 04:05 AhmadNajiKam

Hit this on an ASUS hybrid laptop today. Adding a data point, plus kernel-side evidence that I think narrows the root cause and partly contradicts the diagnosis in the opening post — in a way that matters for where this should be fixed.

Environment

  • Omarchy 4.0.0-1, Arch kernel 7.1.8-arch1-3, systemd 261
  • Hyprland 0.56.2 / Aquamarine 0.14.0 / Quickshell 0.3.0
  • nvidia-open-dkms + nvidia-utils 610.57.04 (much newer than the 590.48.01 in the OP)
  • ASUS TUF Gaming FX505GT — Intel UHD 630 (iGPU) + NVIDIA GTX 1650 Mobile
  • deep (S3), not s2idle — /sys/power/mem_sleep = s2idle [deep]
  • HDMI-A-1 is wired to the NVIDIA card; eDP-1 is on Intel. Aquamarine picks Intel as primary and uses the NVIDIA GPU as a blit/scanout target:
    drm: gpu /dev/dri/card2 becomes primary drm
    drm: Starting backend for /dev/dri/card1, with driver nvidia-drm with primary /dev/dri/card2
    Renderer: Mesa Intel(R) UHD Graphics 630 (CFL GT2)
    GBM: Buffer is marked as multigpu, forcing linear
    

Symptom matches the OP exactly: resumed to a stale lock-screen frame, then black, no input accepted, recovered only by holding the power button.

The part that doesn't fit the OP's root cause

The opening post attributes the freeze to SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=false letting Wayland clients run "while the GPU is being suspended by nvidia-suspend.service".

On this machine nvidia-suspend.service is disabled, and on driver 610 it would be a no-op even if enabled — nvidia-sleep.sh bails out on its first line because the legacy procfs handshake node no longer exists:

$ systemctl is-enabled nvidia-suspend.service nvidia-resume.service
disabled
disabled

$ head -5 /usr/bin/nvidia-sleep.sh
#!/bin/bash

if [ ! -f /proc/driver/nvidia/suspend ]; then
    exit 0
fi

$ ls /proc/driver/nvidia/suspend
ls: cannot access '/proc/driver/nvidia/suspend': No such file or directory

The freeze still happened. So nvidia-suspend.service is not a necessary ingredient, which is consistent with the OP's own observation that forcing SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=true did not help. The 10-nvidia-no-freeze-session.conf drop-in is present here too, but on this evidence it looks like a bystander rather than the cause.

Kernel-side evidence I haven't seen posted on this issue

Journal in monotonic ordering — necessary here, because entries written while the console is suspended get flushed with the resume-time realtime clock, which makes a 2 h 42 min sleep look instantaneous in journalctl default output:

[11938.725758] kernel: PM: suspend entry (deep)
[11939.102018] kernel: NVRM: nvCheckOkFailedNoLog: Check failed: Out of memory [NV_ERR_NO_MEMORY]
                       (0x00000051) returned from _memdescAllocInternal(pMemDesc) @ mem_desc.c:1338
        ... S3 ...
[11941.825270] kernel: ACPI: PM: Waking up from system sleep state S3
[11941.826133] kernel: NVRM: nvAssertFailedNoLog: Assertion failed: 0 @ osapi.c:2145
[11941.849442] kernel: [drm:__nv_drm_semsurf_wait_fence_work_cb [nvidia_drm]] *ERROR*
                       [nvidia-drm] [GPU ID 0x00000100] Failed to register auto-value-update
                       on pre-wait value for sync FD semaphore surface

Two things stand out:

  1. An allocation fails inside the suspend callback, 0.376 s after PM: suspend entry. The driver defaults to preserving video memory across suspend on this build — nothing in /etc/modprobe.d/ or /proc/cmdline sets it:

    $ grep -iE "Preserve|Temporary" /proc/driver/nvidia/params
    PreserveVideoMemoryAllocations: 1
    TemporaryFilePath: "/var/tmp"
    

    Not a disk-space issue — /var/tmp is on-disk with 339 GB free. This looks like the VRAM-save buffer failing to allocate, though the log line does not name its caller, so that attribution is inference.

  2. nvidia-drm cannot re-arm a sync-FD semaphore surface 0.9 ms after wake. __nv_drm_semsurf_wait_fence_work_cb is the explicit-sync wait path, and Hyprland reports Explicit sync: supported with explicit ✔️ on both outputs here. A wait that can never be signalled would stall the present loop — which fits "stale frame, no input" precisely.

That semsurf line occurs exactly once across the six boots retained in my journal: on the resume that failed. (This was also the only suspend in those six boots, so treat that as suggestive rather than conclusive.) There was no kernel panic, no oops, no hung-task warning, no Xid, and no core dump — Hyprland hung rather than crashed, which is why nothing recovered on its own.

Why I think this belongs upstream at NVIDIA, not here

Both failing lines are inside the NVIDIA driver's own suspend/resume path, on a driver 20 major versions newer than the OP's, with the userspace helper the OP blames provably inert. I don't think there's an Omarchy-side fix beyond documentation — though a PreserveVideoMemoryAllocations=0 default for hybrid systems might be worth discussing if others can confirm it helps. I have not tested that yet.

A discriminating test, for anyone who can still reproduce this

eDP-1 is on Intel, which resumes cleanly; only HDMI-A-1 is on the NVIDIA card. So:

  • both panels dark ⇒ compositor-wide present stall (the fence-wait explanation)
  • only the external panel dark ⇒ an NVIDIA-side modeset failure, and the fence theory is wrong

I can't answer this for my own occurrence — I didn't note which screens were dark before power-cycling. If you reproduce it consistently, that one observation would settle the mechanism. And if you can get to a TTY while it's hung, cat /proc/$(pgrep -x Hyprland)/task/*/wchan would show exactly what the compositor is blocked on.

Caveat on all of the above: this was a single occurrence, reconstructed post-mortem from logs. The two kernel errors and their timing are directly observed; the causal link from the semsurf failure to the compositor stall is the most plausible reading, not something I proved.

ki11e6 avatar Aug 17 '26 14:08 ki11e6

New, distinct symptom: userland SIGSEGV at suspend entry, not resume

Different crash class from the OP and the kernel-side posts so far. This is a desktop process crashing the instant the machine begins to suspend — a clean userland null-deref in GDK3 XInput2, with no NVRM error, no oops, and nothing kernel-side. It adds one data point on the open question this thread is really about: is the nvidia-utils 10-nvidia-no-freeze-session.conf drop-in (SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=false) causal or a bystander?

System

  • Omarchy 4.0.0-1, kernel 7.1.8-arch1-3
  • NVIDIA hybrid laptop: Intel UHD (CometLake, iGPU) + Quadro T2000 Mobile (TU117, nvidia-open 610.57.04-6)
  • xdg-desktop-portal-gtk 1.15.3-1, gtk3 1:3.24.52-1

What crashed

xdg-desktop-portal-gtk (PID 1602), SIGSEGV SEGV_MAPERR, after ~19h uptime. Full symbolized stack:

#0  jump to 0x0 (null function-pointer deref)
#1  g_hash_table_lookup                        (libglib-2.0)
#2  gdk_x11_atom_to_xatom_for_display          (libgdk-3)
#3  gdk_x11_device_manager_xi2_translate_event (libgdk-3, +0x7b298)
#4  gdk_display_get_event                      (libgdk-3)
#5  g_main_loop_run                            (libglib-2.0)
#6  main (xdg-desktop-portal-gtk)

Mechanism: GDK3s main loop was translating an in-flight XInput2 event against a device structure invalidated mid-event → null function-pointer deref. The only other threads in the core are pango/glib worker loops (glycin, dconf).

The timeline points directly at suspend, at entry

01:37:53  systemd-logind: Suspending...
01:37:53  NetworkManager: sleep requested
01:37:54  systemd[1]: Starting System Suspend...
01:37:54  systemd-sleep: User sessions remain unfrozen on explicit request ($SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=0)
01:37:54  kernel: PM: suspend entry (deep)     <-- same SECOND as the SEGV

Why it matters for this thread

This is not a resume freeze and there is no NVIDIA module error — the portal died before NVRM even entered suspend. That supports the OPs original hypothesis (unfrozen session teardown at suspend time is the trigger) more than it supports the kernel-side-only reading. It is also the 8th SIGSEGV of this exact binary since Aug 2 and 6th+ for xdg-desktop-portal-gtk, all on this hybrid-NVIDIA setup.

That said: the crashing code is gdk_x11_device_manager_xi2_translate_event — a documented, recurring upstream GTK3 null-deref (e.g. GNOME bugzilla 784936, RH 2501013) triggered by device teardown on suspend/display reconfig. So upstream GTK is the real owner; the drop-in merely exposes it. Flagging here because the thread is already tracking the unfrozen-session config for NVIDIA-hybrid suspend.

Filed by big-pickle via opencode.

ogfunkycold avatar Aug 27 '26 16:08 ogfunkycold

Session lock that goes secure=true before suspend never receives keyboard input after resume (PAM never invoked)

Summary

If the omarchy-shell session lock reaches secure=true before PM: suspend entry, then after resume the lock renders normally and shows the password prompt, but no keystroke ever reaches it — PAM is never started, so there is not even a failed authentication attempt. The session is unrecoverable except by restarting the display manager or rebooting.

If the same lock finalizes after the resume instead, it works perfectly.

The ordering is the whole bug. This is not "the lock screen breaks on resume" — it is specifically a lock surface that was already secure when the machine went down.

System

Omarchy 4.0.1-1
Hyprland 0.56.2-1
Quickshell 0.3.1-1
Kernel 7.1.9-arch1-2
GPU NVIDIA RTX 4060 Max-Q, nvidia-open-dkms 610.57.04-1
Machine Lenovo LOQ 15ARP9 (83JC), Ryzen 7 7435HS
Sleep state s2idle only — firmware reports ACPI: PM: (supports S0 S4 S5), no S3

Note this is a dGPU-only laptop: the 7435HS has no integrated graphics, so nvidia_drm is the sole DRM device and the only framebuffer (/proc/fb → 0 nvidia-drmdrmfb). Omarchy correctly drops the kms hook in this configuration. A consequence worth flagging: when this bug hits there is no fallback console to recover on, and restarting the display manager while the GPU is in a bad state hard-wedges the machine.

Reproduction

  1. Suspend such that the lock completes first — e.g. leave omarchy-sleep-lock.service enabled and run systemctl suspend, which inhibits sleep until the lock reports secure.
  2. Resume.
  3. The lock screen draws and prompts for a password. Type it. Nothing happens — no characters, no error, no rejection. The screen eventually blanks on timeout.
  4. Only recovery is systemctl restart sddm from a TTY, or a reboot.

Evidence

Failing — lock secure before suspend:

12:31:15  omarchy lock  lock-requested
12:31:15  omarchy lock  lock-pending: screen-stabilizing
12:31:16  omarchy lock  secure=true          <-- before
12:31:16  kernel: PM: suspend entry (s2idle)
12:32:17  kernel: PM: suspend exit
          (no quickshell.service.pam.subprocess lines, ever)

Working — lock finalizes after resume:

12:52:59  systemd-logind: Lid closed.
12:52:59  omarchy lock  lock-requested
12:52:59  omarchy lock  lock-pending: screen-stabilizing
12:53:00  kernel: PM: suspend entry (s2idle)
12:53:19  systemd-logind: Lid opened.
12:53:19  kernel: PM: suspend exit
12:53:20  omarchy lock  secure=true          <-- after
12:53:26  quickshell.service.pam.subprocess: Starting pam session for user "tio" with config "omarchy-lock-password"
12:53:26  quickshell.service.pam.subprocess: Relaying pam message: "Password: "
12:53:26  quickshell.service.pam.subprocess: Authenticated successfully.
12:53:26  omarchy lock  secure=false

Same machine, same boot, ~20 minutes apart. The only difference is which side of the suspend secure=true lands on.

Across four pre-suspend locks in one boot (11:54, 12:22, 12:31, 12:39): zero PAM lines. Every idle lock that never went through a suspend (Aug 26 14:32, Aug 27 09:51, Aug 27 10:00) produced the full handshake and unlocked normally.

What this rules out

It is not input-device loss. I sampled hyprctl devices every 2s while the failing lock was up, with tty1 as the active VT (this matters — switching to another VT makes logind revoke the session's devices and the count legitimately drops to zero):

12:37:58  vt=tty1  sess=yes  locked=true  kbds=8
12:38:00  vt=tty1  sess=yes  locked=true  kbds=8
   ... 13 seconds, unchanged ...
12:38:10  vt=tty1  sess=yes  locked=true  kbds=8

Hyprland holds all 8 keyboards throughout. The devices are present and owned by the compositor; the events simply never reach the lock surface.

The compositor is not frozen. Hyprland stays responsive over IPC (hyprctl version, hyprctl devices, hyprctl monitors all answer), the monitor reports dpmsStatus: 1, and the same PID survives the whole cycle. This distinguishes it from #4891 below.

Possibly related: #4891

#4891 reports the same user-visible symptom — lock screen up after resume, keyboard dead — on a hybrid NVIDIA laptop, and attributes it to the nvidia-utils drop-in setting SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=false.

That drop-in is present here too and systemd complains about it on every single suspend:

systemd-sleep: User sessions remain unfrozen on explicit request ($SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=0).
systemd-sleep: This is not recommended, and might result in unexpected behavior,

That mechanism would fit the ordering evidence: with user sessions left unfrozen, a lock surface that is already live and composited when the GPU suspends keeps running through the transition, whereas one created after resume is built against a healthy GPU.

Two things this report adds: it reproduces on dGPU-only hardware, not just hybrid; and the compositor here does not freeze, which narrows the fault to the lock surface specifically rather than to Hyprland as a whole.

Workaround

Masking the pre-suspend lock lets the suspend win the race, so the lock finalizes after resume and lands in the working path:

systemctl --user mask omarchy-sleep-lock.service

Caveat: with it masked, systemctl suspend no longer locks at all (lid-close still does, via omarchy-shell's own logind handling). idle.lock in shell.json should also be raised, since an idle lock going secure followed by a later suspend reproduces the broken ordering.

Unrelated but worth noting

omarchy-sleep-lock.service fails and restarts on every sleep on this machine:

systemd-inhibit: Failed to inhibit: The operation inhibition has been requested for is already running
omarchy-sleep-lock.service: Main process exited, code=exited, status=1/FAILURE
omarchy-sleep-lock.service: Scheduled restart job, restart counter is at 4.

It self-heals on the retry, so it is cosmetic, but it looks like a genuine race in taking the sleep inhibitor.

-- Authored by Opus 5

TioGlo avatar Aug 27 '26 17:08 TioGlo

The compositor is spinning, not blocked — plus a counter-result on the freeze override

@ki11e6 — near-identical stack to yours (nvidia-open 610.57.04, Hyprland 0.56.2, Aquamarine 0.14.0, systemd 261), and I can answer the open question you posed. You suggested cat /proc/$(pgrep -x Hyprland)/task/*/wchan to see what the compositor is blocked on. It would have shown you nothing, because it isn't blocked.

System: Razer Blade 15 (2022, RZ09-0421) · Intel Iris Xe (Alder Lake-P) + RTX 3070 Ti Laptop · nvidia-open-dkms 610.57.04-1 · kernel 7.1.9-arch1-2 · Hyprland 0.56.2 · Aquamarine 0.14.0-2 · Quickshell 0.3.1 · systemd 261.2 · S3 deep · Samsung C49J89 dock over USB-C. Explicit sync supported on all outputs; PreserveVideoMemoryAllocations: 1.

What the compositor is actually doing

Alt+SysRq+L during a freeze caught Hyprland in ring 3, with 18 of 20 CPUs idle:

CPU 4: PID 1849 Comm: Hyprland  RIP: 0033:0x7f4d45089849

Alt+SysRq+W printed zero blocked tasks, twice. That is not "nothing is stuck" — W only lists D-state tasks, and a busy-wait is R. This is why wchan is the wrong instrument here: there is no kernel wait to report. One userspace thread is burning a core.

The NMI backtrace prints 64 bytes of code around the IP, which is enough to identify the library with no debugger and no matching ASLR:

for f in $(awk '{print $6}' /proc/$(pgrep -x Hyprland)/maps | grep -E '^/.*\.so' | sort -u); do
  n=$(LC_ALL=C grep -obUaP "\xf3\x90\x48\x89\xc3\xf3\x90\xf3\x90\xf3\x90\xf3\x90" "$f" | wc -l)
  [ "$n" -gt 0 ] && echo "$n  $f"
done
# 1  /usr/lib/libnvidia-eglcore.so.610.57.04

Exactly one match. At that offset it is a deadline-bounded pause spin polling a clock through NVIDIA's OS callback table (call *0x290(%rbp)), accumulating spin time into a stats counter.

Caveat: that is a single NMI sample, and the inner loop is bounded, so it does not prove the compositor never leaves that function — the outer wait is what never completes. But a userspace spin-wait inside the NVIDIA GL driver is exactly what an explicit-sync fence that never signals looks like from userspace, which is a point in favour of your __nv_drm_semsurf_wait_fence_work_cb reading rather than against it.

A discriminator that needs no keyboard, no TTY and no debugger

Hyprland serves IPC from the same event loop that dispatches input, so if input is dead, hyprctl is dead too. A 3-minute timer here runs hyprctl -j every cycle: normally 60–95 ms, and during the freeze it hung ≥39 s before I cut power. Independent of the SysRq sample, same conclusion.

This matters for triage, because at least three distinct bugs in this tracker present as "lock screen visible, keyboard dead":

hyprctl pointer cause
this issue hangs dead too compositor event loop stalled in the GPU driver
@TioGlo's report answers works lock surface went secure=true before suspend; PAM never invoked
#9325 answers works fcitx5 wedged, silently eating keystrokes

I chased the lock-surface theory first and had it falsified the cheap way: clicking the lock screen (which should force focus) did nothing, and typing blind produced no * echo. Pointer being as dead as keyboard is the tell that it is upstream of the lock surface entirely. Also worth stating because it is reassuring: only the compositor is affected — journald, NetworkManager, tailscale and audio all kept logging normally, and notification sounds were audible throughout the freeze.

NV_ERR_NO_MEMORY at mem_desc.c:1338 is chronic here, not a failure signal

@ki11e6 you flagged this firing 0.376 s after PM: suspend entry, with PreserveVideoMemoryAllocations: 1, as a possible VRAM-save failure. Same line, same offset, same param on this machine — and it fired on all four of my last four successful resumes, 0.20–0.30 s after suspend entry each time:

13:58:13.243  PM: suspend entry (deep)
13:58:13.526  NVRM: ... NV_ERR_NO_MEMORY ... _memdescAllocInternal(pMemDesc) @ mem_desc.c:1338
14:07:36.365  PM: suspend entry (deep)
14:07:36.646  NVRM: ... same
14:14:27.029  PM: suspend entry (deep)
14:14:27.325  NVRM: ... same
14:17:58.707  PM: suspend entry (deep)
14:17:58.906  NVRM: ... same

Four successful cycles as controls, so on this hardware it is background noise. It also fires during ordinary desktop use here, nowhere near a suspend.

The semsurf line is different. Zero occurrences across those same four successful resumes. I cannot confirm it on a failure yet, but its absence from four known-good resumes is consistent with your theory in a way the allocation error is not. That is the line worth collecting.

The freeze override: 4 for 4 clean on 610.57.04

You concluded the drop-in looks like a bystander. On this machine forcing it back on has held so far, which is a data point the other way — same driver version as yours, so the difference is not the driver branch.

# /etc/systemd/system/systemd-suspend.service.d/10-nvidia-no-freeze-session.conf
# same filename as nvidia-utils' drop-in in /usr/lib, so this one wins outright
[Service]
Environment="SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=true"

Four cycles, at 11 s, 108 s, 118 s and 140 s of sleep, all clean. Before it, the freeze hit on every recent attempt. Two things I checked so the result means something:

  • The override was in force each cycle. systemd 261 logs this positively — Successfully froze unit 'user.slice' / Successfully thawed unit 'user.slice'. Do not judge it by the absence of the "remain unfrozen" warning; an empty grep can equally mean the unit never ran.
  • Each cycle actually exercised the failure condition. The freeze here only ever accompanies a full USB dock teardown (usb 1-1: USB disconnect, ~14 devices, root-hub devnum changes) rather than a reset in place. All four cycles show the teardown. A clean resume where the dock merely reset proves nothing, and an 11-second S3 suspend is enough to produce a real teardown — so this does not need an overnight to test.

Not proof: four cycles, one machine, and @KrisKind75's and your negative results still stand. But it is cheap for others to try, and if it holds it points at the race being real even where the drop-in is not sufficient on its own.

One argument for trying it that I have not seen raised: nvidia-utils ships that drop-in for the pre-610 suspend path, where nvidia-suspend.service needed a live session to save GPU state. On 610.x that path is inert — exactly as @ki11e6 showed with nvidia-sleep.sh bailing on the missing procfs node — so on this branch the drop-in may be guarding a mechanism nothing uses any more, at the cost of the window that stalls the compositor.

Better instrument for the next person who reproduces this

Do not power-cycle. The machine stays fully on the network, so SSH in, or run these from a TTY:

hyprctl monitors                                   # hangs => this issue; answers => TioGlo's or #9325
eu-stack -p $(pgrep -x Hyprland)                   # AS ROOT; ptrace_scope=1 blocks same-user attach
cat /proc/$(pgrep -x Hyprland)/task/*/stat | awk '{print $3}' | sort | uniq -c   # expect R, not D
cp -a /run/user/1000/quickshell/by-id/*/log.qslog /tmp/   # destroyed by a power-off

eu-stack needs no symbol server and resolves Hyprland's own frames from its exported symbols in under a second. Healthy baseline for comparison:

epoll_wait -> wl_event_loop_dispatch -> wl_display_run -> CEventLoopManager::enterLoop() -> main

Anything other than that, with a thread in R and no syscall, is this bug. I have automated the capture on resume, so I should have a symbolised stack if it recurs here — will post it if so.

Rookie0ne avatar Sep 02 '26 12:09 Rookie0ne

Seeing a milder variant of this on a different NVIDIA hybrid setup — Intel Iris Xe (TigerLake-LP) + NVIDIA GTX 1650 Ti Mobile, driver 610.57.04, kernel 6.18.46-lts, Omarchy's default Quickshell-based lock screen (not hyprlock).

Symptom: after lid-close suspend/resume, the lock screen is visible and the mouse cursor moves, but keyboard input does nothing — moving the mouse (confirmed with instrumented testing, multiple times) does not restore it, but a single mouse click does, immediately and reliably. No crash, no freeze — Quickshell/Hyprland stay fully responsive throughout (verified via /proc/<pid>/task/*/stat thread-state sampling across a real suspend/resume: no blocked/D-state threads, no stuck event loop).

Diagnostic detail that might help narrow it down: at the exact moment of resume, xkbcomp recompiles the keymap again (visible in the journal alongside Bluetooth reconnect events), suggesting the keyboard input capability gets re-created on the seat at resume. Working theory is that Hyprland's newly-created keyboard object doesn't inherit whatever routes input to the session-lock surface while locked, until a mouse-button event forces a refocus recompute.

Confirmed present: the nvidia-utils drop-in setting SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=false (/usr/lib/systemd/system/systemd-suspend.service.d/10-nvidia-no-freeze-session.conf) is installed here too. I tried overriding it to true (forcing the session to actually freeze during suspend) as a test — it did not fix this particular symptom, so whatever's causing the milder keyboard-routing glitch here isn't solved by that alone, even though it may still be relevant to the fuller freeze reported in this issue.

dgreen294 avatar Sep 05 '26 20:09 dgreen294

Additional evidence for the xdg-desktop-portal-gtk suspend-entry crash reported in this thread: five retained crashes have the same stack, each approximately one second after lid closure. This also occurs with the NVIDIA 580 driver branch.

Environment

  • Omarchy 4.0.3-1
  • Current kernel 7.2.3-arch1-3
  • Installed NVIDIA userspace package nvidia-580xx-utils 580.178.04-1.1
  • xdg-desktop-portal-gtk 1.15.3-1
  • gtk3 1:3.24.52-1, glib2 2.88.3-1
  • Hyprland 0.56.2-2, Xwayland 24.1.13-1

Observed behavior and recurrence

Closing the laptop lid to suspend is followed by SIGSEGV in /usr/lib/xdg-desktop-portal-gtk. Expected: the portal survives the suspend transition.

Retained crash records: September 2, September 3 (twice), September 5, and September 10, 2026. All five have the same recorded null-address/GDK stack, and the journal places each crash about one second after Lid closed / Suspending. This is retrospective evidence, not a new controlled reproduction or a claim that every suspend fails.

Latest event, September 10, 2026 (WAT, UTC+1):

22:37:19 systemd-logind: Lid closed. / Suspending...
22:37:19 systemd: Starting NVIDIA system suspend actions...
22:37:20 suspend: nvidia-suspend.service
22:37:20 kernel: xdg-desktop-por[3052]: segfault at 0 ip 0000000000000000
22:37:21 systemd-coredump: Process 3052 dumped core
22:37:21 xdg-desktop-portal-gtk.service: Failed with result 'core-dump'
22:37:22 systemd: Finished NVIDIA system suspend actions.
22:37:22 systemd: Starting System Suspend...
22:37:22 systemd-sleep: User sessions remain unfrozen on explicit request ($SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=0).
22:37:22 kernel: PM: suspend entry (deep)

The portal therefore crashes before systemd-sleep / PM: suspend entry, while NVIDIA suspend preparation is underway. The later unfrozen-session warning alone does not prove the cause of this earlier crash.

Core evidence

GDB on the latest core gives this abbreviated stack (unresolved intermediate frames omitted):

#0  0x0000000000000000
#1  g_hash_table_lookup                    (libglib-2.0.so.0)
#2  gdk_x11_atom_to_xatom_for_display       (libgdk-3.so.0)
#3  unresolved                            (libgdk-3.so.0 + 0x7b298)
... GDK event handling ...
     gdk_display_get_event
     g_main_loop_run

Disassembly immediately before the return address in g_hash_table_lookup shows call *0x30(%r15). That slot is zero in the core. This establishes a null indirect call; invalid hash-table state / a lifetime bug is an inference, not a proven root cause. Full debug-symbol downloads were unavailable, so no source-level attribution is claimed.

All thread stacks were inspected. Other threads are in GLib/GIO, Pango, dconf and glycin code; no evidence identifies them as the cause. No OOM events appeared in the checked journal. GTK, GLib and the GTK portal package were installed September 2 and have no later upgrades in the package log; matching crashes predate the September 9 Hyprland update.

No configuration changes or workaround tests were performed. This report does not establish an Omarchy-specific defect, NVIDIA responsibility, or a compositor freeze; it adds repeatable-in-history portal crash evidence for triage of the suspend interaction. omarchy debug --no-sudo --print was attempted but this installation reports it as an unknown command. No raw core or process-memory attachment is included.

Filed by GPT-6 via Codex.

ritechoice23 avatar Sep 11 '26 07:09 ritechoice23

AMD + NVIDIA hybrid / external-only monitor data point (TTY switch eventually recovered)

This appears to match this issue, with one useful variant: the machine remained alive, a TTY worked, and the graphical session eventually recovered after VT switching.

Environment

  • Omarchy 4.0.3-1
  • Linux 7.2.3-arch1-3
  • Hyprland 0.56.2-2
  • systemd 261.2-1
  • ASUS hybrid laptop: AMD Cezanne iGPU + NVIDIA RTX 3060 Mobile (proprietary nvidia driver 610.57.04)
  • /sys/power/mem_sleep: [s2idle] only
  • PreserveVideoMemoryAllocations: 1, TemporaryFilePath: /var/tmp
  • nvidia-{suspend,resume,hibernate}.service: disabled
  • Internal eDP-1 intentionally disabled; active display was external HDMI-A-1 at [email protected], apparently on the AMD DRM device

Observed

After suspend/resume, the graphical session was frozen/black and keyboard input did not restore it. The machine was still alive for about 2.5 hours (journal/network traffic continued). Ctrl+Alt+F2 opened a working TTY. Returning with Ctrl+Alt+F1 initially produced a black display repeatedly switching on/off; after a while F1 worked and the original desktop session was usable again without rebooting Hyprland.

The kernel completed resume cleanly and logged no NVRM/Xid, amdgpu timeout, DRM commit failure, oops, or hung-task warning:

17:24:12 kernel: PM: suspend entry (s2idle)
17:24:27 kernel: amdgpu ... SMU is resuming...
17:24:27 kernel: amdgpu ... SMU is resumed successfully!
17:24:28 kernel: PM: suspend exit

The stock Omarchy sleep-lock reached secure state before suspend:

17:24:11 omarchy lock ... lock-requested
17:24:11 omarchy lock ... lock-pending: screen-stabilizing
17:24:12 omarchy lock ... secure=true

As in another comment here, its inhibitor then failed/restarted during resume:

17:24:27 systemd-inhibit: Failed to inhibit: The operation inhibition has been requested for is already running
17:24:27 omarchy-sleep-lock.service: Main process exited, status=1/FAILURE
17:24:29 omarchy-sleep-lock.service: Started Lock Omarchy before suspend.

When switching back from TTY around 19:59, Wayland outputs temporarily vanished/reappeared, matching the observed display cycling:

19:59:26 omarchy-shell: There are no outputs - creating placeholder screen
19:59:26 omarchy-shell: Not creating lock surface ... not backed by a valid wayland output
19:59:28 omarchy-shell: There are no outputs - creating placeholder screen
19:59:29 quickshell.hyprland.ipc: Got removal for monitor "FALLBACK" which was not previously tracked.

After recovery, hyprctl monitors all again showed HDMI-A-1 active and eDP-1 disabled as configured.

I could not run hyprctl during the initial freeze, so this does not distinguish a spinning compositor from an output-only failure. The lack of NVIDIA/kernel errors plus successful VT recovery may make this an output re-enumeration/session-lock variant rather than the exact NVIDIA explicit-sync stall, but it seems more useful here than as a new issue.

BrunoRovoletto avatar Sep 11 '26 18:09 BrunoRovoletto

I read this report and every comment against current quattro (902fd8aeb). It was not reproduced: it needs NVIDIA hardware, and the test machines here have none.

What Omarchy ships. Nothing in Omarchy sets or overrides SYSTEMD_SLEEP_FREEZE_USER_SESSIONS, sets NVreg_PreserveVideoMemoryAllocations, or enables the nvidia-suspend/nvidia-resume services. install/hardware/nvidia.sh installs the driver packages, turns on nvidia_drm modeset=1 and loads the modules early, and that is all. The 10-nvidia-no-freeze-session.conf drop-in comes from nvidia-utils itself. The one Omarchy sleep hook that touches the dGPU, default/systemd/system-sleep/force-igpu, exits straight away unless supergfxctl is installed, so it does not run on an ordinary hybrid install.

What the evidence points at. The main symptom is a resume where hyprctl hangs too. The evidence for it points into the NVIDIA driver, not Omarchy: Hyprland caught spinning in libnvidia-eglcore.so, and nvidia-drm failing to re-arm a sync-FD semaphore surface right after wake. That is likely an upstream NVIDIA bug, though nobody has shown it is an explicit-sync fence that never signals. NV_ERR_NO_MEMORY at suspend entry shows up on good resumes too, so it doesn't tell us anything here.

This thread holds more than one bug. It is worth keeping them apart:

  • A lock that is already secure=true before suspend and then gets no keyboard input after resume, while hyprctl still answers (@TioGlo), is a different failure from the compositor stall.
  • omarchy-sleep-lock.service failing with "already running" on every resume is tracked in #13160, and open PR #13176 fixes it.
  • The xdg-desktop-portal-gtk crash at suspend entry is in GTK3's XInput2 code, not Omarchy.
  • #10626 and #10108 report similar NVIDIA 610 resume stalls.

The mitigation on the table. Overriding the drop-in back to SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=true gets mixed results. It fixed @Rookie0ne's machine (4 of 4 resumes), but did not help the original report or @dgreen294's keyboard-only variant. Shipping it as a default would change suspend behaviour for every NVIDIA install. That is a call for the maintainer, not a contained bug fix, so no pull request has been opened. Anyone still hitting this can help settle it: try that override, then post the number of clean and failed resumes, your driver version, and whether hyprctl monitors answers during the freeze.

Codex Medium gave a second opinion and reached the same conclusions on each point: no Omarchy-side cause in the source, likely an NVIDIA driver bug, and the override is the maintainer's decision. It also raised the force-igpu hook, which I checked and ruled out as above. Both reviews read the same evidence, so they are not fully independent. This now waits on the maintainer.

omarchybot avatar Oct 08 '26 00:10 omarchybot