[RTX 5070 Ti Laptop] DIFR prefetch worker deadlocks KMS modeset path in nvidia_modeset — 595.84 and 610.43.02, Wayland

Deadlock between DIFR prefetch worker and KMS modeset path (nvidia_modeset), 595.84 and 610.43.02

Summary

On a Legion Pro 5 16IAX10H with an RTX 5070 Ti Laptop GPU, the desktop display freezes permanently
while the rest of the system stays fully functional. The cause is a lock inversion inside
nvidia_modeset:

  • The nvidia-modeset/ kernel thread runs a DIFR (Display Idle Frame Refresh) prefetch and spins
    indefinitely in nvWriteGpEntry, in state R, while holding the NVKMS PM lock.
  • Any subsequent atomic modeset/flip from the compositor enters
    ApplyModeSetConfignvkms_ioctl_from_kapi_try_pmlock and blocks in state D on that same
    semaphore, forever.

The result is a display that never updates again. The kernel, audio, storage, networking and input
all keep working normally — during one event the machine continued printing hung-task traces every
30 s for 3.5 minutes, and audio from a playing video kept running without a glitch while the image
was frozen on a single frame.

This reproduces on two different driver branches (595.84 and 610.43.02) and two different
kernels
(7.0.0-28 and 7.0.0-29), with a function-for-function identical holder-side stack.

Important: Currently running 610.43.02. The attached nvidia-bug-report.log.gz captures older boots and its dmesg shows 595.84, so the deadlock traces are not in it — they are in the separate trace-595.txt and trace-610.txt files.

System

Machine Lenovo Legion Pro 5 16IAX10H (83LU)
BIOS Q6CN79WW, 2026-04-23
CPU Intel Core Ultra 9 275HX
iGPU Intel Arrow Lake-S [8086:7d67] (rev 06)
dGPU NVIDIA GB205M / GeForce RTX 5070 Ti Laptop GPU [10de:2f58] (rev a1)
VBIOS 98.05.41.00.0B
OS Ubuntu 26.04 LTS
Kernels 7.0.0-29-generic (610.43.02), 7.0.0-28-generic (595.84)
Driver nvidia-driver-610-open 610.43.02 — open kernel modules; also seen on nvidia-driver-595-open 595.84
Session GNOME on Wayland (mutter), hybrid graphics
Module options nvidia_drm modeset=1, NVreg_PreserveVideoMemoryAllocations=1, NVreg_TemporaryFilePath=/var

Display topology — relevant, because the dGPU drives a real output:

  • Internal panel eDP-1 on the Intel iGPU.
  • External monitor on HDMI-A-1, which is wired to the dGPU. So the NVIDIA display engine is in
    continuous use during normal desktop work, not only for GPU offload.

Symptoms

  1. Display stops updating entirely and never recovers. Observed frozen for 20 minutes on one
    occasion and 3.5 minutes on another (the user gave up and forced a reboot both times).
  2. Audio continues perfectly. A YouTube video that was playing kept its audio stream running while
    the image stayed frozen on one frame — the flip never completed.
  3. The kernel remains fully healthy. Hung-task traces continue to be written to disk, the
    filesystem stays mounted read-write, and SSH login from another machine still works.
  4. systemd-logind’s power-key handling does not help, because GNOME holds a block-mode inhibitor
    on handle-power-key and its shutdown dialog cannot be drawn on the wedged display. Recovery
    requires SysRq or SSH.

Root cause

Holder: DIFR prefetch worker, spinning while holding the PM lock

The nvidia-modeset/ kthread is in state R (running, never yields the lock) with this stack:

RIP: 0010:nvWriteGpEntry+0xf7/0x370 [nvidia_modeset]
 ? nvPushKickoff+0x28/0x50 [nvidia_modeset]
 ? PrefetchHelperSurfaceEvo+0x45c/0x650 [nvidia_modeset]
 ? nvDIFRPrefetchSurfaces+0x135/0x1f0 [nvidia_modeset]
 ? DifrPrefetchEventDeferredWork+0x16/0x30 [nvidia_modeset]
 ? nvkms_kthread_q_callback+0xe9/0x190 [nvidia_modeset]
 ? _main_loop+0x99/0x160 [nvidia_modeset]
 ? kthread+0xf7/0x130
 ? ret_from_fork+0x195/0x2a0

Register/code context at the faulting instruction (610.43.02 event):

RIP: 0010:nvWriteGpEntry+0xf7/0x370 [nvidia_modeset]
Code: ... 48 8b 83 10 01 00 00 <8b> 38 c1 ef 12 01 ff 39 fd 74 a2 ...
RSP: 0018:ffffce3ec0a47cf8 EFLAGS: 00000246
RAX: ffff8d174b933000 RBX: ffff8d1726a4f430 RCX: ffffce3ec696a378
RDX: ffff8d174b945000 RSI: 0000000000000384 RDI: 0000000000000004
RBP: 0000000000000004 R08: 0000000000000000 R09: 0000000000000001
R10: 0000000000000002 R11: 0000000000000010 R12: ffffce3ec12930d8
R13: 0000000000000384 R14: 0000000000000314 R15: 0000000000000000

The trapped instruction loads a dword through a pointer, shifts it right by 18, adds, compares
against a cached value and branches backwards on equality. That is consistent with polling a
pushbuffer GET pointer for free space — i.e. an unbounded wait for GPU progress performed while
the NVKMS PM lock is held
. Because the thread stays in state R, the lock is never released and
the wait never terminates.

Waiter: compositor atomic commit, blocked forever

INFO: task KMS thread:90142 blocked for more than 30 seconds.
task:KMS thread      state:D  pid:90142 tgid:90127 ppid:89457
Call Trace:
 __schedule+0x2bb/0x650
 schedule+0x27/0x90
 schedule_timeout+0xcf/0x110
 ___down_common+0x108/0x1e0
 __down_common+0x5a/0x180
 __down+0x1d/0x30
 down+0x5e/0x80
 nvkms_ioctl_from_kapi_try_pmlock+0x55/0xc0 [nvidia_modeset]
 ApplyModeSetConfig+0x60a/0xc70 [nvidia_modeset]
 ? nv_drm_atomic_apply_modeset_config+0x79d/0xb40 [nvidia_drm]
 ? nv_drm_plane_atomic_check+0x10a/0x6a0 [nvidia_drm]
 ? nv_drm_atomic_check+0x12d/0x150 [nvidia_drm]
 ? drm_atomic_check_only+0x199/0x420
 ? drm_atomic_nonblocking_commit+0x18/0x70
 ? drm_mode_atomic_ioctl+0x57e/0x910
 ? drm_ioctl_kernel+0xb5/0x110
 ? drm_ioctl+0x309/0x5f0
 ? nv_drm_ioctl+0x38/0x420 [nvidia_drm]
 ? __x64_sys_ioctl+0xa3/0x100
 ? do_syscall_64+0x105/0x5a0
 ? entry_SYSCALL_64_after_hwframe+0x76/0x7e
 </TASK>
INFO: task KMS thread:90142 blocked on a semaphore likely last held by task nvidia-modeset/:1854

KMS thread here is mutter’s own KMS thread (tgid:90127 is gnome-shell). The kernel’s own
hung-task detector names the culprit directly: “blocked on a semaphore likely last held by task
nvidia-modeset/”
.

The waiter is in drm_mode_atomic_ioctl — a page flip. That is exactly why the video image froze
on one frame while its audio continued.

Confirmation across driver branches

The same event on 595.84 / kernel 7.0.0-28 (2026-07-28), holder side:

RIP: 0010:nvWriteGpEntry+0xfe/0x370 [nvidia_modeset]
 ? nvPushKickoff+0x28/0x50 [nvidia_modeset]
 ? PrefetchHelperSurfaceEvo+0x45c/0x650 [nvidia_modeset]
 ? nvDIFRPrefetchSurfaces+0x135/0x1f0 [nvidia_modeset]
 ? DifrPrefetchEventDeferredWork+0x16/0x30 [nvidia_modeset]
 ? nvkms_kthread_q_callback+0xe9/0x1a0 [nvidia_modeset]
 ? _main_loop+0x99/0x170 [nvidia_modeset]

waiter side:

 nvkms_ioctl_from_kapi_try_pmlock+0x55/0xd0 [nvidia_modeset]
 ApplyModeSetConfig+0x59e/0xba0 [nvidia_modeset]
 ? nv_drm_atomic_apply_modeset_config+0x80b/0x9c0 [nvidia_drm]

Identical call chain, only offsets differ. On that occasion the hung-task detector reported the same
thread still blocked after 1228 seconds (20 minutes), escalating 122 → 245 → 368 → 491 → 614 →
737 → 860 → 983 → 1105 → 1228 s. It does not recover.

Trigger conditions

The pattern across observed events:

  1. The display goes idle — the user steps away and the screen blanks, or the content is static
    for a long period. This is DIFR’s engagement condition.
  2. A modeset or flip then arrives. Observed triggers: opening a new window, launching a browser, a
    video beginning playback, and a GNOME fast-user-switch to a second session.
  3. The deadlock takes hold at the first atomic commit after the DIFR prefetch has started.

The most recent event, with timestamps:

(user away, screen idle)   -> DIFR prefetch begins, PM lock taken
19:16:41  GNOME fast user switch to a second profile; new gnome-shell (pid 90127) starts
          Chrome launched; a YouTube tab resumes playback
19:17:12  mutter's KMS thread wedges on the PM lock
19:17:42  hung-task detector confirms (repeats at 60, 90, 120, 151 s)
19:20:11  forced power-off

Note this machine had not suspended — there were zero suspend/resume events in that 7-hour
uptime. Plain display idle is sufficient.

Frequency is roughly monthly under normal desktop use, which suggests a race window rather than a
deterministic ordering bug. Confirmed occurrences: 2026-07-28, 2026-08-13, 2026-08-17, plus two
earlier hard power-offs on 2026-07-29 and 2026-08-04 consistent with the same failure.

Ruled out

These were all checked against the system journal and are not involved:

  • No kernel panic or oops. The kernel stays healthy throughout.
  • No Xid errors at any point.
  • No OOM. 30 GB RAM, swap untouched at 0 B used.
  • No thermal throttling or critical-temperature events.
  • No MCE, EDAC or PCIe AER errors.
  • No filesystem or NVMe errors. Disk health is clean.

The only NVRM messages present are two benign boot-time ones that appear on every boot regardless
(PlatformRequestHandler failed to get target temp from SBIOS, and an
Unable to read EDID for display device DP-0 warning).

Notes for triage

  • There is no user-facing way to disable DIFR as a workaround. modinfo nvidia_modeset on 610.43.02
    exposes 15 parameters and none of them control DIFR. The DIFR symbols are still present in
    610.43.02 (nvDIFRPrefetchSurfaces, DifrPrefetchEventDeferredWork, nvDIFRNotifyFlip,
    nvDIFRAllocate, nvDIFRFree, nvRmRegisterDIFREventHandler), so the feature was not removed
    between branches.
  • A module parameter to disable DIFR would be a very welcome stopgap even ahead of a real fix.
  • The apparent defect is that the DIFR prefetch path performs an unbounded wait on GPU pushbuffer
    progress while holding a lock that the modeset path needs. A bounded timeout with a fallback that
    drops the prefetch, or releasing the PM lock across the kickoff wait, would both break the
    deadlock.

Attachments

  • nvidia-bug-report.log.gz (generated with sudo nvidia-bug-report.sh)
  • Full kernel traces for both events, as captured from journalctl.

kernel.hung_task_timeout_secs was lowered from 120 to 30 on this machine specifically to capture
these traces, so the 30/60/90/120/151 s escalation in the 610.43.02 event reflects that setting, not
a kernel default.

trace-610.txt (3.5 KB)

trace-595.txt (2.6 KB)

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

Confirming this on different hardware, with both sides of the deadlock independently captured.

System:
Lenovo Legion Slim 5 16ARP9
GPU: NVIDIA GeForce RTX 4060 Max-Q / Mobile (no iGPU, NVIDIA is the sole display controller)
Driver: 610.57.04 (open)
Kernel: Linux 7.1.8-1-cachyos
OS: CachyOS
Desktop Environment: Gnome 50 (Wayland)

Note: Same bug also occurred on a previous Fedora Workstation 44 install, same Gnome version, with 595 Nvidia drivers (open).

Frequency:
No iGPU means every flip for the entire desktop goes through nvidia_modeset, not just an external monitor. I’m hitting this roughly daily rather than monthly, consistent with this being a race window scaled by atomic-commit volume.

Triggers observed:
Most common one seems to be when the display wakes up after blanking out due to inactivity, regardless of whether the device entered suspend or not. Same “idle, then a flip request arrives” pattern as described above. Second most common case consists of device waking up normally, unlocking the session and briefly interacting with the desktop, after which the bug will trigger. Sometimes the freeze will occur during normal use when interacting with a window (focusing, moving, resizing, etc.), but less frequently.

While the display remains frozen, audio will still play and I’m able to SSH from my phone, managed to get the following after last occurrence:

Waiter side
Mutter’s KMS thread, captured via /proc/2883/task/2912/stack while hung:

[<0>] nvkms_ioctl_from_kapi_try_pmlock+0x36/0x80 [nvidia_modeset]
[<0>] ApplyModeSetConfig+0xce8/0xec0 [nvidia_modeset]
[<0>] nv_drm_atomic_check+0x221/0x270 [nvidia_drm]
[<0>] drm_atomic_check_only+0x1a7/0x510
[<0>] drm_atomic_commit+0x7e/0xf0
[<0>] drm_mode_atomic_ioctl.cold+0x2a2/0x587
[<0>] drm_ioctl+0x306/0x4d0
[<0>] __x64_sys_ioctl+0x115/0x2f0
[<0>] do_syscall_64+0xa6/0x3d0
[<0>] entry_SYSCALL_64_after_hwframe+0x76/0x7e

Holder side
nvidia-modeset/kthread_q (pid 269), checked during the same hang:

$ ps -o pid,state,pcpu,time,comm -p 269
PID S %CPU TIME COMMAND
269 R 8.3 00:39:05 nvidia-modeset/kthread_q

State R, actively consuming CPU, and /proc/269/stack returns nothing, consistent with a running (not sleeping) thread, matching the busy-spin-in-nvWriteGpEntry behavior described above rather than a normal idle kernel thread.

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

I may be seeing the same or a closely related issue on an Ada laptop GPU.

System:

- Alienware m18 R2

- NVIDIA GeForce RTX 4090 Laptop GPU, AD103M [10de:2757]

- Ubuntu 26.04 LTS

- GNOME 50 on Wayland

- Proprietary NVIDIA driver 595.84

- nvidia-drm.modeset=1

- Kernel during the latest incident: 7.0.0-30-generic

- Only the laptop display was active; no external monitor was connected

The latest complete freeze occurred on August 24, 2026, approximately five minutes after boot.

Claude Desktop, Google Chrome, and Chromium were not running. The only visible application was Terminator with several terminal panes. The desktop and input froze completely, Num Lock no longer responded, and a forced reboot was required.

My one-second persistent monitor recorded normal values immediately before the freeze:

- GPU: 37 C, 0-1% utilization, approximately 287 MiB, approximately 7.5 W, P8

- CPU package: 51-68 C

- Available RAM: approximately 46 GiB

- Swap: completely free

- CPU, memory, and I/O pressure: effectively zero

- Chrome and Chromium: closed

There was no NVIDIA Xid, NVRM error, OOM, thermal event, kernel lockup, NVMe error, or I/O error. The monitoring output simply stopped when the machine froze.

I have also experienced intermittent freezes on kernel 7.0.0-29-generic. Some earlier incidents occurred with Chromium/Electron applications active, but the kernel 7.0.0-30 incident shows that Chromium is not required.

Could this be the same NVKMS PM-lock / DIFR prefetch deadlock on an Ada RTX 4090 Laptop GPU? I can enable additional tracing and provide journal excerpts, monitoring samples, or an nvidia-bug-report if useful.

Resolution / retraction for my earlier report (post #3): the freezes on my Alienware m18 R2 turned out to be unrelated to the NVIDIA driver.

Root cause was the NetBird VPN client 0.77.1: its loopback XDP program triggers kernel panics in skb_clone() in interrupt context on kernels 6.3+ (see netbird#7295 and netbird#7294, reverted in netbird#7303). Because the panic fires in interrupt context and kernel.panic=0 by default, the machine freezes solid with nothing written to the journal — no Xid, no oops on disk — which made it look exactly like a display/KMS deadlock.

After downgrading NetBird to 0.77.0, the freezes stopped: ~24 hours clean so far, same machine now on driver 610.43.02 with Mesa/Chrome back to latest and hardware acceleration re-enabled.

So please disregard my earlier data points as evidence for the DIFR/NVKMS deadlock. Apologies for the noise — and if anyone lands here with silent hard freezes on Ubuntu: check whether NetBird 0.77.1 is installed.

Hi All,

I have filed a bug 6696638 internally for tracking purpose.

We will get back to you if required any additional information.

Can you please check on latest release driver 595.91.07 and share feedback.

Regarding the request to test 595.91.07: I can confirm the same DIFR/NVKMS deadlock on the newer 610.57.04 driver, on an RTX 4050 Laptop GPU with KDE/KWin Wayland.

System:

  • Acer Nitro ANV15-41
  • BIOS V1.18
  • AMD Ryzen 7 7735HS
  • AMD Radeon 680M iGPU
  • NVIDIA GeForce RTX 4050 Laptop GPU
  • NVIDIA driver 610.57.04 (open kernel module)
  • CachyOS
  • Linux 7.2.2-1-cachyos
  • KDE Plasma / KWin Wayland
  • Hybrid AMD/NVIDIA graphics
  • External monitor connected

I had previously experienced recurring full graphical freezes on Fedora 44 KDE/Wayland on this same machine. I installed CachyOS partly as an A/B test to determine whether the problem was Fedora-specific, and the freeze has now reproduced on CachyOS as well.

The CachyOS occurrence happened immediately after suspend/resume. The graphical session froze permanently, but the kernel and networking remained alive, so I was able to investigate the machine over SSH while it was still frozen.

The journal around the trigger showed:

09:10:22:
amdgpu: SMU is resuming…
amdgpu: SMU is resumed successfully!

09:10:23:
PM: suspend exit
kwin_wayland[1218]: Applying output configuration failed!

While the graphical session was still frozen, kwin_wayland PID 1218 was in uninterruptible sleep (D state), blocked in:

nvkms_ioctl_from_kapi_try_pmlock
ApplyModeSetConfig
nv_drm_atomic_check
drm_atomic_check_only
drm_mode_atomic_ioctl

At the same time, the nvidia-modeset kernel thread (PID 284) was in R state.

I triggered SysRq ‘l’ over SSH while the machine was still hung. The resulting NMI backtrace caught that nvidia-modeset thread on CPU 6 in:

nvWriteGpEntry
nvPushKickoff
PrefetchHelperSurfaceEvo
nvDIFRPrefetchSurfaces
DifrPrefetchEventDeferredWork
nvkms_kthread_q_callback
_main_loop

Kernel diagnostics also identified the semaphore blocking KWin as likely last held by the nvidia-modeset thread.

This appears to show both sides of the same deadlock described in this thread: the nvidia-modeset DIFR worker spinning in nvWriteGpEntry while the compositor’s KMS operation waits indefinitely for the NVKMS PM lock.

I have also added this reproduction to open-gpu-kernel-modules issue #1289, including an nvidia-bug-report.log.gz captured while the machine was still hung:

This issue is currently being tracked internally by NVIDIA as bug 6696638.

I also noticed PR #1286, which appears to address this same DIFR prefetch / nvWriteGpEntry path:

I have NOT tested that patch, so I cannot confirm whether it fixes the issue on this system. This reproduction occurred with the unmodified NVIDIA 610.57.04 driver.

The complete kernel journal from the affected boot is also available if useful, and I can perform additional tests if needed.

Sorry for the confusiong, this fix is available in driver 595.99.02 which you can download from here Driver Details | NVIDIA Please check once. (610.57.04 is not latest release for this fix)