Bug 1220565 - Nvidia G06 driver prevent suspend/hibernation
Summary: Nvidia G06 driver prevent suspend/hibernation
Status: RESOLVED WONTFIX
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: X11 3rd Party Driver (show other bugs)
Version: Current
Hardware: Other Other
: P3 - Medium : Normal (vote)
Target Milestone: ---
Assignee: Stefan Dirsch
QA Contact: Stefan Dirsch
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-28 13:10 UTC by Axel Braun
Modified: 2024-03-01 08:11 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
log of suspend with lid closed (28.18 KB, text/plain)
2024-02-28 13:10 UTC, Axel Braun
Details
log of systemctl suspend hibernate (76.16 KB, text/plain)
2024-02-28 13:59 UTC, Axel Braun
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Axel Braun 2024-02-28 13:10:21 UTC
Created attachment 873081 [details]
log of suspend with lid closed

I recently switched from G05 to G06 driver using the Nvidia repository.
Suspend by closing the Laptop lid is not working anymore since that.
systemctl suspend as root seems to work.

Find attached a journactl log of the suspend process. Key entry seems to be:

Feb 28 14:01:11 X1E kernel: NVRM: GPU 0000:01: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.
Feb 28 14:01:11 X1E kernel: nvidia 0000:01:00.0: PM: pci_pm_suspend(): nv_pmops_suspend+0x0/0x30 [nvidia] returns -5
Feb 28 14:01:11 X1E kernel: nvidia 0000:01:00.0: PM: dpm_run_callback(): pci_pm_suspend+0x0/0x170 returns -5
Feb 28 14:01:11 X1E kernel: nvidia 0000:01:00.0: PM: failed to suspend async: error -5
Feb 28 14:01:11 X1E kernel: e1000e: EEE TX LPI TIMER: 00000011
Feb 28 14:01:11 X1E kernel: PM: Some devices failed to suspend, or early wake event detected

Is this a bug or anything I can fix from here?
Thanks!
Comment 1 Stefan Dirsch 2024-02-28 13:28:14 UTC
I've added NVreg_PreserveVideoMemoryAllocations option because of Wayland.

-------------------------------------------------------------------
Mon Nov 21 12:30:46 UTC 2022 - Stefan Dirsch <sndirsch@suse.com>

- NVreg_PreserveVideoMemoryAllocations kernel option and enabled
  services nvidia-suspend, nvidia-resume and nvidia-hibernate now
  needed for GNOME Wayland (gdm) since
    commit 51181871e9db716546e9593216220389de0d8b03
    Author: Ray Strode <rstrode@redhat.com>
    Date:   Fri Mar 4 14:11:03 2022 -0500

      data: Disable wayland on nvidia if suspend is broken
Comment 2 Stefan Dirsch 2024-02-28 13:34:21 UTC
And I think the services are enabled and started.
Comment 3 Stefan Dirsch 2024-02-28 13:36:30 UTC
My guess is that for some reason the kernel driver callback is being used instead of /proc/driver/nvidia/suspend interface.
Comment 4 Axel Braun 2024-02-28 13:40:54 UTC
(In reply to Stefan Dirsch from comment #2)
> And I think the services are enabled and started.

X1E:/home/docb # systemctl status nvidia-suspend
○ nvidia-suspend.service - NVIDIA system suspend actions
     Loaded: loaded (/usr/lib/systemd/system/nvidia-suspend.service; enabled; preset: disabled)
     Active: inactive (dead)

Feb 28 11:51:47 X1E systemd[1]: Starting NVIDIA system suspend actions...
Feb 28 11:51:47 X1E suspend[1719]: nvidia-suspend.service
Feb 28 11:51:47 X1E logger[1719]: <13>Feb 28 11:51:47 suspend: nvidia-suspend.service
Feb 28 11:51:47 X1E systemd[1]: nvidia-suspend.service: Deactivated successfully.
Feb 28 11:51:47 X1E systemd[1]: Finished NVIDIA system suspend actions.
Feb 28 13:39:14 X1E systemd[1]: Starting NVIDIA system suspend actions...
Feb 28 13:39:14 X1E suspend[4206]: nvidia-suspend.service
Feb 28 13:39:14 X1E logger[4206]: <13>Feb 28 13:39:14 suspend: nvidia-suspend.service
Feb 28 13:39:14 X1E systemd[1]: nvidia-suspend.service: Deactivated successfully.
Feb 28 13:39:14 X1E systemd[1]: Finished NVIDIA system suspend actions.

X1E:/home/docb # systemctl status nvidia-resume
○ nvidia-resume.service - NVIDIA system resume actions
     Loaded: loaded (/usr/lib/systemd/system/nvidia-resume.service; enabled; preset: disabled)
     Active: inactive (dead)

Feb 28 13:35:45 X1E systemd[1]: Starting NVIDIA system resume actions...
Feb 28 13:35:45 X1E suspend[1839]: nvidia-resume.service
Feb 28 13:35:45 X1E logger[1839]: <13>Feb 28 13:35:45 suspend: nvidia-resume.service
Feb 28 13:35:45 X1E systemd[1]: nvidia-resume.service: Deactivated successfully.
Feb 28 13:35:45 X1E systemd[1]: Finished NVIDIA system resume actions.
Feb 28 13:39:26 X1E systemd[1]: Starting NVIDIA system resume actions...
Feb 28 13:39:26 X1E suspend[4291]: nvidia-resume.service
Feb 28 13:39:26 X1E logger[4291]: <13>Feb 28 13:39:26 suspend: nvidia-resume.service
Feb 28 13:39:26 X1E systemd[1]: nvidia-resume.service: Deactivated successfully.
Feb 28 13:39:26 X1E systemd[1]: Finished NVIDIA system resume actions.

Looks like services are running
Comment 5 Stefan Dirsch 2024-02-28 13:43:07 UTC
Please try with

  systemctl hibernate
  systemctl suspend

Check also README.txt of nvidia driver. Chapter 21.
Comment 6 Axel Braun 2024-02-28 13:59:01 UTC
(In reply to Stefan Dirsch from comment #5)
> Please try with
> 
>   systemctl hibernate
>   systemctl suspend

That seems to work, see attached.
Slight difference to 'before': The LED in the lid is not blinking slowly, as it used to do in suspend mode

> Check also README.txt of nvidia driver. Chapter 21.

Done that, but to be clear, not sure what I should do with it, resp. change.
Comment 7 Axel Braun 2024-02-28 13:59:37 UTC
Created attachment 873083 [details]
log of systemctl suspend  hibernate
Comment 8 Axel Braun 2024-02-28 15:10:55 UTC
As I'm not using wayland, how can I get rid of the parameter?
Comment 9 Stefan Dirsch 2024-02-28 15:26:04 UTC
(In reply to Axel Braun from comment #6)
> (In reply to Stefan Dirsch from comment #5)
> > Please try with
> > 
> >   systemctl hibernate
> >   systemctl suspend
> 
> That seems to work, see attached.
> Slight difference to 'before': The LED in the lid is not blinking slowly, as
> it used to do in suspend mode

Sorry. No idea.

> > Check also README.txt of nvidia driver. Chapter 21.
> 
> Done that, but to be clear, not sure what I should do with it, resp. change.

Well. It says, that you now need to use systemctl to suspend/hibernate. Not sure what happens when you just close the Lid. Maybe it's possible to configure that then this command is executed.
Comment 10 Stefan Dirsch 2024-02-28 15:34:15 UTC
(In reply to Axel Braun from comment #8)
> As I'm not using wayland, how can I get rid of the parameter?

Remove the option from 

  /lib/modprobe.d/50-nvidia-default.conf

Recreate your initrd by running

  dracut --force
Comment 11 Stefan Dirsch 2024-03-01 01:00:00 UTC
I tried to understand how to make sure that

  systemctl hibernate
  systemctl suspend

is being used when needed (in this situation at least), but I simply couldn't.
Asked other collegues as well. If you ever figure out how, please let me know.

BTW, I think the NVreg_PreserveVideoMemoryAllocations option is already needed for gdm login screen running on Wayland, not only for GNOME session.
Comment 12 Axel Braun 2024-03-01 08:11:29 UTC
(In reply to Stefan Dirsch from comment #11)
> I tried to understand how to make sure that
> 
>   systemctl hibernate
>   systemctl suspend
> 
> is being used when needed (in this situation at least), but I simply
> couldn't.
> Asked other collegues as well. If you ever figure out how, please let me
> know.

Suspend/hibernate is defined in KDE Plasma settings. That was untouched since I have set-up this laptop...

> BTW, I think the NVreg_PreserveVideoMemoryAllocations option is already
> needed for gdm login screen running on Wayland, not only for GNOME session.

I have disabled that option, and suspend was working *on the second attempt*, which I cant explain at the moment. So I'll keep monitoring this!