13

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!

Val
  • 133
  • 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 – Nate Jun 10 '21 at 21:21
  • 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. – Val Jun 11 '21 at 11:31
  • 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 – Ciro Santilli OurBigBook.com Feb 09 '22 at 09:48

4 Answers4

12

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!

  • 1
    Oh shit it worked, thanks!!!!! – Val Jun 11 '21 at 12:34
  • 2
    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/ – Mauricio Jul 02 '21 at 22:19
  • 1
    If some one has this issue with latest 495 drivers. use this suggestions https://gist.github.com/bmcbm/375f14eaa17f88756b4bdbbebbcfd029#gistcomment-3973785 – bicepjai Dec 06 '21 at 00:43
6

FIX for suspend-resume problem - black screen on resume Ubuntu 20.04LTS, 5.13.0, nvidia-drivers 510

Two parts:

  1. Earlier versions of nvidia drivers required support for suspend/resume/hibernate in /etc/systemd/

    These support scripts MUST be removed for nvidia-driver-470 onwards using:

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

    They are NOT automatically removed during driver update and systems with nvidia drivers installed before 470 have them left behind after upgrade. This might be the reason why many people suggest reverting back to 460.

  2. /usr/bin/nvidia-sleep.sh needs to still be deactivated by an immediate exit. Add a line just after the bash header line to cause immediate exit 0 (ie success) from the script:

    #!/bin/bash
    exit 0
    

With those two sets of changes suspend/resume now works correctly for me.

Zanna
  • 70,465
zagglez
  • 61
  • Hmm - this worked for a while then reverted. Back to the black screen again - sigh. – zagglez May 20 '22 at 13:59
  • See also: https://gitlab.freedesktop.org/drm/nouveau/-/issues/49 – detly Jul 17 '22 at 14:44
  • For the 2nd step, if you've disable the /proc/driver/nvidia/suspend route of power management (presumably from step 1), then this is redundant. O.w. the default script should suffice:
    if [ ! -f /proc/driver/nvidia/suspend ]; then
        exit 0
    fi
    ...```
    
    – John Doe Oct 23 '22 at 16:21
5

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.

Here is my Additional Drivers tab in Software & Updates:

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.
2

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.

John Doe
  • 171