You are not logged in.

#1 2023-05-04 04:32:07

Golui
Member
Registered: 2021-11-04
Posts: 3

nvidia-resume from hibernation not working with early KMS enabled

For some time now, when waking from sleep and/or suspend, some windows would be corrupted until redrawn. I have finally decided to investigate this annoyance.

This happens both on latest nvidia drivers (530xx) and the 525xx branch.

I tracked down the Tips_and_tricks#Preserve_video_memory_after_suspend Archwiki page and proceeded to implement it. Looked good! suspend was working flawlessly. It wasn't until a couple of days later that I decided to hibernate my system instead. When the system resumed, it seemed to have failed to load the hibernate image. Sure enough, journalctl confirmed that:

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

When diagnosing the issue, I stumbled upon nvidia-resume not working when recovering from hibernate forum topic, but the solutions did not work for me.

In fact, every resource I could find pointed to everything being set up correctly. What gives?

The cause:

After a few hours of debugging, I managed to track down the issue. It appears that having early KMS (which requires the nvidia module to be in the initramfs) has a bad interaction with PreserveVideoMemoryAllocations being enabled. The early-loaded nvidia driver is configured with the NVreg_PreserveVideoMemoryAllocations=1 parameter (set in /etc/modprobe.d/nvidia.conf), so it attempts to load the state from the hibernation image on its own, but this is done before the

/usr/lib/systemd/system-sleep/nvidia

hook is ran; possibly before the /proc/driver/nvidia/suspend interface exists (did not confirm this is the case) which could cause the above error. I can't immediately find any other nvidia kernel module parameters that would let me control when the resume happens.

Would anyone have any suggestions how to sidestep that issue?

Offline

#2 2023-06-14 19:47:13

Henry78
Member
From: Vienna
Registered: 2012-01-23
Posts: 65

Re: nvidia-resume from hibernation not working with early KMS enabled

@Golui: Did you solve this already? I just finished my journey through various bug trackers and forums to find - as you - every where the same answer about enabling the respective nvidia systemd services and other stuff that's already in the Arch-Wiki, which I followed.

Now I'm thinking of how to circumvent this, but up to now with no good idea.

Offline

#3 2023-07-23 00:33:55

Golui
Member
Registered: 2021-11-04
Posts: 3

Re: nvidia-resume from hibernation not working with early KMS enabled

No, not really, sadly.

Offline

#4 2023-07-31 01:17:33

archnoobbtw
Member
Registered: 2023-07-31
Posts: 1

Re: nvidia-resume from hibernation not working with early KMS enabled

I had the same problem, and you were right about the cause (early KMS). I stopped the early loading, and only used kernal parameter `nvidia_drm.modeset=1`. It can hibernate fine now.

Offline

Board footer

Powered by FluxBB