Skip to content

Suspend doesn't work when PreserveVideoMemoryAllocations is enabled #472

Open

Description

@Monsterovich

NVIDIA Open GPU Kernel Modules Version

525.85.05

Does this happen with the proprietary driver (of the same version) as well?

Yes

Operating System and Version

Linux Mint 21.1

Kernel Release

Linux pc 5.19.15-xanmod1 #0~20221012.git85103f7 SMP Wed Oct 12 15:04:07 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Hardware: GPU

GPU 0: NVIDIA GeForce RTX 3060 Ti (UUID: GPU-039a34f7-087c-dc8f-a607-e0d937443d0f)

Describe the bug

An error occurs when trying to boot into the system after suspend if PreserveVideoMemoryAllocations is enabled:

[   10.255125] NVRM: GPU 0000:05:00.0: PreserveVideoMemoryAllocations module parameter is set. System Power Management attempted without driver procfs suspend interface. Please refer to the 'Configuring Power Management Support' section in the driver README.
[   10.255127] nvidia 0000:05:00.0: PM: pci_pm_freeze(): nv_pmops_freeze+0x0/0x20 [nvidia] returns -5
[   10.255200] nvidia 0000:05:00.0: PM: dpm_run_callback(): pci_pm_freeze+0x0/0xc0 returns -5
[   10.255203] nvidia 0000:05:00.0: PM: failed to quiesce async: error -5

To Reproduce

  1. Create a file /etc/modprobe.d/nvidia-power-management.conf with the following content:
options nvidia NVreg_PreserveVideoMemoryAllocations=1 NVreg_TemporaryFilePath=/var/tmp
  1. sudo update-initramfs -c -k all to re-generate the kernels.
  2. Reboot.
  3. Go to suspend mode.
  4. Get an error when trying to load a saved state.

Bug Incidence

Always

nvidia-bug-report.log.gz

nvidia-bug-report.log.gz

More Info

https://forums.developer.nvidia.com/t/cannot-suspend-gtx3060-laptop/244143/9
https://forums.developer.nvidia.com/t/preservevideomemoryallocations-systemd-services-causes-resume-from-hibernate-to-fail/233643/3

Activity

  1. added
    bug
    on Mar 11, 2023
  2. David7ce commented on Mar 12, 2023

    @David7ce

    Same bug with suspend mode on Arch Linux, when I suspend I get a black screen. Running:

    linux 6.2.2.arch2-1
    nvidia-open 525.89.02-7
    xf86-video-nouveau 1.0.17-2
    
  3. aaronp24 commented on Mar 13, 2023

    @aaronp24
    Member

    How did you trigger suspend on this system? It looks like the relevant systemd units are enabled but I don't see any evidence that they were triggered. Something needs to run /usr/bin/nvidia-sleep.sh suspend before suspend and /usr/bin/nvidia-sleep.sh resume after resume.

    For context, the video memory preservation process needs to happen before the kernel's low-level suspend process is triggered. The message from the driver implies that something bypassed "System Power Management attempted without driver procfs suspend interface. Please refer to the 'Configuring Power Management Support' section in the driver README" implies that that bracketing didn't happen for some reason.

  4. David7ce commented on Mar 14, 2023

    @David7ce

    With NVIDiA propietary graphics suspend mode and wake up (with NVIDIA RTX 2060 Super or Turing) works fine.
    And I suspend the systems with KDE GUI or via terminal typing systemctl suspend. And the problem was when I tried to wake up the system, always black screen...

  5. Monsterovich commented on Mar 17, 2023

    @Monsterovich
    Author

    How did you trigger suspend on this system? It looks like the relevant systemd units are enabled but I don't see any evidence that they were triggered.

    Nevertheless, all these services are enabled in my system, but they don't work as they should.

    systemctl list-unit-files | grep nvidia
    nvidia-hibernate.service                                                  enabled         enabled
    nvidia-persistenced.service                                               static          -
    nvidia-resume.service                                                     enabled         enabled
    nvidia-suspend.service                                                    enabled         enabled
    
  6. self-assigned this
    on Jun 5, 2023
  7. amrit1711 commented on Jun 5, 2023

    @amrit1711

    Hi All,
    Please test with latest released driver 535.43.02 and share test results.

  8. Sid127 commented on Jun 15, 2023

    @Sid127

    still doesn't work with 535.43.02, though works fine on proprietary module

  9. Monsterovich commented on Jul 1, 2023

    @Monsterovich
    Author

    Hi All, Please test with latest released driver 535.43.02 and share test results.

    @amrit1711

    NVidia driver 535.54.03.

    Regular suspend now doesn't work on open-source driver (works on proprietary module just as @Sid127 has mentioned). The screen simply turns off after waking up.

    dmesg.log

    июл 01 22:08:37 pc kernel: NVRM rpcRmApiAlloc_GSP: GspRmAlloc failed: hClient=0xc1d00000; hParent=0x00010001; hObject=0x00010011; hClass=0x0000c670; paramsSize=0x00000000; paramsStatus=0x00000062; status=0x00000062
    июл 01 22:08:37 pc kernel: nvidia-modeset: ERROR: GPU:0: Failed to initialize display engine: 0x62 (Reset required [NV_ERR_RESET_REQUIRED])
    июл 01 22:08:37 pc kernel: NVRM serverFreeResourceTree: hObject 0x10011 not found for client 0xc1d00000
    июл 01 22:08:37 pc kernel: NVRM unixCallVideoBIOS: int10h(4f02, 0177) vesa call failed! (02a2, 0000)
    июл 01 22:08:37 pc kernel: NVRM rpcRmApiAlloc_GSP: GspRmAlloc failed: hClient=0xc1d00000; hParent=0x00010001; hObject=0x00010011; hClass=0x0000c670; paramsSize=0x00000000; paramsStatus=0x00000062; status=0x00000062
    июл 01 22:08:37 pc kernel: nvidia-modeset: ERROR: GPU:0: Failed to initialize display engine: 0x62 (Reset required [NV_ERR_RESET_REQUIRED])
    июл 01 22:08:37 pc kernel: NVRM serverFreeResourceTree: hObject 0x10011 not found for client 0xc1d00000
    июл 01 22:08:37 pc kernel: NVRM unixCallVideoBIOS: int10h(4f02, 0177) vesa call failed! (02a2, 0000)
    июл 01 22:08:37 pc kernel: NVRM rpcRmApiAlloc_GSP: GspRmAlloc failed: hClient=0xc1d00000; hParent=0x00010001; hObject=0x00010011; hClass=0x0000c670; paramsSize=0x00000000; paramsStatus=0x00000062; status=0x00000062
    июл 01 22:08:37 pc kernel: nvidia-modeset: ERROR: GPU:0: Failed to initialize display engine: 0x62 (Reset required [NV_ERR_RESET_REQUIRED])
    июл 01 22:08:37 pc kernel: NVRM serverFreeResourceTree: hObject 0x10011 not found for client 0xc1d00000
    июл 01 22:08:37 pc kernel: NVRM unixCallVideoBIOS: int10h(4f02, 0177) vesa call failed! (02a2, 0000)
    июл 01 22:08:37 pc kernel: NVRM rpcRmApiAlloc_GSP: GspRmAlloc failed: hClient=0xc1d00000; hParent=0x00010001; hObject=0x00010011; hClass=0x0000c670; paramsSize=0x00000000; paramsStatus=0x00000062; status=0x00000062
    июл 01 22:08:37 pc kernel: nvidia-modeset: ERROR: GPU:0: Failed to initialize display engine: 0x62 (Reset required [NV_ERR_RESET_REQUIRED])
    

    Suspend to disk doesn't work either. The same message as in the first post.

    I also see garbage messages in dmesg:

    [   12.759538] NVRM kgrctxUnmapAssociatedCtxBuffers_IMPL: TSG 9 Channel 11 shares a pVAS with channel 12
    [   12.760963] NVRM kgrctxUnmapAssociatedCtxBuffers_IMPL: TSG 9 Channel 12 shares a pVAS with channel 13
    [   12.762454] NVRM kgrctxUnmapAssociatedCtxBuffers_IMPL: TSG 9 Channel 13 shares a pVAS with channel 14
    [   12.763909] NVRM kgrctxUnmapAssociatedCtxBuffers_IMPL: TSG 9 Channel 14 shares a pVAS with channel 15
    [   12.765581] NVRM kgrctxUnmapAssociatedCtxBuffers_IMPL: TSG 9 Channel 15 shares a pVAS with channel 16
    [   12.767228] NVRM kgrctxUnmapAssociatedCtxBuffers_IMPL: TSG 9 Channel 16 shares a pVAS with channel 17
    [   12.768622] NVRM kgrctxUnmapAssociatedCtxBuffers_IMPL: TSG 9 Channel 17 shares a pVAS with channel 18
    [   12.920867] NVRM kgrctxUnmapAssociatedCtxBuffers_IMPL: TSG 9 Channel 11 shares a pVAS with channel 12
    [   12.922407] NVRM kgrctxUnmapAssociatedCtxBuffers_IMPL: TSG 9 Channel 12 shares a pVAS with channel 13
    [   12.923962] NVRM kgrctxUnmapAssociatedCtxBuffers_IMPL: TSG 9 Channel 13 shares a pVAS with channel 14
    [   12.925519] NVRM kgrctxUnmapAssociatedCtxBuffers_IMPL: TSG 9 Channel 14 shares a pVAS with channel 15
    [   12.926825] NVRM kgrctxUnmapAssociatedCtxBuffers_IMPL: TSG 9 Channel 15 shares a pVAS with channel 16
    [   12.928098] NVRM kgrctxUnmapAssociatedCtxBuffers_IMPL: TSG 9 Channel 16 shares a pVAS with channel 17
    [   12.929377] NVRM kgrctxUnmapAssociatedCtxBuffers_IMPL: TSG 9 Channel 17 shares a pVAS with channel 18
    [   13.608901] NVRM kgrctxUnmapAssociatedCtxBuffers_IMPL: TSG 9 Channel 11 shares a pVAS with channel 12
    [   13.611364] NVRM kgrctxUnmapAssociatedCtxBuffers_IMPL: TSG 9 Channel 12 shares a pVAS with channel 13
    [   13.613183] NVRM kgrctxUnmapAssociatedCtxBuffers_IMPL: TSG 9 Channel 13 shares a pVAS with channel 14
    [   13.614439] NVRM kgrctxUnmapAssociatedCtxBuffers_IMPL: TSG 9 Channel 14 shares a pVAS with channel 15
    [   13.616568] NVRM kgrctxUnmapAssociatedCtxBuffers_IMPL: TSG 9 Channel 15 shares a pVAS with channel 16
    [   13.620816] NVRM kgrctxUnmapAssociatedCtxBuffers_IMPL: TSG 9 Channel 16 shares a pVAS with channel 17
    [   13.622490] NVRM kgrctxUnmapAssociatedCtxBuffers_IMPL: TSG 9 Channel 17 shares a pVAS with channel 18
    

    and

    [    5.099933] NVRM cpuidInfoAMD: Unrecognized AMD processor in cpuidInfoAMD
    

    But I guess they don't affect anything.

  10. zaltysz commented on Jul 6, 2023

    @zaltysz

    Same problem on GTX 3080 with kernel 6.4.2 and open driver 535.54.03.

    During suspend preparation, after nvidia-suspend.service has been activated kernel complains:

    kernel: NVRM nvAssertFailedNoLog: Assertion failed: 0 @ mem_list.c:293kernel: NVRM nvAssertFailedNoLog: Assertion failed: 0 @ mem_list.c:293
    kernel: NVRM nvAssertOkFailedNoLog: Assertion failed: Call not supported [NV_ERR_NOT_SUPPORTED] (0x00000056) returned from pRmApi->Alloc(pRmApi, pMemoryManager->hClient>
    kernel: NVRM nvAssertOkFailedNoLog: Assertion failed: Call not supported [NV_ERR_NOT_SUPPORTED] (0x00000056) returned from memdescSendMemDescToGSP(pGpu, pFbsr->pSysMemD>
    kernel: NVRM nvAssertOkFailedNoLog: Assertion failed: Call not supported [NV_ERR_NOT_SUPPORTED] (0x00000056) returned from _fbsrInitGsp(pGpu, pFbsr) @ fbsr_gm107.c:548
    

    Looks like some sort of GSP firmware and driver incompatibility/miscommunication.

  11. hugh712 commented on Jul 10, 2023

    @hugh712

    I'm also has this issue in

    • Ubuntu 23.04
    • NVIDIA Corporation TU116 [GeForce GTX 1660 SUPER] [10de:21c4]
    • Kernel 6.2.0-24-generic
    • Nvidia 525.116.04 / 535.54.03
  12. FlorianFranzen commented on Jul 13, 2023

    @FlorianFranzen

    Suspend leads to similar error logs before suspend and a kernel panic while waking up from suspend on my system.
    It is a laptop with an AMD Ryzen 7 5800H and an RTX 3070 Mobile running kernel 6.3.9 and version 535.54.03. I boot with the following flags: nvidia-drm.modeset=1 NVreg_EnableResizableBar=1 nvidia.NVreg_PreserveVideoMemoryAllocations=1 nvidia.NVreg_OpenRmEnableUnsupportedGpus=1

    Before suspend I find the following in the logs:

    NVRM nvAssertFailedNoLog: Assertion failed: 0 @ mem_list.c:293
    NVRM nvAssertOkFailedNoLog: Assertion failed: Call not supported [NV_ERR_NOT_SUPPORTED] (0x00000056) returned from pRmApi->Alloc(pRmApi, pMemoryManager->hClient, pMemoryManager->
    NVRM nvAssertOkFailedNoLog: Assertion failed: Call not supported [NV_ERR_NOT_SUPPORTED] (0x00000056) returned from memdescSendMemDescToGSP(pGpu, pFbsr->pSysMemDesc, &hSysMem) @ >
    NVRM nvAssertOkFailedNoLog: Assertion failed: Call not supported [NV_ERR_NOT_SUPPORTED] (0x00000056) returned from _fbsrInitGsp(pGpu, pFbsr) @ fbsr_gm107.c:548
    

    After suspend I get more error logs and a kernel panic:

    NVRM: GPU at PCI:0000:01:00: GPU-cd48b96b-c536-1a29-44c0-809f5b2531e4
    NVRM: Xid (PCI:0000:01:00): 45, pid=975, name=(udev-worker), Ch 00000000
    NVRM: Xid (PCI:0000:01:00): 45, pid=975, name=(udev-worker), Ch 00000001
    NVRM: Xid (PCI:0000:01:00): 45, pid=3823, name=Renderer, Ch 00000002
    NVRM: Xid (PCI:0000:01:00): 45, pid=3823, name=Renderer, Ch 00000003
    NVRM: Xid (PCI:0000:01:00): 45, pid=3823, name=Renderer, Ch 00000004
    NVRM: Xid (PCI:0000:01:00): 45, pid=3823, name=Renderer, Ch 00000005
    NVRM: Xid (PCI:0000:01:00): 45, pid=3823, name=Renderer, Ch 00000006
    NVRM: Xid (PCI:0000:01:00): 45, pid=3823, name=Renderer, Ch 00000007
    NVRM: Xid (PCI:0000:01:00): 45, pid=2819, name=sway, Ch 00000008
    NVRM: Xid (PCI:0000:01:00): 45, pid=2819, name=sway, Ch 00000009
    NVRM: Xid (PCI:0000:01:00): 45, pid=2819, name=sway, Ch 0000000a
    NVRM: Xid (PCI:0000:01:00): 45, pid=2905, name=Xwayland, Ch 0000000b
    NVRM: Xid (PCI:0000:01:00): 45, pid=2905, name=Xwayland, Ch 0000000c
    ata2: SATA link down (SStatus 0 SControl 300)
    NVRM: Xid (PCI:0000:01:00): 45, pid=2905, name=Xwayland, Ch 0000000d
    NVRM: Xid (PCI:0000:01:00): 45, pid=23536, name=slack, Ch 0000000e
    NVRM: Xid (PCI:0000:01:00): 45, pid=23536, name=slack, Ch 0000000f
    NVRM: Xid (PCI:0000:01:00): 45, pid=23536, name=slack, Ch 00000010
    NVRM kbusVerifyBar2_GM107: MMUTest BAR0 window offset 0x70e000 returned garbage 0x0
    NVRM nvAssertOkFailedNoLog: Assertion failed: Generic memory error [NV_ERR_MEMORY_ERROR] (0x00000072) returned from kbusVerifyBar2_HAL(pGpu, pKernelBus, NULL, NULL, 0, 0) @ kern_bus_gm107.c:457
    NVRM nvAssertOkFailedNoLog: Assertion failed: Generic memory error [NV_ERR_MEMORY_ERROR] (0x00000072) returned from gpuStateLoad(pGpu, IS_GPU_GC6_STATE_EXITING(pGpu) ? GPU_STATE_FLAGS_PRESERVING | GPU_STATE_FL>
    nvidia-modeset: ERROR: GPU:0: Failed to initialize display engine: 0x62 (Reset required [NV_ERR_RESET_REQUIRED])
    NVRM serverFreeResourceTree: hObject 0x10011 not found for client 0xc1d00000
    NVRM rpcRmApiAlloc_GSP: GspRmAlloc failed: hClient=0xc1d00000; hParent=0x00010001; hObject=0x00010011; hClass=0x0000c670; paramsSize=0x00000000; paramsStatus=0x00000062; status=0x00000062
    nvidia-modeset: ERROR: GPU:0: Failed to initialize display engine: 0x62 (Reset required [NV_ERR_RESET_REQUIRED])
    NVRM serverFreeResourceTree: hObject 0x10011 not found for client 0xc1d00000
    BUG: kernel NULL pointer dereference, address: 000000000000026c
    #PF: supervisor read access in kernel mode
    #PF: error_code(0x0000) - not-present page
    PGD 15dde0067 P4D 15dde0067 PUD 1270b5067 PMD 0 
    Oops: 0000 [#1] PREEMPT SMP NOPTI
    CPU: 3 PID: 2819 Comm: sway Tainted: G           O       6.3.9 #1-NixOS
    Hardware name: LENOVO 82N6/LNVNB161216, BIOS GKCN60WW 03/07/2023
    RIP: 0010:nvAssignDefaultUsageBounds+0x94/0x1a0 [nvidia_modeset]
    Code: 43 0c 00 89 43 08 49 8b 84 24 60 0a 00 00 48 8b 80 98 01 00 00 48 85 c0 74 b4 4c 89 e7 e8 24 1a 8f ef ba 04 00 00 00 48 63 ca <8b> 74 c8 08 85 f6 74 5c 48 8d 04 c8 0f b7 48 08 66 89 4b 04 0f b7
    RSP: 0018:ffffaa0c088a74c0 EFLAGS: 00010206
    RAX: 0000000000000244 RBX: ffff9b5c26c5ea58 RCX: 0000000000000004
    RDX: 0000000000000004 RSI: ffff9b5c26c5ea40 RDI: ffff9b5c3a8e0008
    RBP: ffff9b5c3a8e06a0 R08: 0000000000000005 R09: 0000000000000000
    R10: 00000000000006c4 R11: 0000000000000000 R12: ffff9b5c3a8e0008
    R13: ffff9b5c26c5ea40 R14: ffff9b5c26c5ea58 R15: ffff9b5c3a8e07e0
    FS:  00007ff08edc6f80(0000) GS:ffff9b630dcc0000(0000) knlGS:0000000000000000
    CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 000000000000026c CR3: 0000000152924000 CR4: 0000000000750ee0
    PKRU: 55555554
    Call Trace:
     <TASK>
     ? __die+0x23/0x70
     ? page_fault_oops+0x17d/0x4b0
     ? number+0x34a/0x3e0
     ? exc_page_fault+0x6a/0x150
     ? asm_exc_page_fault+0x26/0x30
     ? nvAssignDefaultUsageBounds+0x94/0x1a0 [nvidia_modeset]
     ConstructHwModeTimingsViewPort.constprop.0+0x118/0x160 [nvidia_modeset]
     nvConstructHwModeTimingsEvo+0x344/0x5e0 [nvidia_modeset]
     ? vsnprintf+0x2cb/0x550
     ? nvEvoLogInfoString+0xa0/0xc0 [nvidia_modeset]
     ValidateMode+0x1bb/0x700 [nvidia_modeset]
     ? ValidateMode+0x14f/0x700 [nvidia_modeset]
     nvValidateModeIndex+0x3f8/0x5d0 [nvidia_modeset]
     ? nvValidateModeIndex+0x3ca/0x5d0 [nvidia_modeset]
     ? GetDispAttributeValidValues+0x60/0x60 [nvidia_modeset]
     ValidateModeIndex+0x59/0x70 [nvidia_modeset]
     nvKmsIoctl+0xde/0x220 [nvidia_modeset]
     nvkms_ioctl_from_kapi+0x6b/0xc0 [nvidia_modeset]
     GetDisplayMode+0x71/0x210 [nvidia_modeset]
     nv_drm_connector_get_modes+0x9e/0x150 [nvidia_drm]
     drm_helper_probe_single_connector_modes+0x1a0/0x530 [drm_kms_helper]
     ? drm_atomic_get_property+0xff/0x5f0 [drm]
     drm_mode_getconnector+0x394/0x4a0 [drm]
     ? drm_mode_obj_get_properties_ioctl+0x14a/0x1b0 [drm]
     ? __pfx_drm_mode_getconnector+0x10/0x10 [drm]
     drm_ioctl_kernel+0xcd/0x170 [drm]
     drm_ioctl+0x267/0x4a0 [drm]
     ? __pfx_drm_mode_getconnector+0x10/0x10 [drm]
     __x64_sys_ioctl+0x94/0xd0
     do_syscall_64+0x3e/0x90
     entry_SYSCALL_64_after_hwframe+0x72/0xdc
    RIP: 0033:0x7ff08fe3529f
    Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <89> c2 3d 00 f0 ff ff 77 18 48 8b 44 24 18 64 48 2b 04 25 28 00 00
    RSP: 002b:00007ffc649f08d0 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
    RAX: ffffffffffffffda RBX: 0000000001a42690 RCX: 00007ff08fe3529f
    RDX: 00007ffc649f0970 RSI: 00000000c05064a7 RDI: 000000000000000b
    RBP: 00007ffc649f0970 R08: 0000000000000007 R09: 0000000001693b60
    R10: 7909572cf32bdd3d R11: 0000000000000246 R12: 00000000c05064a7
    R13: 000000000000000b R14: 00000000c05064a7 R15: 00007ffc649f0970
     </TASK>
    Modules linked in: uhid uvcvideo videobuf2_vmalloc uvc videobuf2_memops videobuf2_v4l2 snd_usb_audio videodev snd_usbmidi_lib videobuf2_common snd_rawmidi mc af_packet ctr snd_seq_dummy snd_hrtimer snd_seq snd>
     cfg80211 snd_timer snd_soc_cs35l41_lib ucsi_acpi crc32_pclmul realtek sp5100_tco snd polyval_clmulni ideapad_laptop(O) wdat_wdt typec_ucsi polyval_generic gf128mul cm32181 tpm_crb sparse_keymap mdio_devres nv>
     crct10dif_pclmul crct10dif_common rtc_cmos serio dm_mod dax btrfs blake2b_generic xor libcrc32c crc32c_generic crc32c_intel raid6_pq amdgpu i2c_algo_bit drm_ttm_helper ttm agpgart video wmi iommu_v2 drm_buddy>
    CR2: 000000000000026c
    ---[ end trace 0000000000000000 ]---
    RIP: 0010:nvAssignDefaultUsageBounds+0x94/0x1a0 [nvidia_modeset]
    Code: 43 0c 00 89 43 08 49 8b 84 24 60 0a 00 00 48 8b 80 98 01 00 00 48 85 c0 74 b4 4c 89 e7 e8 24 1a 8f ef ba 04 00 00 00 48 63 ca <8b> 74 c8 08 85 f6 74 5c 48 8d 04 c8 0f b7 48 08 66 89 4b 04 0f b7
    RSP: 0018:ffffaa0c088a74c0 EFLAGS: 00010206
    RAX: 0000000000000244 RBX: ffff9b5c26c5ea58 RCX: 0000000000000004
    RDX: 0000000000000004 RSI: ffff9b5c26c5ea40 RDI: ffff9b5c3a8e0008
    RBP: ffff9b5c3a8e06a0 R08: 0000000000000005 R09: 0000000000000000
    R10: 00000000000006c4 R11: 0000000000000000 R12: ffff9b5c3a8e0008
    R13: ffff9b5c26c5ea40 R14: ffff9b5c26c5ea58 R15: ffff9b5c3a8e07e0
    FS:  00007ff08edc6f80(0000) GS:ffff9b630dcc0000(0000) knlGS:0000000000000000
    CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 000000000000026c CR3: 0000000152924000 CR4: 0000000000750ee0
    PKRU: 55555554
    
  13. added
    NV-Triaged
    on Jul 13, 2023
  14. aritger commented on Jul 13, 2023

    @aritger
    Collaborator

    Thank you for the reports and logs. We understand the issue, and NVIDIA internal bug 4193761 tracks this.

    Unfortunately it will probably be the release cycle after 535.xx, at the earliest, before NVreg_PreserveVideoMemoryAllocations works correctly with the open-gpu-kernel-modules. Sorry, and thanks for your patience.

  15. Longhao-Chen commented on Sep 29, 2023

    @Longhao-Chen

    Is there any progress?

  16. 200 remaining items

  17. veganomy commented on Mar 12, 2026

    @veganomy

    Here's the temporary workaround. Use hibernate instead of sleep. In the cases of hibernate lock up, the swapfile successfully stores all the memory. Hard rebooting can still resume your session.

    Keep the swap size at least equal or greater than your system memory + gpu memory. Mine's 16+8=24GB swap partition.

    mkswap /dev/swap_partition
    swapon /dev/swap_partition
    

    On GNOME :

    gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type 'hibernate'
    gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'hibernate'
    

    Install Power Off Options extension to get hibernation entry in the quick settings. Settings > Power > Power Button Behavior to Hibernate instead of suspend.

  18. aaronp24 commented on Mar 14, 2026

    @aaronp24
    Member

    Sadly NVreg_UseKernelSuspendNotifiers doesn't work on my system. The whole system locks up during suspend, never goes to sleep and pressing the power button again just turns the system off. Here is the log, cannot generate a nvidia bug report because the system locks up.

    The logs indicate that the GSP crashes?

    test.txt (output of sudo journalctl --no-hostname -b -1 | grep NVRM > test.txt)

    That looks like a known interaction problem with SELinux on Fedora. I have a driver change to work around the problem but it requires a corresponding selinux-policy update that hasn't been merged yet. In the meantime, you can disable SELinux, update your local policy based on the AVC messages in the system log, or disable NVreg_UseKernelSuspendNotifiers and go back to the old NVreg_PreserveVideoMemoryAllocations=1 suspend path.

  19. francoism90 commented on Mar 14, 2026

    @francoism90

    @aaronp24 Shouldn't it right to /var/tmp instead?

  20. GA251 commented on Mar 14, 2026

    @GA251

    @aaronp24 Shouldn't it right to /var/tmp instead?

    The new version of the driver appears to save in a anonymous file that is only accessed by the driver, which appears to be broken due to SELinux policies not being configured accordingly.

    @aaronp24 Thanks for the fast response and hoping the graphical corruption after resume Is fixed, can’t wait to test after SELinux is patched to function properly with the new driver.

  21. aaronp24 commented on Mar 14, 2026

    @aaronp24
    Member

    The driver currently defaults to an anonymous file in /tmp. You can change it to /var/tmp or wherever else using the NVreg_TemporaryFilePath= parameter.

    A future driver is planned to switch to using shmem_file_setup by default if NVreg_TemporaryFilePath= isn't specified. That's what the selinux-policy update targets but that change isn't in a released driver yet. I can post it as a patch if that would be helpful, though (e.g. if you want to test the selinux-policy change).

  22. francoism90 commented on Mar 15, 2026

    @francoism90

    @GA251 How is your monitor connected? I'm having the same issue over HDMI, but not over DP.

  23. GA251 commented on Mar 15, 2026

    @GA251

    @GA251 How is your monitor connected? I'm having the same issue over HDMI, but not over DP.

    My display is connected via a DisplayPort.
    The display is a ASUS VG24VQR
    and the graphics card is NVIDIA GeForce RTX™ 3060 12GB
    VRR is on @ 48-120Hz mode, though also happens on 48-165Hz mode

  24. francoism90 commented on Mar 15, 2026

    @francoism90

    @GA251 I don't think they are related, but I have disabled VRR because I'm using it over USB-C to DP. If I do enable it, it causes my screen to turn blank. Over HDMI I don't think it supposed to work, but somehow can be made working.

    I think that's more a bandwidth issue? For now I disabled VRR.

  25. GA251 commented on Mar 15, 2026

    @GA251

    @GA251 I don't think they are related, but I have disabled VRR because I'm using it over USB-C to DP. If I do enable it, it causes my screen to turn blank. Over HDMI I don't think it supposed to work, but somehow can be made working.

    I think that's more a bandwidth issue? For now I disabled VRR.

    I'm not sure on whether its a bandwidth issue because VRR works perfectly fine until the system goes to sleep.
    I have my display plugged into the DP port on the GPU itself.
    Our issues might not even be related in that case.

  26. veldenb commented on Apr 11, 2026

    @veldenb

    Tried suspend on Ubuntu 26.04, but it's broken again using Ubuntu kernel 7.0.0-12-generic and nvidia drivers 595.58.03. Using NVreg_UseKernelSuspendNotifiers=1 or the "old" way with NVreg_PreserveVideoMemoryAllocations=1 and systemd hooks doesn't seem to make a difference. I managed to catch the stacktrace using SSH because after the crash the entire system freezes. Suspend worked fine on Ubuntu 25.10 with kernel 6.16 and nvidia drivers 595.58.03.

    edit: seems to be reported here: #1095
    edit2: It's fixable by adding an extra script to DKMS (#1095 (comment))

    Stack trace from log:

    apr 11 16:58:38 desktop systemd[1]: nvidia-suspend.service: Deactivated successfully.
    apr 11 16:58:38 desktop systemd[1]: Finished nvidia-suspend.service - NVIDIA system suspend actions.
    apr 11 16:58:38 desktop systemd[1]: Starting systemd-suspend.service - System Suspend...
    apr 11 16:58:38 desktop systemd-sleep[15954]: User sessions remain unfrozen on explicit request ($SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=0).
    apr 11 16:58:38 desktop systemd-sleep[15954]: This is not recommended, and might result in unexpected behavior, particularly
    apr 11 16:58:38 desktop systemd-sleep[15954]: in suspend-then-hibernate operations or setups with encrypted home directories.
    apr 11 16:58:38 desktop systemd-sleep[15954]: Performing sleep operation 'suspend'...
    apr 11 16:58:38 desktop kernel: PM: suspend entry (deep)
    apr 11 16:58:38 desktop kernel: Filesystems sync: 0.005 seconds
    apr 11 16:58:38 desktop kernel: jump_label: Fatal kernel bug, unexpected op at nvkms_kthread_q_callback+0x8e/0x1a0 [nvidia_modeset] [0000000079948f46] (e9 9b 00 00 00 != 0f 1f 44 00 00)) size:5 type:1
    apr 11 16:58:38 desktop kernel: fbcon: Taking over console
    apr 11 16:58:38 desktop kernel: ------------[ cut here ]------------
    apr 11 16:58:38 desktop kernel: kernel BUG at arch/x86/kernel/jump_label.c:73!
    apr 11 16:58:38 desktop kernel: Oops: invalid opcode: 0000 [#1] SMP NOPTI
    apr 11 16:58:38 desktop kernel: CPU: 31 UID: 0 PID: 15954 Comm: systemd-sleep Tainted: G        W  O        7.0.0-12-generic #12-Ubuntu PREEMPT(lazy) 
    apr 11 16:58:38 desktop kernel: Tainted: [W]=WARN, [O]=OOT_MODULE
    apr 11 16:58:38 desktop kernel: Hardware name: ASUS System Product Name/ROG CROSSHAIR VIII DARK HERO, BIOS 3801 07/30/2021
    apr 11 16:58:38 desktop kernel: RIP: 0010:__jump_label_patch.cold+0x24/0x26
    apr 11 16:58:38 desktop kernel: Code: f8 e9 44 f7 19 00 48 c7 c3 b8 89 85 a1 41 56 45 89 e1 49 89 d8 4c 89 e9 4c 89 ea 4c 89 ee 48 c7 c7 50 9c 2d a0 e8 44 90 01 00 <0f> 0b 0f b6 f0 48 c7 c7 20 02 e5 a0 88 45 f7 e8 d0 94 bc 00 0f b6
    apr 11 16:58:38 desktop kernel: RSP: 0018:ffffd23cdf0d7af0 EFLAGS: 00010246
    apr 11 16:58:38 desktop kernel: RAX: 00000000000000a8 RBX: ffffffff9fc068ca RCX: 0000000000000000
    apr 11 16:58:38 desktop kernel: RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
    apr 11 16:58:38 desktop kernel: RBP: ffffd23cdf0d7b20 R08: 0000000000000000 R09: 0000000000000000
    apr 11 16:58:38 desktop kernel: R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000005
    apr 11 16:58:38 desktop kernel: R13: ffffffffc06539ae R14: 0000000000000001 R15: 0000000000000000
    apr 11 16:58:38 desktop kernel: FS:  000079247bacac80(0000) GS:ffff8a67ed980000(0000) knlGS:0000000000000000
    apr 11 16:58:38 desktop kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    apr 11 16:58:38 desktop kernel: CR2: 000079247bac6708 CR3: 0000000261b5a000 CR4: 0000000000f50ef0
    apr 11 16:58:38 desktop kernel: PKRU: 55555554
    apr 11 16:58:38 desktop kernel: Call Trace:
    apr 11 16:58:38 desktop kernel:  <TASK>
    apr 11 16:58:38 desktop kernel:  arch_jump_label_transform_queue+0x37/0x90
    apr 11 16:58:38 desktop kernel:  __jump_label_update+0x47/0x100
    apr 11 16:58:38 desktop kernel:  jump_label_update+0x5c/0x110
    apr 11 16:58:38 desktop kernel:  static_key_slow_inc_cpuslocked+0x53/0xa0
    apr 11 16:58:38 desktop kernel:  static_key_slow_inc+0x1f/0x40
    apr 11 16:58:38 desktop kernel:  freeze_processes+0xd1/0xe0
    apr 11 16:58:38 desktop kernel:  enter_state+0xe0/0x610
    apr 11 16:58:38 desktop kernel:  pm_suspend+0x49/0x90
    apr 11 16:58:38 desktop kernel:  state_store+0x2e/0x60
    apr 11 16:58:38 desktop kernel:  kobj_attr_store+0x12/0x40
    apr 11 16:58:38 desktop kernel:  sysfs_kf_write+0x74/0x90
    apr 11 16:58:38 desktop kernel:  kernfs_fop_write_iter+0x161/0x210
    apr 11 16:58:38 desktop kernel:  vfs_write+0x25b/0x490
    apr 11 16:58:38 desktop kernel:  ksys_write+0x71/0xf0
    apr 11 16:58:38 desktop kernel:  __x64_sys_write+0x19/0x30
    apr 11 16:58:38 desktop kernel:  x64_sys_call+0x22f/0x2390
    apr 11 16:58:38 desktop kernel:  do_syscall_64+0x115/0x5a0
    apr 11 16:58:38 desktop kernel:  ? count_memcg_events+0x103/0x250
    apr 11 16:58:38 desktop kernel:  ? handle_mm_fault+0x1c0/0x2e0
    apr 11 16:58:38 desktop kernel:  ? arch_exit_to_user_mode_prepare.isra.0+0xd/0x100
    apr 11 16:58:38 desktop kernel:  ? irqentry_exit+0x97/0x5a0
    apr 11 16:58:38 desktop kernel:  ? exc_page_fault+0x94/0x1e0
    apr 11 16:58:38 desktop kernel:  entry_SYSCALL_64_after_hwframe+0x76/0x7e
    apr 11 16:58:38 desktop kernel: RIP: 0033:0x79247b2a8676
    apr 11 16:58:38 desktop kernel: Code: 47 ba 04 00 00 00 48 8b 05 87 e7 16 00 64 89 10 48 c7 c2 ff ff ff ff c9 48 89 d0 c3 0f 1f 84 00 00 00 00 00 48 8b 45 10 0f 05 <48> 89 c2 48 3d 00 f0 ff ff 77 0f c9 48 89 d0 c3 66 2e 0f 1f 84 00
    apr 11 16:58:38 desktop kernel: RSP: 002b:00007ffe33e99950 EFLAGS: 00000202 ORIG_RAX: 0000000000000001
    apr 11 16:58:38 desktop kernel: RAX: ffffffffffffffda RBX: 000061a325f99010 RCX: 000079247b2a8676
    apr 11 16:58:38 desktop kernel: RDX: 0000000000000004 RSI: 000061a325f9d530 RDI: 0000000000000005
    apr 11 16:58:38 desktop kernel: RBP: 00007ffe33e99960 R08: 0000000000000000 R09: 0000000000000000
    apr 11 16:58:38 desktop kernel: R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000004
    apr 11 16:58:38 desktop kernel: R13: 0000000000000004 R14: 000061a325f9d530 R15: 0000000000000000
    apr 11 16:58:38 desktop kernel:  </TASK>
    apr 11 16:58:38 desktop kernel: Modules linked in: exfat rfcomm btrfs snd_seq_dummy snd_hrtimer libblake2b xor raid6_pq uhid cmac algif_hash algif_skcipher af_alg bnep amd_atl intel_rapl_msr intel_rapl_common snd_hda_codec_alc882 snd_hda_codec_realtek_lib snd_hda_codec_generic snd_hda_codec_nvhdmi snd_hda_codec_hdmi iwlmvm snd_hda_intel snd_hda_codec edac_mce_amd snd_hda_core mac80211 snd_intel_dspcfg snd_intel_sdw_acpi kvm_amd snd_hwdep snd_pcm libarc4 snd_seq_midi kvm btusb snd_seq_midi_event btmtk snd_rawmidi binfmt_misc btrtl mfd_aaeon eeepc_wmi irqbypass btbcm snd_seq iwlwifi asus_wmi igb jc42 ghash_clmulni_intel btintel sparse_keymap snd_seq_device nls_iso8859_1 ee1004 asus_ec_sensors snd_timer bluetooth wmi_bmof rapl platform_profile cfg80211 r8169 dca snd ccp ahci nvidia_uvm(O) i2c_algo_bit i2c_piix4 k10temp soundcore libahci i2c_smbus realtek sch_fq_codel nct6775 nct6775_core msr hwmon_vid ntsync zenergy(O) efi_pstore nfnetlink dmi_sysfs autofs4 dm_crypt input_leds joydev hid_generic usbhid hid nvidia_drm(O) nvidia_modeset(O)
    apr 11 16:58:38 desktop kernel:  nvidia(O) nvme mxm_wmi nvme_core drm_ttm_helper nvme_keyring ttm mac_hid nvme_auth video hkdf wmi aesni_intel
    apr 11 16:58:38 desktop kernel: ---[ end trace 0000000000000000 ]---
    apr 11 16:58:39 desktop kernel: clocksource: Long readout interval, skipping watchdog check: cs_nsec: 1568355332 wd_nsec: 1568354637
    
    Sat Apr 11 17:10:13 2026       
    +-----------------------------------------------------------------------------------------+
    | NVIDIA-SMI 595.58.03              Driver Version: 595.58.03      CUDA Version: 13.2     |
    +-----------------------------------------+------------------------+----------------------+
    | GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
    | Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
    |                                         |                        |               MIG M. |
    |=========================================+========================+======================|
    |   0  NVIDIA GeForce RTX 3080        Off |   00000000:0B:00.0  On |                  N/A |
    |  0%   34C    P5             56W /  320W |     460MiB /  10240MiB |      0%      Default |
    |                                         |                        |                  N/A |
    +-----------------------------------------+------------------------+----------------------+
    
    +-----------------------------------------------------------------------------------------+
    | Processes:                                                                              |
    |  GPU   GI   CI              PID   Type   Process name                        GPU Memory |
    |        ID   ID                                                               Usage      |
    |=========================================================================================|
    |    0   N/A  N/A            1926      G   /usr/bin/gnome-shell                    404MiB |
    |    0   N/A  N/A            2687      G   /usr/bin/Xwayland                         4MiB |
    +-----------------------------------------------------------------------------------------+
    
  27. mirao commented on Jun 14, 2026

    @mirao

    My issue was solved by the driver 595 with options nvidia NVreg_UseKernelSuspendNotifiers=1 in a modprobe config.
    With any driver before 595 I had to use a suspend script pausing Gnome Shell, otherwise the suspend quite often froze. With 595 it's not needed anymore. I'm using it for more than 2 month.

    Tested on Ubuntu 24.04.4 LTS, with kernel 6.17.

  28. mikkorantalainen commented on Jun 28, 2026

    @mikkorantalainen

    The kernel flag NVreg_UseKernelSuspendNotifiers=1 does help a lot with driver version 595 but user mode programs may require additional workarounds. I found out after lot of trial and error that the version of Picom provided by Ubuntu 24.04 LTS hangs after S3 sleep if I use NVreg_UseKernelSuspendNotifiers=1. This results in apparently frozen display and the user may think that the system crashed.

    I built the currently latest code from source code https://github.com/yshui/picom.git and that fixed the issue totally. The tip of the project was commit g6d676824 which also includes NVidia specific fix in the code which is probably worth having, too.

  29. EGmux commented on Aug 30, 2026

    @EGmux

    System Information

    • Kernel: 6.12.0-211.49.1.el10_2.x86_64
    • NVIDIA Driver: 610.57.04
    • CUDA Version: 13.3
    • GPU: NVIDIA GeForce RTX 3060 Laptop (6GB VRAM)

    Workaround Applied

    To resolve suspend failures caused by SELinux blocking the NVIDIA driver's new suspend notifier path (NVreg_UseKernelSuspendNotifiers=1), the driver is now configured to use /var/lib/systemd/sleep as the temporary file directory for preserving GPU memory during suspend.

    This directory was created with the correct SELinux context (systemd_sleep_var_lib_t) to allow systemd_sleep_t to write to it without triggering AVC denials. The modprobe configuration sets NVreg_TemporaryFilePath=/var/lib/systemd/sleep and enables the kernel suspend notifiers. After rebuilding initramfs with dracut --force and rebooting, suspend now works cleanly without locking up the system.

    Status: ✅ Verified working on the above kernel and driver versions.


    Commands Used

    # Create directory
    sudo mkdir -p /var/lib/systemd/sleep
    sudo chmod 0700 /var/lib/systemd/sleep
    
    # Set SELinux context
    sudo semanage fcontext -a -t systemd_sleep_var_lib_t "/var/lib/systemd/sleep(/.*)?"
    sudo restorecon -Rv /var/lib/systemd/sleep
    
    # Configure NVIDIA driver
    sudo tee /etc/modprobe.d/nvidia.conf <<EOF
    options nvidia NVreg_UseKernelSuspendNotifiers=1
    options nvidia NVreg_TemporaryFilePath=/var/lib/systemd/sleep
    EOF
    
    # Rebuild initramfs and reboot
    sudo dracut --force
    sudo reboot
  30. veganomy commented on Sep 20, 2026

    @veganomy

    @EGmux Arch doesn't come with selinux suite so you have to give us some other ways to deal with this.

  31. Organized92 commented on Nov 11, 2026

    @Organized92

    Version 620.70.06 with Kernel 7.3.1 on openSUSE Tumbleweed also has problems with SELinux blocking the suspend procedure

      kernel: PM: suspend entry (deep)
      kernel: NVRM: FBSR: could not reserve space for video memory preservation. Aborting suspend.
      kernel: NVRM: nvidia_suspend returned 0x59; aborting suspend.
      kernel: NVRM: PM suspend notifier failed: 0x59
      kernel: PM: suspend exit
      kernel: PM: suspend entry (s2idle)
      kernel: NVRM: FBSR: could not reserve space for video memory preservation. Aborting suspend.
      kernel: NVRM: nvidia_suspend returned 0x59; aborting suspend.
      kernel: NVRM: PM suspend notifier failed: 0x59
      kernel: PM: suspend exit
      systemd-sleep: Failed to put system to sleep. System resumed again: Operation not permitted
      systemd[1]: Failed to start System Suspend.
    

    Suspend works again as soon as SELinux is set to permissive.
    The problem only occurs with NVreg_UseKernelSuspendNotifiers=1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

NV-Triagedbug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions