NVIDIA / NVIDIA/open-gpu-kernel-modules
[Bug]: Hibernation fails with error -5 (missing PM_RESTORE_PREPARE) and 0x11 (empty runlist) on hybrid graphics with NVreg_UseKernelSuspendNotifiers=1
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 17.4k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
NVIDIA Open GPU Kernel Modules Version
610.57.04 (and 610.x branch)
Proprietary Driver Confirmation
- I confirm that this specific combination of kernel suspend notifiers and hibernation restore failure manifests on the open kernel module branch.
Operating System and Version
Arch Linux / Omarchy (rolling, 2026.08)
Kernel Release
Linux marine 7.1.8-arch1-3 #1 SMP PREEMPT_DYNAMIC Tue, 11 Aug 2026 09:16:08 +0000 x86_64 GNU/Linux (Arch official stable package)
Kernel Stable Confirmation
- I am running on a stable kernel release.
Hardware: GPU
GPU 0: NVIDIA GeForce GTX 1660 Ti with Max-Q Design (UUID: GPU-66d37982-4edb-5b4f-ba35-24a1b878426f, TU116M)
Host platform: Hybrid laptop (AMD Ryzen 7 3750H APU driving desktop display via eDP, NVIDIA dGPU in RTD3 dynamic power management).
Describe the bug
When running nvidia-open 610.x on hybrid graphics with NVreg_UseKernelSuspendNotifiers=1 and NVreg_PreserveVideoMemoryAllocations=1, system hibernation fails through two distinct architectural issues:
-
Hibernation Resume Aborts with Error -5 (
-EIO/NV_ERR_NOT_SUPPORTED):
During resume from hibernation, the kernel loads the saved image into temporary memory and callspci_pm_freeze()->nv_pmops_freeze()on all PCI devices before executing atomic restoration. Becausenv_pm_notifier()does not handlePM_RESTORE_PREPARE,nv_suspend_devices()never executes in the resume kernel.nv_pmops_freeze()passesis_procfs_suspend = NV_FALSE, causingnvidia_suspend()to trip the assertion:NVRM: GPU 0000:01:00.0: PreserveVideoMemoryAllocations module parameter is set. System Power Management attempted without driver procfs suspend interface. nvidia 0000:01:00.0: PM: pci_pm_freeze(): nv_pmops_freeze [nvidia] returns -5 PM: hibernation: resume failed (-5)The kernel aborts restoration and drops into a cold boot.
-
Hibernation / Sleep Entry Aborts with Error 0x11 (
NV_ERR_INVALID_STATE):
On hybrid graphics laptops where Wayland/X11 renders on the integrated GPU, the secondary discrete GPU is idle in Runtime D3 with zero active user FIFO channels. DuringPM_HIBERNATION_PREPAREorPM_SUSPEND_PREPARE,nv_suspend_devices()callsnv_preempt_user_channels(), which executesrm_stop_user_channels(). When invoked on an empty usermode channel list, the Resource Manager returnsNV_ERR_INVALID_STATE(0x11).nv_pm_notifier()treats0x11as a fatal failure and returnsNOTIFY_BAD, aborting the host sleep transition (rtcwake: write error).
To Reproduce
- Configure
/etc/modprobe.d/nvidia.conf:options nvidia NVreg_PreserveVideoMemoryAllocations=1 options nvidia NVreg_UseKernelSuspendNotifiers=1 options nvidia NVreg_DynamicPowerManagement=0x02 - Ensure display server runs on iGPU (PRIME offload), leaving dGPU in RTD3
suspendedstatus. - Trigger hibernation (e.g.
systemctl hibernateorrtcwake -m disk -s 120). - Observe
rtcwake: write errordue toNVRM: PM hibernate notifier failed: 0x11. - If notifier passes, observe resume kernel aborting with
nv_pmops_freeze returns -5during swapfile image restoration.
Bug Incidence
Always (100% reproducible on 610.57.04).
Deep Technical Analysis & Root Cause
Issue 1: Missing PM_RESTORE_PREPARE and PM_POST_RESTORE in nv_pm_notifier
In kernel-open/nvidia/nv.c (lines 4472–4495):
switch (event) {
case PM_SUSPEND_PREPARE:
power_state = NV_POWER_STATE_IN_STANDBY;
name = "suspend";
break;
case PM_HIBERNATION_PREPARE:
power_state = NV_POWER_STATE_IN_HIBERNATE;
name = "hibernate";
break;
case PM_POST_SUSPEND:
case PM_POST_HIBERNATION:
power_state = NV_POWER_STATE_RUNNING;
name = "resume";
break;
default:
return NOTIFY_DONE;
}
During hibernation resume (software_resume() in kernel/power/hibernate.c), the Linux PM core does not dispatch PM_HIBERNATION_PREPARE. It dispatches PM_RESTORE_PREPARE (and later PM_POST_RESTORE).
Because nv_pm_notifier() does not handle PM_RESTORE_PREPARE, it falls into default: return NOTIFY_DONE.
Consequently:
nv_suspend_devices()never runs in the boot kernel.NV_FLAG_SUSPENDEDremains unset.- When
pci_pm_freeze()is called,nv_pmops_freeze()callsnvidia_suspend(dev, NV_PM_ACTION_HIBERNATE, NV_FALSE). - Line 4652 trips:
!is_procfs_suspendis true (and procfs was omitted byNVreg_UseKernelSuspendNotifiers), returning-EIO (-5)and causing the restore to abort.
Issue 2: Empty Runlist Handling in rm_stop_user_channels
In src/nvidia/arch/nvalloc/unix/src/osapi.c (lines 2815–2843):
When rm_stop_user_channels() is called on an idle dGPU with zero open channels (or if pNv->rmapi.hClient == 0), RmUnixRmApiPrologue() returns NULL or NV2080_CTRL_CMD_FIFO_DISABLE_USERMODE_CHANNELS evaluates against an empty list, returning NV_ERR_INVALID_STATE (0x11).
In nv_pm_notifier(), nv_set_system_power_state() returns 0x11, which triggers NOTIFY_BAD and cancels the OS sleep transition.
Proposed Architectural Direction
- Handle
PM_RESTORE_PREPARE/PM_POST_RESTORE:
Expandnv_pm_notifier()inkernel-open/nvidia/nv.cto handlePM_RESTORE_PREPAREidentically toPM_HIBERNATION_PREPARE, andPM_POST_RESTOREidentically toPM_POST_HIBERNATION. This ensuresnv_suspend_devices()properly orchestrates the pre-restore quiesce and setsNV_FLAG_SUSPENDEDbeforenv_pmops_freeze()is called. - Handle Empty Channels Gracefully in RM:
Insrc/nvidia/arch/nvalloc/unix/src/osapi.c, makerm_stop_user_channels()andrm_restart_user_channels()check if the client channel count is 0 or if the device is in RTD3 with no active usermode allocations, and returnNV_OK(no-op) instead of failing withNV_ERR_INVALID_STATE.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in kernel-open/nvidia/nv.c at nv_pm_notifier() and compare the hibernation and restore events described in the issue. Then read rm_stop_user_channels() and rm_restart_user_channels() in src/nvidia/arch/nvalloc/unix/src/osapi.c, reproducing with the listed module parameters on a hybrid GPU system. Done means hibernation resume no longer returns -5 and sleep entry succeeds when the dGPU has no active user channels.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100