620.70.06: GPU lock never released after error_detected(pci_channel_io_perm_failure), so nv_pci_shutdown and nvidia-smi block forever and every poweroff hangs; triggered by a non-fatal AER that only the HDA function failed to recover
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 42/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- c, linux
- Domínio
- backend, operating-systems
Direção de pesquisa
Start by reading nv_pci_error_detected in kernel-open/nvidia/nv-pci.c, then trace the interrupt top half and bottom half in kernel-open/nvidia/nv.c and src/nvidia/arch/nvalloc/unix/src/unix_intr.c. Check how pci_channel_io_perm_failure affects GPU state and whether the handed-off lock is released when bottom-half work is skipped. Done means the lock cannot remain held after this recovery path and the reported poweroff and nvidia-smi hangs are addressed.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
NVIDIA Open GPU Kernel Modules Version
620.70.06 (Arch Linux nvidia-open-dkms 620.70.06-1 with PR %231512 applied for the unrelated RTD3 issue %231507; also reproduced with the stock Arch nvidia-open 620.70.06 package without %231512)
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
Arch Linux
Kernel Release
Linux 7.3.4-arch1-1 %231 SMP PREEMPT_DYNAMIC Wed, 11 Nov 2026 19:02:39 0000 x86_64 GNU/Linux (Arch stock kernel, not self-built)
Please confirm you are running a stable release kernel (e.g. not a -rc). We do not accept bug reports for unreleased kernels.
- I am running on a stable kernel release.
Hardware: GPU
GPU 0: NVIDIA GeForce RTX 5070 Laptop GPU
Describe the bug
I have not tested the proprietary driver. The code involved is the new PCI error handling in
kernel-open/nvidia/nv-pci.cand the interrupt bottom half inkernel-open/nvidia/nv.candsrc/nvidia/arch/nvalloc/unix/src/unix_intr.c, all in this repository. Line references are to the620.70.06tag.
620 adds PCI error handlers, nv_pci_error_detected enabled by default through NVreg_EnablePCIeErrorRecovery=1). After the driver receives pci_channel_io_perm_failure, the RM GPU lock is never released again. Every later RM call that needs the GPU lock blocks forever in state D:
nv_pci_shutdown()at poweroff and reboot, so the machine never powers offnvidia-smi, thenv_queueworker and the ACPI notify handler during a session
The GPU stays dead until a hard reset. 615.78.08 registered no PCI error handlers and keeps working through the same AER event on the same kernel.
On this laptop, perm_failure doesn't mean the GPU is gone. The GPU's root port logs a non-fatal Unsupported Request. The GPU's own error_detected votes CAN_RECOVER. Recovery fails only because snd_hda_intel on the GPU's HDA function 01:00.1 has no error_detected callback. The kernel then sends perm_failure to every driver below the port, without resetting or disconnecting anything.
System
- ASUS ROG Strix G18 G814FP, BIOS G814FP.317 (2026-07-02)
- Ryzen 9 9955HX, RTX 5070 Laptop GPU (GB206M,
10de:2d58) at01:00.0, HDA function at01:00.1, directly behind AMD root port00:01.1(1022:14db) - Hybrid graphics: the Radeon 610M iGPU drives the panel and the dGPU uses RTD3. KDE Plasma Wayland.
1. GPU lock leak in the ISR bottom half
Reading the 620.70.06 source, this is the path that leaves the lock held:
nv_pci_error_detectedsetsNV_FLAG_IN_PCIE_ERROR_RECOVERYfor every state exceptpci_channel_io_normal. Nothing ever clears it.nv_check_gpu_state()now returnsNV_ERR_GPU_IS_LOSTforNV_IS_DEVICE_INACCESSIBLE, which includes the new flag. In 615.78.08 it checked surprise removal only.- The top half
nvidia_isrdoesn't check the flag. It callsrm_isr, which callsosIsr, which callsosInterruptPending. That function takes the GPU lock withGPU_LOCK_FLAGS_COND_ACQUIRE. When stall work is pending, it keeps the lock and sets the owner toGPUS_LOCK_OWNER_PENDING_DPC_REFRESH, which is(OS_THREAD_HANDLE)-1.nvidia_isrthen returnsIRQ_WAKE_THREAD. - The threaded bottom half
nvidia_isr_common_bhcallsnv_check_gpu_state(), getsNV_ERR_GPU_IS_LOSTand skipsrm_isr_bh().RmIsrBottomHalfis the only code that takes over the handed-off lock (L615) and releases it (L665).
This path leaks the lock whenever a GPU interrupt with stall work pending arrives after the flag is set. The lock stays held by the "pending DPC" owner, which is not a thread. The GPU is still alive here and still raising interrupts. This bottom-half skip was already in 615. It only becomes reachable once the flag can be set on a GPU that is still on the bus.
Every RM-related task in state D in the logs below is waiting for the GPU lock, and none of them holds it. I haven't confirmed that this path is the one that ran in these hangs. If it is, rmGpuLockInfo.gpuLocks[0].threadId reads GPUS_LOCK_OWNER_PENDING_DPC_REFRESH afterwards.
At poweroff. I captured this during a Plasma poweroff with hung_task_panic=1, initcall_debug and EFI pstore. The driver had resumed the GPU from D3cold for teardown:
[ 113.308062] nvidia 0000:01:00.0: Enabling HDA controller
[ 116.831867] shutdown[1]: Powering off.
[ 116.836411] pcieport 0000:06:01.0: shutdown <- USB4 tree behind root port 00:02.1
[ 116.973101] pcieport 0000:00:01.1: AER: Uncorrectable (Non-Fatal) Error message received from 0000:00:01.1
[ 116.974049] pcieport 0000:00:01.1: device [1022:14db] error status/mask=00100000/00400000
[ 116.974187] pcieport 0000:00:01.1: [20] UnsupReq | Receiver | Transaction Layer (First)
[ 116.974329] pcieport 0000:00:01.1: AER: TLP Header: 0x00000000 0x00000000 0x00000000 0x00000000
[ 117.017845] snd_hda_intel 0000:01:00.1: AER: can't recover (no error_detected callback)
[ 117.018018] NVRM: GPU 0000:01:00.0: PCIe link reported as permanently failed; GPU remains inaccessible
[ 117.018187] pcieport 0000:00:01.1: AER: device recovery failed
(the same sequence twice more by 117.126)
[ 118.769157] nvidia 0000:01:00.0: shutdown
[ 118.769435] [drm] [nvidia-drm] [GPU ID 0x00000100] Removing device
[ 118.769996] [drm] [nvidia-drm] [GPU ID 0x00000100] Unloading driver
[ 143.420032] INFO: task shutdown:1 blocked for more than 20 seconds.
down+0x53/0x70
os_acquire_mutex+0x2c/0x40 [nvidia]
portSyncSemaphoreAcquire+0x10/0x40 [nvidia]
_rmGpuLocksAcquire.isra.0+0x42b/0x1020 [nvidia]
rmGpuLocksAcquire+0x2e/0x170 [nvidia]
deviceCtrlCmdOsUnixVTSwitch_IMPL+0x55/0x340 [nvidia]
... resControl_IMPL / serverControl / _rmapiRmControl ...
Nv04ControlKernel+0x6f/0x80 [nvidia]
nvkms_call_rm+0x4c/0x80 [nvidia_modeset]
nvRmApiControl+0x6e/0x80 [nvidia_modeset]
nvRmVTSwitch+0x2d/0x40 [nvidia_modeset]
nvAllocCoreChannelEvo+0x249/0x9e0 [nvidia_modeset]
RestoreConsole+0x69/0xa0 [nvidia_modeset]
ReleaseOwnership+0x73/0xa0 [nvidia_modeset]
nvKmsIoctl+0x123/0x300 [nvidia_modeset]
nvkms_ioctl_from_kapi+0x6f/0xe0 [nvidia_modeset]
ReleaseOwnership+0x33/0x40 [nvidia_modeset]
nv_drm_dev_unload+0x5b/0x110 [nvidia_drm]
nv_drm_remove.cold+0x52/0x65 [nvidia_drm]
nv_pci_remove_helper+0x8a/0x510 [nvidia]
nv_pci_shutdown+0x55/0x90 [nvidia]
pci_device_shutdown+0x3e/0x80
device_shutdown+0x169/0x1d0
kernel_power_off+0x35/0x80
__do_sys_reboot+0x1da/0x260
[ 143.422410] INFO: task nv_queue:814 blocked for more than 20 seconds.
down+0x53/0x70
os_acquire_mutex+0x2c/0x40 [nvidia]
portSyncSemaphoreAcquire+0x10/0x40 [nvidia]
_rmGpuLocksAcquire.isra.0+0x42b/0x1020 [nvidia]
rmGpuGroupLockAcquire+0x108/0x1c0 [nvidia]
workItemLocksAcquire+0xa4/0x210 [nvidia]
rm_execute_work_item+0xb8/0x1e0 [nvidia]
_main_loop+0x111/0x170 [nvidia]
[ 143.423121] Kernel panic - not syncing: hung_task: blocked tasks
Without hung_task_panic, the machine sits there with the screen off until the power button is held.
In a session. An lspci woke the GPU from D3cold, and the same scan also powered up the USB4 controller. Then:
04:20:25.047758 pcieport 0000:00:01.1: [20] UnsupReq | Receiver | Transaction Layer (First)
04:20:25.090804 snd_hda_intel 0000:01:00.1: AER: can't recover (no error_detected callback)
04:20:25.091089 NVRM: GPU 0000:01:00.0: PCIe link reported as permanently failed; GPU remains inaccessible
04:20:25.091130 pcieport 0000:00:01.1: AER: device recovery failed
(x3 by 04:20:25.195)
04:26:14.473139 INFO: task nvidia-smi:16008 blocked for more than 122 seconds.
down+0x53/0x70
os_acquire_mutex+0x2c/0x40 [nvidia]
portSyncSemaphoreAcquire+0x10/0x40 [nvidia]
_rmGpuLocksAcquire.isra.0+0x42b/0x1020 [nvidia]
rmGpuGroupLockAcquire+0x108/0x1c0 [nvidia]
os_ref_dynamic_power+0x198/0x230 [nvidia]
rmapiPrologue+0x9c/0x1f0 [nvidia]
rmapiAllocWithSecInfo+0x4b/0x420 [nvidia]
...
RmIoctl+0xc69/0x1170 [nvidia]
rm_ioctl+0x7b/0x600 [nvidia]
nvidia_unlocked_ioctl+0x6a0/0xab0 [nvidia]
04:26:14.471685 INFO: task kworker/0:1:10 <writer> blocked on an rw-semaphore likely owned by task nvidia-smi:16008 <reader>
04:26:14.473122 INFO: task nv_queue:811 <writer> blocked on an rw-semaphore likely owned by task nvidia-smi:16008 <reader>
kworker/0:1 is in rm_acpi_notify (kacpi_notify) and nv_queue is in workItemLocksAcquire. Both are waiting for the RM API lock, which the first nvidia-smi holds while it waits for the GPU lock. Tasks in D state afterwards:
PID STAT WCHAN CMD
10 D - [kworker/0:1+kacpi_notify]
811 D - [nv_queue]
16008 D os_acquire_mutex nvidia-smi --query-gpu=name,pstate,power.draw --format=csv,noheader
19203 D os_acquire_rwlock_read nvidia-smi
2. Non-fatal AER treated as GPU failure
Same root port error on the same kernel (7.3.4), 615.78.08 vs stock 620.70.06:
615.78.08:
[369.108454] pcieport 0000:00:01.1: [20] UnsupReq | Receiver | Transaction Layer (First)
[369.151013] nvidia 0000:01:00.0: AER: can't recover (no error_detected callback)
[369.151202] snd_hda_intel 0000:01:00.1: AER: can't recover (no error_detected callback)
[369.151273] pcieport 0000:00:01.1: AER: device recovery failed
620.70.06:
[2657.501035] pcieport 0000:00:01.1: [20] UnsupReq | Receiver | Transaction Layer (First)
[2657.501328] snd_hda_intel 0000:01:00.1: AER: can't recover (no error_detected callback)
[2657.501482] NVRM: GPU 0000:01:00.0: PCIe link reported as permanently failed; GPU remains inaccessible
[2657.501507] pcieport 0000:00:01.1: AER: device recovery failed
With 615 the GPU kept working and kept runtime-suspending. With 620 it is dead for the rest of the boot, and the boot ends in the hang above.
What happens in pcie_do_recovery() (drivers/pci/pcie/err.c, v7.3.4):
- The error is non-fatal, so
error_detected(pci_channel_io_normal)goes to every device below00:01.1.nvidiareturnsPCI_ERS_RESULT_CAN_RECOVER. The driver logs that atNV_DBG_INFO, so it doesn't appear above. snd_hda_intelhas no callback, so its vote isPCI_ERS_RESULT_NO_AER_DRIVERand recovery goes tofailed:.failed:callsreport_perm_failure_detected()for every device below the port. That callserror_detected(dev, pci_channel_io_perm_failure)and nothing else. It doesn't reset the link or changepci_dev->error_state. The GPU stays fully accessible.
The comment at nv-pci.c#L2617-L2621 expects perm_failure to follow the driver's own DISCONNECT vote from slot_reset. Here it follows a CAN_RECOVER vote on a non-fatal error, with no reset. snd_hda_intel has no PCI error handlers, so any non-fatal uncorrectable error below the GPU's root port now ends this way while snd_hda_intel is bound to the HDA function.
3. Trigger on this machine, for context
Root port 00:01.1 logs the non-fatal UnsupReq (TLP header all zeros) whenever the ASM4242 USB4 controller behind the other root port, 00:02.1, powers up from D3cold while the GPU link is up. I confirmed this by powering up the controller with the GPU held in D0 and with the GPU suspended. Only the first case sets the UnsupReq bit in 00:01.1's error status. At poweroff, pci_device_shutdown() runtime-resumes each device while the GPU is awake for teardown, so every poweroff and reboot hits it.
Tested workarounds
- Mask UnsupReq on the GPU's root port, a udev rule runs
setpci -s 0000:00:01.1 ECAP0001+8.L=00100000:00100000when the port is enumerated (AER Uncorrectable Error Mask, bit 20). Without it, every boot on 620.70.06 hung at poweroff or reboot. With it, poweroffs and reboots were clean, including one after dGPU use and an s2idle cycle in which the USB4 power-up happened while the GPU was awake. Boots on the same kernel without thenvidiamodule loaded shut down cleanly with the AER errors present. - Setting
nvidia.NVreg_EnablePCIeErrorRecovery=0, this skips registering the error handlers (nv-pci.c#L2786) and gives 615's behavior. With the AER mask removed, the same trigger (USB4 power-up with the GPU awake) produced 3 UnsupReqs at00:01.1andnvidia 0000:01:00.0: AER: can't recover (no error_detected callback), but nopermanently failed.nvidia-smikept working, the GPU runtime-suspended again, and the next poweroff was clean.
Note on the patched driver
The DKMS build carries PR #1512, which fixes RTD3 on Linux 7.3 (#1507) and only touches nv_get_pci_sysfs_config(). It isn't involved here. The 620 log in section 2 is from the stock Arch nvidia-open 620.70.06 package without #1512. With RTD3 broken there, the GPU sat in D0 all session, and every USB4 power-up hit it. That boot also hung at shutdown. The 615 log in section 2 is from 615.78.08 with #1512 applied, on the same 7.3.4 kernel. Stock 615.78.08 on 7.2.15 logs the same can't recover (no error_detected callback) lines for nvidia and keeps working.
To Reproduce
On this machine (ASUS G814FP, BIOS 317, stock ACPI behavior, 620.70.06, hybrid mode, no AER mask):
- Boot into a Plasma Wayland session. RTD3 makes no difference.
- Power off. The machine never powers off:
nv_pci_shutdownblocks on the GPU lock, as in the stack above. This happens every time. - In a session: hold the GPU in D0 (
echo on > /sys/bus/pci/devices/0000:01:00.0/power/control), then power up the USB4 controller (echo on > /sys/bus/pci/devices/0000:00:02.1/power/control).00:01.1logs the non-fatalUnsupReq. With the AER mask active, I confirmed this through00:01.1's Uncorrectable Error Status register, which a masked error still sets. Without the mask, the same USB4 power-up while the GPU was awake producedpermanently failed, both in a session and at shutdown. Any laternvidia-smihangs in state D.
Bug Incidence
Always
nvidia-bug-report.log.gz
More Info
Expected behavior: after the driver has declared the GPU inaccessible, nv_pci_shutdown() and RM clients should fail fast or skip GPU work instead of deadlocking. A non-fatal AER that the GPU itself voted CAN_RECOVER on shouldn't take the GPU down because another function on the link has no error handler.
Related:
- #1544 reports a shutdown hang on 620.70.06 that doesn't happen with 615.78.08 (RTX 5070 Ti Laptop, Arch, 7.3.4), with no logs. It may be this bug. A
journalctl -k -b -1 | grep 'permanently failed'after a hung boot would tell. - #1229 asked for
pci_error_handlersafter a transient eGPU error. The bug reported here came in with those handlers. - #1222 is a different shutdown stall that goes through the same
RestoreConsoleand VT-switch calls. There the CPU spins inunixCallVideoBIOS. Here the task sleeps on the GPU lock.
- Linguagem predominante
- C
- Estrelas
- 17.7k
- Forks
- 2k
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de NVIDIA/open-gpu-kernel-modules
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
NVIDIA/open-gpu-kernel-modules#1635 ·
Mantenedores costumam responder em até 1 dia
-
nvidia-drm: NULL dereference in nv_drm_create_sync_file() when sync_file_create() fails (kernel oops when fs.file-max is exhausted)Talvez livre de novo Um pull request para esta issue foi fechado sem ser mesclado. Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
NVIDIA/open-gpu-kernel-modules#1601 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
NVIDIA/open-gpu-kernel-modules#1479 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
PlatformRequestHandler: missing !bInit guard on bSystemParamLimitUpdate causes NV_ERR_INVALID_DATA at bootTalvez já em andamento @SammyTourani assumiu há 69 dias. Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
NVIDIA/open-gpu-kernel-modules#1360 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
NVIDIA/open-gpu-kernel-modules#1343 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
Todas as issues de NVIDIA/open-gpu-kernel-modules
Issues semelhantes
-
iOS: the "Edit controls" button never hides, even with a controller connected, and covers the gameAbertagame: 010065A014024000 ios
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
seedds/nxnative#3714 · 1 comentário ·
Mantenedores costumam responder em até 2 dias
-
area/docdb kind/enhancement mvu-pg15-pg19 priority/low
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
yugabyte/yugabyte-db#40355 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
Jstar269/nakagawa-recomp#3753 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 72/100
ly05010419/MacNativeGames#2474 ·
Mantenedores costumam responder em até 1 dia