open-gpu-kernel-modules icon indicating copy to clipboard operation
open-gpu-kernel-modules copied to clipboard

[595.71.05 open] CPU soft lockup in nvDIFRPrefetchSurfaces on S3 resume — Blackwell mobile (10de:2c59), kernel 6.17

Open cpfarher opened this issue 5 months ago • 14 comments

NVIDIA Open GPU Kernel Modules Version

595.71.05

Please confirm this issue does not happen with the proprietary driver (of the same version). This issue tracker is only for bugs specific to the open kernel driver.

  • [x] I confirm that this does not happen with the proprietary driver package.

Operating System and Version

Ubuntu 24.04.4 LTS

Kernel Release

uname -a Linux christian-Legion-Pro-7-16IAX10H 6.17.0-35-generic #35~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 19:30:42 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

Please confirm you are running a stable release kernel (e.g. not a -rc). We do not accept bug reports for unreleased kernels.

  • [x] I am running on a stable kernel release.

Hardware: GPU

NVIDIA open kernel module 595.71.05

Describe the bug

On resume from S3 suspend, a nvidia-modeset kthread soft-locks one CPU indefinitely inside the DIFR prefetch path (nvDIFRPrefetchSurfaces / DifrPrefetchEventDeferredWork); the display never recovers and the machine must be hard-powered-off. Reproduces across multiple suspend cycles. Full trace and nvidia-bug-report.log attached.

To Reproduce

Suspend the machine and resume.

Bug Incidence

Always

nvidia-bug-report.log.gz

nvidia-bug-report.log.gz

More Info

No response

cpfarher avatar Jun 16 '26 12:06 cpfarher

I second this

runiter avatar Jul 10 '26 00:07 runiter

Same DIFR deadlock on Ada mobile (10de:28e0), not limited to Blackwell

I'm hitting what looks like the same nvDIFRPrefetchSurfaces deadlock, but on an Ada mobile GPU rather than Blackwell, so the issue may be broader than the original report suggests.

Hardware: ASUS ROG Zephyrus G14 (GA403UV), GeForce RTX 4060 Max-Q / Mobile [10de:28e0] (Ada, AD107M) + AMD Radeon 780M iGPU (hybrid) Driver: 580.173.02 (open kernel module) Kernel: 7.1.3-cachyos1.fc43.x86_64 (Fedora 43) Desktop: GNOME on Wayland, supergfxctl in Hybrid mode

Symptom: After the display has been idle for a while (not necessarily tied to an S3 resume in my case), a nvidia-modeset kthread holds a semaphore indefinitely and gnome-shell blocks on it forever. The display never recovers and the machine has to be hard-powered-off. The hung-task watchdog reports the blocked task growing past 1200+ seconds.

Representative trace:

INFO: task gnome-shell:6936 blocked on a semaphore likely last held by task nvidia-modeset/:2916 nvkms_ioctl_from_kapi+0x58/0xe0 [nvidia_modeset] CreateSurface+0x183/0x250 [nvidia_modeset] nv_drm_framebuffer_create+0x27f/0x410 [nvidia_drm] drm_internal_framebuffer_create drm_mode_addfb2 drm_ioctl task:nvidia-modeset/ state:R running task ? PrefetchHelperSurfaceEvo+0x45c/0x650 [nvidia_modeset] ? nvDIFRPrefetchSurfaces+0x135/0x1f0 [nvidia_modeset] ? DifrPrefetchEventDeferredWork+0x16/0x30 [nvidia_modeset] ? nvkms_kthread_q_callback+0xe6/0x170 [nvidia_modeset]

Things I tried that did NOT help:

NVreg_PreserveVideoMemoryAllocations=1 (already set) NVreg_EnableGpuFirmware=0 nvidia-drm.fbdev=1 Disabling GNOME screen blanking (idle-delay 0) - deadlock still arms on internal GPU idle Forcing PCI power/control to on supergfxctl Integrated mode does avoid it (nvidia-modeset is not in the display path), but that disables the external outputs, which are wired to the dGPU on this laptop.

Reproduces consistently after leaving the machine idle. Happy to attach a full nvidia-bug-report.log if useful.

nvidia-bug-report.zip

khalangy avatar Jul 28 '26 16:07 khalangy

Hit the same issue this morning.

NVIDIA Open GPU Kernel Modules Version

Please confirm this issue does not happen with the proprietary driver (of the same version). This issue tracker is only for bugs specific to the open kernel driver.

  • [ ] I confirm that this does not happen with the proprietary driver package.

Operating System and Version

Ubuntu 24.04.4 LTS

Kernel Release

❯ uname -a Linux grond-linux 7.0.0-28-generic #28~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Jul 1 15:50:57 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

Please confirm you are running a stable release kernel (e.g. not a -rc). We do not accept bug reports for unreleased kernels.

  • [x] I am running on a stable kernel release.

Hardware: GPU

❯ modinfo nvidia | grep ^version version: 580.173.02

Describe the bug

I was working normally when the system hung. I ssh'd in and saw that the process nvidia-modeset/kthread_q was pegged at 100%. Had to carefully restart the system to clear it.

I had just woken up the PC (resumed from suspend) 6.5 minutes before the hang.

To Reproduce

Not been able to reproduce it so far. Limited testing though

Updated because I was able to reproduce this with the proprietary release

tekgrrl avatar Aug 06 '26 12:08 tekgrrl

This is deterministic: it always fires on the 6th suspend/resume cycle of a boot

I've been hitting this on desktop Blackwell (RTX 50 series) since July and had been treating it as intermittent (~1-in-6 resumes). It isn't. After counting PM: suspend exit across every boot in my retained journal, the pattern is exact: the machine survives 5 resumes and dies on the 6th, every single time. I've never recorded a 7th suspend on this machine.

Config

GPU GeForce RTX 5070 Ti (GB203) [10de:2c05], VBIOS 98.03.58.00.24
Driver 595.71.05 (open kernel module), newest in Ubuntu noble
Kernel 6.17.0-1028-oem
OS Ubuntu 24.04.4 LTS
Desktop GNOME on Wayland
Board MSI B650M PROJECT ZERO (MS-7E09), BIOS 1.H5, ReBAR on (BAR1 = 16384 MiB)
Sleep S3 deep (also reproduced on s2idle, see below)
Modparams NVreg_PreserveVideoMemoryAllocations=1, NVreg_TemporaryFilePath=/var, NVreg_UseKernelSuspendNotifiers=1, nvidia_drm modeset=1

Note this is a desktop Blackwell, not mobile — the original report is 10de:2c59 (mobile). Combined with @khalangy's Ada mobile report above, the bug spans desktop Blackwell, mobile Blackwell, and mobile Ada.

The data

Every boot in my journal, with the number of completed PM: suspend exit events:

boot date resumes sleep mode outcome delay from 6th resume to hang
-9 2026-07-16 6 s2idle HANG 24s
-8 2026-07-16 0 — clean shutdown —
-7 2026-07-18 6 deep HANG 21s
-6 2026-07-19 2 deep clean shutdown —
-5 2026-07-19 0 — clean shutdown —
-4 2026-08-03 6 deep HANG 55s
-3 2026-08-05 6 deep HANG 3m44s
-2 2026-08-06 6 deep HANG 49s
-1 2026-08-08 6 deep HANG 11m52s

Every hang boot had exactly 6 suspend entries and 6 exits, with zero aborted or failed suspends. The boots that ended cleanly ended that way because I shut down before reaching 6. There is no counterexample in the data: no resume numbered 1–5 has ever hung, and no 6th resume has ever survived.

Six consecutive hangs landing on exactly the 6th resume is ~1e-7 under any "random per-resume probability" model. This is an exhaustible resource being consumed once per suspend/resume cycle, not a race.

Why it looked random

The delay between the 6th resume and the lockup varies a lot — 21s to nearly 12 minutes in my data. That's consistent with the deadlock arming at resume #6 and firing on the first DIFR prefetch afterwards, i.e. whenever the first display-idle moment happens to occur. That also lines up with @tekgrrl's report above ("woken up the PC 6.5 minutes before the hang") and with @khalangy's observation that on their machine plain display idle is enough to trigger it without any S3 resume at all.

So I'd suggest the S3 resume is not the trigger — it's the accumulator. Idle is the trigger.

Stack (identical on every occurrence)

watchdog: BUG: soft lockup - CPU#1 stuck for 26s! [nvidia-modeset/:991]
RIP: 0010:nvWriteGpEntry+0xf9/0x370 [nvidia_modeset]
Call Trace:
 ? PrefetchHelperSurfaceEvo+0x45c/0x650 [nvidia_modeset]
 ? nvDIFRPrefetchSurfaces+0xb1/0x1f0 [nvidia_modeset]
 ? DifrPrefetchEventDeferredWork+0x16/0x30 [nvidia_modeset]
 ? nvkms_kthread_q_callback+0xcf/0x180 [nvidia_modeset]

Plus "KMS thread blocked on a semaphore held by nvidia-modeset" when the journal survives long enough to flush it. Most occurrences produce no trace at all — the box freezes hard before journald flushes, so absence of this stack in a log does not rule the bug out. No Xid errors, ever. pstore and /var/crash empty.

Things I tried that did NOT help

  • NVreg_RegistryDwords="RMLpwrMsDifrCgIdleThresholdUs=0xFFFFFFFF;RMLpwrMsDifrSwAsrIdleThresholdUs=0xFFFFFFFF" — verified active in /proc/driver/nvidia/params, hung anyway. The trigger is DifrPrefetchEventDeferredWork, an event pushed from GSP, so GSP-side idle thresholds don't gate it (or the keys are simply ignored).
  • mem_sleep_default=s2idle — hung on the 6th s2idle resume exactly as with deep. The "GPU keeps power in s2idle" premise is wrong; s2idle still runs the full device suspend callbacks and the VRAM evict/restore.
  • NVreg_UseKernelSuspendNotifiers=1 vs. the nvidia-suspend.service procfs path — both hang identically. (The notifier path is otherwise a big improvement: suspend goes from ~32s to ~1.2s and eliminates an NVRM assert storm.)
  • Upgrading 580.159.03 → 595.71.05. This made it less frequent but did not fix it, and in hindsight "less frequent" probably just means the leak got smaller per cycle.

There is no user-facing DIFR off-switch in 595.71.05 — no nvidia_modeset module param, no nvkms config-file key, no regkey in the open RM source. The only knob in the GSP firmware strings is RmForceEnableDIFR, which forces it on.

Hypothesis

A per-suspend/resume-cycle leak of GPU VA space or mappings, exhausted after 6 cycles, after which the DIFR prefetch cannot map its surface and nvWriteGpEntry spins on a GPFIFO that never advances.

Supporting: on the old nvidia-suspend.service eviction path this machine used to emit an assert storm during every suspend containing literally dmaAllocMapping_GM107 "can't alloc VA space" and mmuWalkSparsify/mmuWalkUnmap NV_ERR_INVALID_STATE 0x40, plus kern_bus_gv100.c:388 BAR1 asserts. Issue #1140 (RTX 4090, VA-space exhaustion → GPU lockup after ~7 days uptime) looks like the same family with a time-based rather than cycle-based accumulator.

I can't verify this from userspace — the open driver doesn't appear to expose per-cycle VA/mapping accounting. If someone at NVIDIA can suggest a debug knob that dumps VA space or mapping counts, I can trivially sample it across cycles 1–6 and confirm or kill the theory, since I have a reproducer that hits it on demand.

Reproducer

Suspend and resume six times on a Blackwell desktop with the open module, letting the display go idle after each resume. It dies on the 6th. Full nvidia-bug-report.log available on request.

Workaround for anyone else hitting this

If you reboot after the 5th resume of each boot then this never happens.

runiter avatar Aug 08 '26 21:08 runiter

I found the root cause and possible fix.

TL;DR

The machine does not hang randomly. It hangs on exactly the 6th suspend/resume cycle of every boot, 7 boots out of 7, and has never once survived a 6th. I believe the cause is the unbounded wait loop in nvWriteGpEntry() (nvidia-push.c:362) spinning on a 16-entry GPFIFO ring belonging to the DIFR prefetch channel, which leaks 2 entries on every resume where the prefetch times out.

Proposed root cause

1. The spin is unbounded. src/common/unix/nvidia-push/src/nvidia-push.c:362:

// Wait for a free entry in the buffer
while (nextGpPut == ReadGpGetOffset(push_buffer)) {
    if (nvPushCheckChannelError(push_buffer)) {
        nvAssert(!"A channel error occurred in nvWriteGpEntry()");
        return FALSE;
    }
}

No timeout, no sleep, no cond_resched(). Every other wait in this file is bounded (IdleChannel() takes a timeout; the DIFR prefetch wait is 10ms) — this one is not.

2. Its only escape requires a fault, which never comes. nvPushCheckChannelError() (nvidia-push.c:72) returns TRUE only when RM has written 0xFFFF into the error notifier. A channel that is simply not being serviced — no robust-channel error, no RC event — leaves the notifier clean, so the loop can never exit. Once GET stops advancing for any non-fault reason, this is an unkillable in-kernel spin.

3. The DIFR ring is unusually small, which is where the exact count comes from.

what where value
pushBufferSizeInBytes nvkms-difr.c:422 1024
numGpFifoEntries = pushBufferSizeInBytes / 64 nvidia-push-init.c:1288 16
NV_PUSH_NUM_GPFIFO_ENTRIES_PER_KICKOFF nvidia-push-priv.h:65 2
Blackwell sets hal.caps.extendedBase nvidia-push.c:1006-1013 TRUE

Because extendedBase is set on Blackwell, InitGpFifoExtendedBase() (nvidia-push-init.c:1188-1229, called from nvPushAllocChannel() at :1358) writes SET_PB_SEGMENT_EXTENDED_BASE + NOP directly into the ring and advances gpPutOffset by 2 without a kickoff. Those entries carry no progress-tracker semaphore release, so the GP_GET reported by ReadGpGetOffset() never accounts for them. That leaves roughly 7 kickoffs of headroom before PUT wraps onto a stalled GET.

4. The per-cycle leak. PrefetchSingleSurface() waits only DIFR_PREFETCH_WAIT_PERIOD_US = 10ms (nvkms-difr.c:122, loop at :688-699) before returning FAIL_CE_HW_ERROR. If the copy engine is not yet scheduled after a resume, the prefetch times out but its 2 GPFIFO entries remain queued and are never consumed — GET never advances past them. That is a permanent loss of 2 ring entries per failed post-resume prefetch, accumulating across the boot.

~7 kickoffs of headroom, one leaked per resume, and on cycle 6 the ring is full: the next nvPushKickoff() enters the loop at :362 and never leaves. This predicts a hard wall in the 6–8 range; I measure 6, every time.

Suggested fixes

  1. Bound the wait at nvidia-push.c:362. A channel that stops advancing with no error notifier should time out, not spin a kernel thread forever. Even if the ring exhaustion is fixed, this loop can hard-hang a machine any time a channel stalls without faulting, and it's the reason this bug takes the whole system down instead of just breaking DIFR.
  2. Account for the entries consumed by InitGpFifoExtendedBase(), or reserve them outside the usable ring, so the effective headroom on Blackwell matches Turing/Ampere.
  3. Reclaim or reset the ring after a prefetch timeout in PrefetchSingleSurface(), rather than leaving the GP entries queued forever. Alternatively, raise pushBufferSizeInBytes for the DIFR channel — at 1024 bytes it has by far the least headroom of any channel in the driver.

Questions for NVIDIA

  • Is the DIFR prefetch channel expected to be re-validated or its GPFIFO reset after a resume? If so, where does that happen — I can't find it in the open tree.
  • Is the 10ms DIFR_PREFETCH_WAIT_PERIOD_US intended to be enough for the first prefetch after a resume, when the CE may not yet be scheduled?
  • Is there any supported way to disable DIFR at runtime? I could not find a nvidia_modeset module parameter or an nvkms config key, and the only GSP-side regkeys I could locate (RmForceEnableDIFR, the two RMLpwrMsDifr*IdleThresholdUs) only force it on or adjust idle entry.

In the meantime the only reliable workaround I have is to reboot after the 5th resume of each boot, which converts a hard hang into a scheduled reboot. Happy to run any instrumented build or apply any patch against 595.71.05 and report back — I have a 100% reproducible case in 6 suspend cycles.

runiter avatar Aug 11 '26 00:08 runiter

Independent data point on desktop Blackwell that may refine the cycle-count part of your model.

  • RTX 5070 Ti (10de:2c05)
  • kernel 7.0.0-28
  • Ubuntu 26.04
  • No Optimus, no lid, no battery/AC events

Same nvDIFRPrefetchSurfaces -> nvWriteGpEntry stack, same hard hang, SSH survives.

Your "exactly the 6th cycle, every time" doesn't hold here, but in a way that I think supports your leak mechanism rather than contradicting it. I pulled successful PM: suspend exit counts per boot for my 8 DIFR hangs:

The command:

for b in $(journalctl --list-boots -q | awk '{print $1}'); do c=$(journalctl -kb "$b" --no-pager 2>/dev/null | grep -c 'PM: suspend exit') h=$(journalctl -kb "$b" --no-pager 2>/dev/null | grep -c 'nvDIFRPrefetchSurfaces') echo "boot $b: $c resumes, DIFR-hang=$([ $h -gt 0 ] && echo YES || echo no)" done

The output:

boot -25: 0 resumes, DIFR-hang=no boot -24: 0 resumes, DIFR-hang=no boot -23: 0 resumes, DIFR-hang=no boot -22: 0 resumes, DIFR-hang=no boot -21: 24 resumes, DIFR-hang=YES boot -20: 1 resumes, DIFR-hang=no boot -19: 28 resumes, DIFR-hang=no boot -18: 14 resumes, DIFR-hang=no boot -17: 19 resumes, DIFR-hang=YES boot -16: 6 resumes, DIFR-hang=YES boot -15: 0 resumes, DIFR-hang=no boot -14: 10 resumes, DIFR-hang=YES boot -13: 0 resumes, DIFR-hang=no boot -12: 9 resumes, DIFR-hang=YES boot -11: 0 resumes, DIFR-hang=no boot -10: 0 resumes, DIFR-hang=no boot -9: 17 resumes, DIFR-hang=YES boot -8: 0 resumes, DIFR-hang=no boot -7: 14 resumes, DIFR-hang=YES boot -6: 3 resumes, DIFR-hang=no boot -5: 0 resumes, DIFR-hang=no boot -4: 0 resumes, DIFR-hang=no boot -3: 1 resumes, DIFR-hang=no boot -2: 1 resumes, DIFR-hang=no boot -1: 11 resumes, DIFR-hang=YES boot 0: 0 resumes, DIFR-hang=no

The relevant data:

resumes before DIFR-hang: 6, 9, 10, 11, 14, 17, 19, 24

So I do get the hang, but anywhere from 6 to 24 resumes in, not a fixed 6.

Note some boots survived even longer with no hang at all (boot -19: 28 clean resumes).

This doesn't match your fixed-6, but I'm posting the numbers in case the spread is useful.

Suspend/resume is my normal workflow. I keep several dev environments set up across virtual desktops that take minutes to rebuild, and sessions run from minutes to many hours. So a "reboot after the Nth resume" workaround is awkward when N is unpredictable, and "reboot after the 5th resume" is too low.

Live-hang and baseline nvidia-bug-report.log attached.

nvidia-bug-report-595.84-baseline.zip

nvidia-bug-report-595.84-HANG.zip

dcrespo3d avatar Aug 11 '26 10:08 dcrespo3d

Hi — this looks like the same root bug as https://github.com/NVIDIA/open-gpu-kernel-modules/issues/1289: soft lockup of the nvidia-modeset kthread in the DIFR prefetch path (nvDIFRPrefetchSurfaces → nvPushKickoff → nvWriteGpEntry), triggered by S3 resume — identical to our reproduction.

#1289 includes a stable repro, the code-level root cause (unbounded GPFIFO-space wait in nvWriteGpEntry), and a locally-verified mitigation patch scoped to the DIFR channel (4/4 stalls caught, 0 KMS thread blocked), plus a workaround (disable display auto-blank). May help until NVIDIA ships a fix.

Awin-G avatar Aug 11 '26 17:08 Awin-G

Good news, my proposed fix at PR below is working well in my own pc. No more hangs!

PR: https://github.com/NVIDIA/open-gpu-kernel-modules/pull/1286

For those who like to try it, I built this easy script in attached zip file: nvidia-difr-hang-fix.zip

Simply run these commands:

./build.sh              
sudo ./install.sh 
sudo reboot

runiter avatar Aug 14 '26 14:08 runiter

Ada mobile (10de:28e0), 610.57.04 — fires with zero suspend/resume cycles

Adding a third hardware configuration, and one data point that I think constrains @runiter's model: all three of my DIFR hangs happened in boots with no suspend at all.

Config

Component Detail
Laptop ASUS TUF Gaming A15 FA507NV, BIOS FA507NV.316 (2024-11-04)
dGPU GeForce RTX 4060 Laptop [10de:28e0] (Ada, AD107M)
iGPU AMD Radeon 680M (Rembrandt), hybrid PRIME via supergfxctl (Hybrid)
Driver 610.43.03 and 610.57.04, open kernel module
Kernel 7.1.4-1 / 7.1.8-1-MANJARO (stable)
Desktop KDE Plasma, kwin_wayland
Display External monitor on HDMI, wired to the dGPU (card0-HDMI-A-1)
Modparams NVreg_DynamicPowerManagement=0x02, nvidia_drm modeset=1

Trace (18 Aug, representative of all three)

INFO: task kwin_wayland:1590 blocked for more than 860 seconds.
INFO: task kwin_wayland:1590 blocked on a semaphore likely last held by task nvidia-modeset/:501

task:kwin_wayland  state:D
  __down_common -> down -> nvkms_ioctl_from_kapi_try_pmlock+0x4a/0xa0 [nvidia_modeset]
  ApplyModeSetConfig+0x5ed/0xda0 [nvidia_modeset]
  nv_drm_atomic_apply_modeset_config+0x7b0/0x890 [nvidia_drm]
  drm_atomic_check_only -> drm_mode_atomic_ioctl -> drm_ioctl

task:nvidia-modeset/  state:R  running task
  ? nvWriteGpEntry+0x109/0x3e0 [nvidia_modeset]
  ? nvPushSetObject+0xb1/0x170 [nvidia_modeset]
  ? nvPushKickoff+0x2c/0x50 [nvidia_modeset]
  ? PrefetchHelperSurfaceEvo+0x4df/0x6f0 [nvidia_modeset]
  ? nvDIFRPrefetchSurfaces+0xd9/0x240 [nvidia_modeset]
  ? DifrPrefetchEventDeferredWork+0x16/0x30 [nvidia_modeset]
  ? nvkms_kthread_q_callback+0xe6/0x170 [nvidia_modeset]

No suspend involved

boot 2026-07-29 -> 07-31 :  suspend entry=0  exit=0  -> DIFR HANG
boot 2026-08-14 -> 08-18 :  suspend entry=0  exit=0  -> DIFR HANG
boot 2026-08-18 -> 08-20 :  suspend entry=0  exit=0  -> DIFR HANG

Not "few" resumes — zero. These boots ran 2–4 days of continuous uptime and never suspended once. So the trigger cannot be a per-resume leak on its own, and the "always the 6th cycle" rule cannot apply here at all. This is consistent with @dcrespo3d's 6–24 spread and with @khalangy's report that it arms on display idle rather than on resume. It also matches the framing in #1289 ("display freezes on display blank").

If the GPFIFO-exhaustion model in #1286 is right, it would suggest entries leak on display-idle DIFR prefetch cycles generally, with suspend/resume being one way to accumulate them quickly rather than the only one.

Independent corroboration of the unbounded spin

nvidia-modeset is in state R, not D — it is spinning, not waiting. Across separate hung-task reports two minutes apart, the sampler caught it here:

2026-07-31 :  nvWriteGpEntry +0x40, +0x109
2026-08-18 :  nvWriteGpEntry +0x40, +0x109, +0x10c, +0x10e, +0x110
2026-08-20 :  nvWriteGpEntry +0x40, +0x10c, +0x10e

+0x109 through +0x110 is a 7-byte window, re-sampled minutes apart in independent reports. That is what a bare while (nextGpPut == ReadGpGetOffset(push_buffer)) loop with no sleep and no cond_resched() looks like from outside — direct support for the root cause in #1286.

Happy to attach nvidia-bug-report.log or test the #1286 patch if useful.

heatzync avatar Aug 26 '26 08:08 heatzync

The "does not happen with the proprietary driver" checkbox is wrong — reproduced on proprietary 610.57.04

This confirms @tekgrrl's update above ("Updated because I was able to reproduce this with the proprietary release"). I hit the same deadlock on the proprietary module after switching to it specifically to escape this bug, on the basis of the open-only framing in the issue header.

What I did

Same machine as my report above (RTX 4060 Laptop [10de:28e0] + Radeon 680M, hybrid PRIME, KDE/kwin_wayland). After three DIFR hangs on 610.57.04 open, I swapped open -> proprietary at the identical driver version, changing nothing else:

before:  NVIDIA UNIX Open Kernel Module  610.57.04
after :  NVIDIA UNIX x86_64 Kernel Module  610.57.04

Result: it still hangs

Two freezes on proprietary, 24 and 26 August, on kernels 7.1.8-1 and 7.1.9-1:

INFO: task kwin_wayland:1453 blocked for more than 30 seconds.
      Tainted: P    B      OE       7.1.8-1-MANJARO #1
      Tainted: [P]=PROPRIETARY_MODULE, [O]=OOT_MODULE, [E]=UNSIGNED_MODULE
INFO: task kwin_wayland:1453 blocked on a semaphore likely last held by task nvidia-modeset/:493

task:nvidia-modeset/  state:R  running task
  ? _nv003274kms+0xfc/0x380 [nvidia_modeset]
  ? _nv003130kms+0x2b/0x50  [nvidia_modeset]
  ? _nv000662kms+0x43c/0x620 [nvidia_modeset]
  ? _nv002682kms+0xb1/0x1f0 [nvidia_modeset]
  ? _nv000109kms+0x1e/0x40  [nvidia_modeset]
  ? down+0x1e/0x70
  ? nvkms_kthread_q_callback+0xe6/0x170 [nvidia_modeset]
  ? _main_loop+0x10e/0x160 [nvidia_modeset]

Note the taint flag: [P]=PROPRIETARY_MODULE. Same compositor, same nvidia-modeset kthread, same semaphore, same nvkms_kthread_q_callback deferred-work path, same state R spin. The sampler caught it at _nv003274kms+0xfc and +0x101 repeatedly — the same tight-loop signature as the nvWriteGpEntry cluster on the open build.

Why I can't say "it is definitely DIFR" on proprietary

The proprietary build strips these names. I checked:

open        nvidia_modeset:  10 readable DIFR symbols (nvDIFRPrefetchSurfaces, ...)
proprietary nvidia_modeset:   0 "difr" strings, 3673 obfuscated _nvNNNNNNkms symbols

So the DIFR frames are not absent on proprietary — they are unnameable. Anyone diffing the two stacks and concluding "different bug" is reading a symbol-visibility artifact. What can be stated is that the deadlock shape is identical.

Why this matters for triage

The header checkbox makes this look like an open-module-only defect, which is misleading in two directions: it sends affected users to the proprietary driver as a workaround (it isn't one — I lost a week to that), and it risks the issue being scoped to the open module when the fix in #1286 touches src/common/unix/nvidia-push/src/nvidia-push.c, shared code.

Would suggest the issue title/body be amended to drop the open-only framing.

heatzync avatar Aug 26 '26 09:08 heatzync

@heatzync I know you said in your case it was not related to suspends/resume but if you like you can try my fix above in nvidia-difr-hang-fix.zip to see if it fixes it anyways.

runiter avatar Aug 27 '26 03:08 runiter

When it happens, the machine does not hang. Only the display output freezes. You can easily SSH into the machine and shut it down.

martin3000 avatar Oct 02 '26 20:10 martin3000

For those who like to try it, I built this easy script in attached zip file: nvidia-difr-hang-fix.zip

Thanks, seems to work!

martin3000 avatar Oct 05 '26 14:10 martin3000

Still reproducible on 615.78.08, without any suspend or resume

@aritger, you asked to hear if the suspend/resume DIFR change in 595.99.02 / 615.71.09 does not match people's experience. On 615.78.08 I still get the same nvDIFRPrefetchSurfaces lockup, but with no suspend at all, so the teardown/realloc around suspend does not cover this case. The GPU is the same device as in this issue (10de:2c59).

System

  • Lenovo Legion Pro 7 16IAX10H, GeForce RTX 5080 Laptop GPU (GB203M, 10de:2c59), Intel Arrow Lake iGPU drives the internal eDP panel
  • Two external monitors (HDMI-A-1 and DP-2), both on the NVIDIA GPU
  • Arch Linux (Omarchy), kernel 7.2.15-1-omarchy
  • nvidia-open-dkms 615.78.08
  • Hyprland 0.56.2 (Wayland), aquamarine 0.15.1
  • nvidia_drm modeset=1, NVreg_DynamicPowerManagement=3, NVreg_PreserveVideoMemoryAllocations=1

Symptom

The freeze happens when I come back to the machine after the screen has locked and the displays have turned off from idle. The system is not suspended. Shortly after the external monitors turn back on, the desktop freezes permanently and needs a forced reboot. This happened three times between Nov 8 and Nov 14 on 615.78.08. I believe I saw similar freezes a few months ago that then stopped, but I have no logs from that period.

The journal confirms that none of the three affected boots had a suspend or hibernation. In each case the kernel logged nvidia 0000:02:00.0: Enabling HDA controller (the GPU waking the displays) one to two minutes before the first hung-task report. It never recovers: Hyprland stays blocked for more than 1228 seconds, until the hung-task reports are suppressed.

Trace (identical in all three freezes)

Hyprland blocked in an atomic commit:

INFO: task Hyprland:1800 blocked for more than 122 seconds.
task:Hyprland        state:D stack:0     pid:1800  tgid:1800  ppid:1795   task_flags:0x400000 flags:0x00080000
Call Trace:
 <TASK>
 __schedule+0x40f/0x1780
 schedule+0x27/0xa0
 schedule_timeout+0xdc/0x120
 __down_common+0xff/0x400
 down+0x53/0x70
 nvkms_ioctl_from_kapi_try_pmlock+0x4a/0xa0 [nvidia_modeset]
 ApplyModeSetConfig+0x67b/0xe30 [nvidia_modeset]
 nv_drm_atomic_apply_modeset_config+0x8aa/0xa80 [nvidia_drm]
 drm_atomic_check_only+0x5d1/0xa30
 drm_atomic_nonblocking_commit+0x17/0x70
 drm_mode_atomic_ioctl+0xec7/0x1200
 drm_ioctl_kernel+0xae/0x100
 drm_ioctl+0x2e0/0x550
 __x64_sys_ioctl+0xb9/0xf0
 do_syscall_64+0xaa/0x630
 entry_SYSCALL_64_after_hwframe+0x76/0x7e
 </TASK>

The lock holder, still running in the DIFR prefetch path:

INFO: task Hyprland:1800 blocked on a semaphore likely last held by task nvidia-modeset/:324
task:nvidia-modeset/ state:R  running task     stack:0     pid:324   tgid:324   ppid:2      task_flags:0x208040 flags:0x00080000
Call Trace:
 <TASK>
 ? nvWriteGpEntry+0xc6/0x3f0 [nvidia_modeset]
 ? nvPushSetObject+0xb1/0x170 [nvidia_modeset]
 ? nvPushKickoff+0x2c/0x50 [nvidia_modeset]
 ? PrefetchHelperSurfaceEvo+0x4df/0x700 [nvidia_modeset]
 ? nvDIFRPrefetchSurfaces+0x155/0x240 [nvidia_modeset]
 ? DifrPrefetchEventDeferredWork+0x16/0x30 [nvidia_modeset]
 ? nvkms_kthread_q_callback+0xe6/0x170 [nvidia_modeset]
 ? _main_loop+0x10e/0x160 [nvidia_modeset]
 ? kthread+0xe4/0x120
 ? ret_from_fork+0x292/0x330
 </TASK>

This looks like the GPFIFO wait that #1286 addressed directly, reached from a display wake instead of from resume. I can run nvidia-bug-report.sh after the next freeze, or test a patched build, if that helps.

mrzli avatar Nov 15 '26 02:11 mrzli