Score:9

Suspend not working properly (cannot wake up) on Ubuntu 20.04 with NVIDIA

cn flag

My problem is that I cannot suspend my computer properly. Technically I can, but when I come back and try to reopen it, it just doesn't work. My screen remains black with a blinking line, like a typical writing line _.

My laptop is a HP Pavilion 15-BC519NS Intel Core i5-9300H/8GB/512GB SSD/GTX 1050/15.6".

Here is the output of lspci:

00:00.0 Host bridge: Intel Corporation 8th Gen Core 4-core Processor Host Bridge/DRAM Registers [Coffee Lake H] (rev 07)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16) (rev 07)
00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 630 (Mobile)
00:04.0 Signal processing controller: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem (rev 07)
00:12.0 Signal processing controller: Intel Corporation Cannon Lake PCH Thermal Controller (rev 10)
00:14.0 USB controller: Intel Corporation Cannon Lake PCH USB 3.1 xHCI Host Controller (rev 10)
00:14.2 RAM memory: Intel Corporation Cannon Lake PCH Shared SRAM (rev 10)
00:16.0 Communication controller: Intel Corporation Cannon Lake PCH HECI Controller (rev 10)
00:17.0 RAID bus controller: Intel Corporation 82801 Mobile SATA Controller [RAID mode] (rev 10)
00:1d.0 PCI bridge: Intel Corporation Cannon Lake PCH PCI Express Root Port #9 (rev f0)
00:1d.5 PCI bridge: Intel Corporation Cannon Lake PCH PCI Express Root Port #14 (rev f0)
00:1d.6 PCI bridge: Intel Corporation Cannon Lake PCH PCI Express Root Port #15 (rev f0)
00:1d.7 PCI bridge: Intel Corporation Cannon Lake PCH PCI Express Root Port #16 (rev f0)
00:1f.0 ISA bridge: Intel Corporation HM470 Chipset LPC/eSPI Controller (rev 10)
00:1f.3 Audio device: Intel Corporation Cannon Lake PCH cAVS (rev 10)
00:1f.4 SMBus: Intel Corporation Cannon Lake PCH SMBus Controller (rev 10)
00:1f.5 Serial bus controller [0c80]: Intel Corporation Cannon Lake PCH SPI Controller (rev 10)
01:00.0 VGA compatible controller: NVIDIA Corporation GP107M [GeForce GTX 1050 3 GB Max-Q] (rev a1)
01:00.1 Audio device: NVIDIA Corporation GP107GL High Definition Audio Controller (rev ff)
02:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller SM981/PM981/PM983
03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)
04:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8822BE 802.11a/b/g/n/ac WiFi adapter
05:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS522A PCI Express Card Reader (rev 01)

I haven't seen a fix for this anywhere, so I was expecting someone to help me here. Thanks in advance!

Nate avatar
cl flag
can you do `alt ->`(that is an alt right) arrow and get to a login? If so I can show you how to restart the gui
Tharteon avatar
cn flag
Hey Nate, i was playing a little bit with suspending, and indeed idk what i did (i guess pressed alt right) and it asked me for my login. Although it didnt let me write anything and also it didnt let me do anything, i seemed like it was frozen.
Ciro Santilli 新疆再教育营六四事件法轮功郝海东 avatar
Ubuntu 21.10 NVIDIA 470/510 `nv_restore_user_channels` bug + workaround: https://askubuntu.com/questions/1032633/18-04-screen-remains-blank-after-wake-up-from-suspend/1391917#1391917
Score:9
ca flag

I suspect that your problem is related to the latest NVIDIA update, which installs nvidia-driver-460. There is currently a bug with this version and some versions after it. You can subscribe to the bug here: https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-460/+bug/1911055

You can workaround the issue until the bug gets resolved by downgrading the NVIDIA driver to a previous version. Follow these steps to downgrade to nvidia-driver-450-server:

  1. Open Software & Updates and go to the Additional Drivers tab.

  2. Select nvidia-driver-450-server (Using NVIDIA Server Driver metapackage from nvidia-driver-450-server (proprietary)).

    Additional Drivers

    You may try other drivers instead of nvidia-driver-450-server, if you wish, and stay with the one that works best for you.

  3. Click Apply Changes and wait until the changes are applied.

  4. Restart your system.

Suspend should now work as expected!

Tharteon avatar
cn flag
Oh shit it worked, thanks!!!!!
Mauricio avatar
in flag
If you want to be aware about how to change it from console, these commands would be useful: `sudo apt purge nvidia-driver-460`, `sudo apt install nvidia-driver-418-server` and reboot (change versions acordingly to your system/choices). More details here: https://linoxide.com/how-to-install-nvidia-driver-on-ubuntu/
ae flag
If some one has this issue with latest `495` drivers. use this suggestions https://gist.github.com/bmcbm/375f14eaa17f88756b4bdbbebbcfd029#gistcomment-3973785
Score:2
za flag

I had the same issue on an Acer Aspire laptop running Ubuntu 20.04 with NVIDIA. I was using the default driver (nvidia-driver-460). I then tried nvidia-driver-450-server and still didn't have any luck. Then I tried nvidia-driver-418-server and it worked.

Additional Drivers tab in Software & Updates

My advice, keep rolling back the driver and testing until you find one that works.

  1. Open Software & Updates -> Additional Drivers tab.
  2. Select nvidia-driver-418-server.
  3. Click Apply Changes.
  4. Reboot system.
  5. Test suspend.
Mauricio avatar
in flag
Have you tried "nvidia-driver-465" which seems newer ?
count_smackula avatar
za flag
Yeah, it doesn't work for me. `nvidia-driver-418-server` is the newest version that seems to work on my system. I have a GEFORCE 940MX video card.
cx flag
Rolling back until you find one that works - what a lousy solution.
Score:1
in flag

Quoted below is my explanation of the problem and answer on the duplicate thread here.

A little background to understand the problem and the redundancy of some of the suggested (working) solutions.

The NVIDIA Linux driver supports the suspend and hibernate power management operations via two different mechanisms:

  1. Kernel driver callback: default mechanism - it is enabled and used without explicit configuration. The kernel driver receives callbacks from the Linux kernel to suspend, hibernate, and to resume each GPU for which a Linux PCI driver was registered.

  2. /proc/driver/nvidia/suspend: Instead of callbacks from the Linux kernel, this mechanism, when used, relies on a system management tool, such as systemd, to issue suspend, hibernate, and resume commands to the NVIDIA kernel driver via the /proc/driver/nvidia/suspend interface. It is still considered experimental, and requires explicit configuration to use.

The cleanest easy solution is to simply disable 2 (if enabled) and let the default mechanism 1 do the work.

Of course, advanced users can choose to fix [2] with explicit and accurate configuration - it is more powerful as this mechanism is designed to remove the limitations of the kernel driver callback mechanism 1. It supports power management with advanced CUDA features (such as UVM), and it is capable of saving and restoring all video memory allocations

Here are the steps for cleanest easy solution (su - access presumed):

  1. Check whether [2] is enabled:

    systemctl status nvidia-suspend nvidia-hibernate nvidia-resume
    

    enter image description here

  2. Alternatively, do:

    journalctl -b | grep suspend
    

    If [2] is being used, you'll see it action explicitly in the logs like:

    COMMAND=/bin/systemctl status nvidia-suspend nvidia-hibernate nvidia-resume
    
  3. Okay, now that you know [2] is in use, let's disable it.:

    systemctl disable nvidia-suspend nvidia-hibernate nvidia-resume
    

    You should see a message stating:

    Removed /etc/systemd/system/systemd-[suspend|hibernate|resume].service.requires/nvidia-[suspend|hibernate|resume].service
    
  4. Now, you can repeat steps 1 or 2 and verify that the service(s) is/are indeed disabled:

    rm /lib/systemd/system-sleep/nvidia
    

I've seen some working but inaccurate solutions like [1, 2, 3], where manual sudo rm /etc/systemd/system/systemd-suspend.service.requires/nvidia-suspend.service is suggested. You should NOT do this.

Some other useful commands for diagnostics:

$ cat /proc/driver/nvidia/version $ nvcc --version

Also Ctrl+Alt+F7 followed by Ctrl+Alt+F1.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.