Kwin_wayland_drm: Pageflip timed out! This is a bug in the nvidia-drm kernel driver

I’m still running into this as well. I worked with Opus 4.5 to get a work around for my machine, hopefully it’ll prove useful to y’all. Please excuse the AI-isms.

Workaround for black screen after monitor power-off (Samsung G9 / DP HPD de-assert)

I’ve been hitting this bug with a Samsung Odyssey G9 (5120x1440) on DisplayPort. When the monitor is powered off, Samsung monitors fully de-assert the DP HPD line (not just DPMS standby — they look completely disconnected). This triggers the pageflip timeout in nvidia-drm, and KWin Wayland loses all outputs, crashing plasmashell. On wake, the display stays black.

System: CachyOS (Linux 6.18.7-2), RTX 4090, driver 590.48.01, KDE Plasma 6 Wayland, single
5120x1440@120Hz monitor on DP.

After extensive debugging, I found a three-part workaround that reliably recovers the display:

The root cause chain:

  1. Monitor powers off → DP HPD de-asserts
  2. NVIDIA DRM reports connector disconnected
  3. KWin sees zero outputs → plasmashell crashes (SIGABRT: KWaylandBackend: no output modes
    available anymore)
  4. When monitor powers back on, NVIDIA GPU doesn’t re-train the DP link

The fix:

Part 1 — Mask sleep targets (prevents suspend on output disconnect):
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

Part 2 — Force DRM connector always-on (prevents KWin from seeing the disconnect):

Create /usr/local/bin/dp-keep-alive-setup.sh:
#!/bin/bash
DEBUGFS=/sys/kernel/debug/dri/1/DP-1 # adjust card number and connector
EDID_FILE=/etc/firmware/edid/your-monitor.bin

Wait for debugfs

for i in $(seq 1 30); do [ -f “${DEBUGFS}/force” ] && break; sleep 1; done

Save your EDID first (run once while monitor is on):

sudo cp /sys/class/drm/card1-DP-1/edid /etc/firmware/edid/your-monitor.bin

Load EDID override and force connector on

[ -f “$EDID_FILE” ] && cp “$EDID_FILE” “${DEBUGFS}/edid_override”
echo on > “${DEBUGFS}/force”

Create a systemd service to run this at boot:
[Unit]
Description=Force DP connector always-on
After=display-manager.service
Requires=sys-kernel-debug.mount

[Service]
Type=oneshot
ExecStart=/usr/local/bin/dp-keep-alive-setup.sh
RemainAfterExit=yes

[Install]
WantedBy=graphical.target

Part 3 — Automatic display recovery (forces modeset on reconnection):

With force=on, KWin never crashes, but the GPU stops driving the display signal when HPD drops.
The key insight: changing to a different resolution via kscreen-doctor forces a real modeset,
which makes the GPU re-train the DP link.

Note: I2C polling (i2cdetect) doesn’t work for detection with force=on because the GPU’s I2C
controller answers on behalf of the monitor. However, PowerDevil’s ddcutil-based DDC monitoring
still detects the real physical state and logs reconnection events.

Create /usr/local/bin/dp-monitor-recovery.sh:
#!/bin/bash
journalctl --user -u plasma-powerdevil -f --no-pager -g “Adding connected display with bus” |
while read -r line; do
sleep 3 # wait for link to stabilize
kscreen-doctor output.DP-1.mode.2560x1440@120 # different mode forces real modeset
sleep 1
kscreen-doctor output.DP-1.mode.5120x1440@120 # back to native
done

Run this as a user systemd service (~/.config/systemd/user/) so kscreen-doctor has the right
Wayland session environment.

Result: Monitor power off → system stays alive, no plasmashell crash. Monitor power on → ~5 second
delay → display automatically recovers. Tested repeatedly with RTX 4090 on driver 590.48.01.

Key findings during debugging:

  • Setting the same mode is a no-op — you must change to a different resolution to trigger a real
    modeset
  • kscreen-doctor output.DP-1.disable doesn’t work — KWin blocks disabling the only output
  • udev rules on SUBSYSTEM==“drm” ACTION==“change” don’t fire with force=on (status never changes)
  • The display works fine at the framebuffer/Plymouth level — confirmed by the monitor coming back
    during reboot after KWin exits, proving the issue is entirely in the KWin↔nvidia-drm interaction

Happy hunting!