4

After upgrading from Ubuntu 20.10 to 21.10 (via 21.04, which I didn't test for suspend/resume behaviour), suspend/resume no longer works properly.

If I use the proprietary NVIDIA driver metapackage from nvidia-driver-470, the system seems to suspend ok -- using the power button (equivalent to systemctl suspend) --, but on resume, the display stays black and I have to power off to escape this.

(If I use the X.Org X Server driver, the system fails to suspend after temporarily turning off the display.)

Previously, on 20.10, suspend/resume worked ok. IIRC, I was using a proprietary NVIDIA driver.

The graphics card is a GK106GL [Quadro K4000] (codename NVE6) and the PC is a Dell Precision T5500. inxi -G output:

Graphics:  Device-1: NVIDIA GK106GL [Quadro K4000] driver: nvidia v: 470.74 
           Device-2: SHENZHEN EMEET HD Webcam eMeet C960 type: USB driver: hid-generic,snd-usb-audio,usbhid,uvcvideo 
           Display: x11 server: X.Org 1.20.13 driver: loaded: nvidia unloaded: fbdev,modesetting,nouveau,vesa 
           resolution: 2560x1440~60Hz 
           OpenGL: renderer: Quadro K4000/PCIe/SSE2 v: 4.6.0 NVIDIA 470.74

I followed some instructions for debugging kernel suspend, noting that pm-suspend (part of pm-utils) recreates the same restore failure as above, and found the following in dmesg output:

[    1.322162] PM:   Magic number: 0:486:890
[    1.322167] PM:   hash matches drivers/base/power/main.c:905
[    1.322237] pci 0000:00:1f.3: hash matches

lspci showed:

00:1f.3 SMBus: Intel Corporation 82801JI (ICH10 Family) SMBus Controller

Searching for "smbus 82801ji" led me to Kernel driver i2c-i801. The source code for this driver included a fix for a resume bug. The latest kernel with the fix is 5.15-rc7.

After installing the 5.15-rc7 kernel using these instructions, restore still fails after systemctl suspend. However resume works ok after sudo pm-suspend. On 5.13, resume fails after sudo pm-suspend.

(I also tried editing /etc/systemd/sleep.conf to see if more restricted suspend options helped, but they didn't.)

glyn
  • 59

7 Answers7

1

My two cents...

Using ubuntu 20.04.1, I configured Settings -> Power -> Power Button Action to Hibernate. That didn't work well, producing a blank screen.

So I configured a Settings -> Keyboard Shortcuts -> Custom Shortcuts with a command systemctl hibernate. This works perfectly.

At the time I was having the issue I read quite a few references. I do not recall now all the information I gathered, and how I came to the conclusion my solution would be better (or simply trial and error). Imprecise the information as it may be, you might find it useful, transferring whatever you find here for hibernation to suspension.

Otherwise, simply ignore it.

0

I had the same problem after upgrade to 21.10. Graphics card GTX 970. Driver 470.74

I installed server driver 450. With this suspend is not working. Back to 470 driver. Now the system resumes.

mario
  • 21
0

A solution, of sorts, appears to be to use the X.Org X server (Nouveau display driver from xserver-xorg-video-nouveau) and delete some left-over symlinks as described in this nvidia suspend bug:

sudo rm /etc/systemd/system/systemd-hibernate.service.requires/nvidia-resume.service
sudo rm /etc/systemd/system/systemd-hibernate.service.requires/nvidia-hibernate.service
sudo rm /etc/systemd/system/systemd-suspend.service.requires/nvidia-resume.service
sudo rm /etc/systemd/system/systemd-suspend.service.requires/nvidia-suspend.service

If the above doesn't work in every case, a workaround seems to be to install the 5.15-rc7 kernel and suspend using sudo pm-suspend, although this may have some downsides.

To do this, I bound /bin/sh -c "sudo pm-suspend" to a key (the "Pause" key, "Shift"+"Break", seemed appropriate) and added the following line to the end of /etc/sudoers:

%yourusername ALL = NOPASSWD: /usr/sbin/pm-suspend

E.g.

%glyn ALL = NOPASSWD: /usr/sbin/pm-suspend

This seems to work ok. On just one occasion while using a terminal the file system containing my home directory spontaneously became read-only and needed a reboot to recover from. It is not clear whether this was a side-effect of pm-suspend, a problem in the 5.15-rc7 kernel, or something else.

glyn
  • 59
0

On a Legion 5 Pro 16ACH6 (Ryzen 5800H + RTX 3050 Ti) I have installed latest kernel(5.15) and I am using the on-board AMD GPU. Because I want to take advantages of the latest improvements for AMD, and because NVidia driver is not yet compatible with 5.15 kernel.

My issue was:
When I wake from suspend the external screen is black. My workaround is

  • Ctrl+Alt+F1, to access tty1 console,then
  • Ctrl+Alt+F7 to switch back to the tty7/where's the Xserver running

This way the external monitor comes back to life.

zx485
  • 2,865
razvang
  • 101
  • 1
0

Ubuntu 21.10 NVIDIA 470/510 nv_restore_user_channels bug

Full details at: 18.04 Screen remains blank after wake up from suspend but TLDR if you see:

nv_restore_user_channels

on:

journalctl -b-1

try running:

sudo systemctl stop nvidia-suspend.service
sudo systemctl stop nvidia-hibernate.service
sudo systemctl stop nvidia-resume.service

sudo systemctl disable nvidia-suspend.service sudo systemctl disable nvidia-hibernate.service sudo systemctl disable nvidia-resume.service

sudo mv /lib/systemd/system-sleep/nvidia ~/nvidia.bak

and reboot.

0

I also had the same problem with Ubuntu 21.10, but my graphic card is Amd Radeon instead. I just installed mainline to upgrade kernel to 5.15.22, because I had 5.13.0. This fixed the error, I can lock and unlock the screen and shows again login window without problem. I wonder why only some devices present that problem.

mainline link: https://github.com/bkw777/mainline

thanks.

apolinux
  • 381
-1

This seems to have fixed the "resume after hibernation" issue in 22.04 as well. Resume was working fine in 20.04, for years, however right after the upgrade to 22.04 a few days ago, resume from hibernation was no longer working if the hibernation lasted for more than an hour or so. On occasion the system would just not start, other times it would start but display the initram terminal and require an fsck on the filesystem/root disk (which was scary). After this change, all testing so far as been successful (both long hibernation and short hibernation seem to work fine), nvidia drivers/opencl acceleration still works after waking up etc. My setup is more complex than average because I am running full disk encryption, including swap. Before reading this post I was starting to regret the upgrade to 22.04 :)

Ari
  • 143