So, when I suspend my laptop, then wake it up later, my laptop does turn on, I'm able to, for example, turn up and down the volume with audio confirmation using the kepboard, but my screen remains black and doesn't show anything until after I restart my laptop.
17 Answers
It is the buggy nouveau driver again. That's what solved the issue for me.
Edit the file /etc/default/grub (using Vi editor -- some users have not been able to save after editing in Vi and have had to use the alternate "Ex" editing mode, which substitutes sudo edit below, then Alt+:w and :x for the save and exit commands).
$ sudoedit /etc/default/grub
Add nouveau.modeset=0 to the line that says GRUB_CMDLINE_LINUX.
GRUB_CMDLINE_LINUX="nouveau.modeset=0"
Then press CtrlO then Enter to save the file and CtrlX to leave Editor.
Run
$ sudo update-grub
Now reboot.
- 469
That seems graphics card driver problem.
Try Ctrl + Alt + F3 then Ctrl + Alt + F2 (might be F7) this might turn on display.
But it's temporary solution.
You may want to persistent solution then you can try to upgrade or change your graphics driver or try @cascagrossa's grub settings solution.
- 889
Ubuntu 21.10+ NVIDIA 470/510 nv_restore_user_channels bug
This started happening to me as soon as I moved to Ubuntu 21.10 on my Lenovo ThinkPad P51 NVIDIA Quadro M1200, and based on kernel traces, it is this exact bug: https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-510/+bug/1946303 My duplicated investigation: https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-510/+bug/1953674
To reproduce the problem easily, I had to disconnect the power cable from my laptop and be on battery only. Otherwise, the problem would only happen sometimes, and more commonly after suspending for a few hours.
Workarounds:
option 1: the bug report links to https://forums.developer.nvidia.com/t/fixed-suspend-resume-issues-with-the-driver-version-470/187150/3 from heroic user humblebee which has workaround:
sudo systemctl stop nvidia-suspend.service sudo systemctl stop nvidia-hibernate.service sudo systemctl stop nvidia-resume.servicesudo 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.
In case you nuke it, the contents of
nvidia.bakare:#!/bin/shcase "$1" in post) /usr/bin/nvidia-sleep.sh "resume" ;; esac
That post gives their root cause:
the 470 driver migrated to systemd method while previous versions relied on Kernel Driver Callback. Apparently this is broken on some setups and kernels.
option 2: give up acceleration and PURGE EVERYTHING FROM NVIDIA: uninstall all nvidia packages (
dpkg -l | grep -i nvidia,sudo apt uninstall), and purge their configs as well (sudo apt purge ...). The config purging is fundamental, because as seen on Option 1), the configs are a key root cause of the issue.Note that even non graphic stuff like NVIDIA's CUDA/OpenCL package was still breaking things, notably I couldn't suspend after removing the graphics but keeping them, related: Ubuntu 18.04.2 immediately wakes up from suspend
option 3: ditch Nvidia and get yourself and AMD GPU in case you don't care about CUDA. Why did I ever buy a laptop with a discrete GPU? I played with CUDA like 10 times over 5 years. Just rent an Nvidia GPU on AWS if playing with CUDA very occasionally is your use case.
It is easy to know if you've hit the same bug or not, just look for the following stack traces on your dmesg.
Because you are likely shutting down the computer and restarting, you have to look for them in the dmesg of the previous boot as per How to find previous boot log after Ubuntu 16.04+ restarts? :
journalctl -b-1
The traces are:
WARNING: CPU: 0 PID: 18016 at /var/lib/dkms/nvidia/510.47.03/build/nvidia/nv.c:3935 nv_restore_user_channels+0xce/0xe0 [nvidia]
Call Trace:
<TASK>
nv_set_system_power_state+0x22b/0x3e0 [nvidia]
nv_procfs_write_suspend+0xe9/0x140 [nvidia]
proc_reg_write+0x5a/0x90
? __cond_resched+0x1a/0x50
vfs_write+0xc3/0x250
ksys_write+0x67/0xe0
__x64_sys_write+0x19/0x20
do_syscall_64+0x61/0xb0
? exit_to_user_mode_prepare+0x37/0xb0
? syscall_exit_to_user_mode+0x27/0x50
? __x64_sys_newfstatat+0x1c/0x20
? do_syscall_64+0x6e/0xb0
? syscall_exit_to_user_mode+0x27/0x50
? do_syscall_64+0x6e/0xb0
? asm_exc_page_fault+0x8/0x30
entry_SYSCALL_64_after_hwframe+0x44/0xae
WARNING: CPU: 0 PID: 18016 at /var/lib/dkms/nvidia/510.47.03/build/nvidia/nv.c:4152 nv_set_system_power_state+0x2d0/0x3e0 [nvidia]
nv_procfs_write_suspend+0xe9/0x140 [nvidia]
proc_reg_write+0x5a/0x90
? __cond_resched+0x1a/0x50
vfs_write+0xc3/0x250
ksys_write+0x67/0xe0
__x64_sys_write+0x19/0x20
do_syscall_64+0x61/0xb0
? exit_to_user_mode_prepare+0x37/0xb0
? syscall_exit_to_user_mode+0x27/0x50
? __x64_sys_newfstatat+0x1c/0x20
? do_syscall_64+0x6e/0xb0
? syscall_exit_to_user_mode+0x27/0x50
? do_syscall_64+0x6e/0xb0
? asm_exc_page_fault+0x8/0x30
entry_SYSCALL_64_after_hwframe+0x44/0xae
I was also seeing the following ACPI error:
ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.LPCB.EC.HKEY.DEVT.PEGS], AE_NOT_FOUND (20210331/psargs-330)
No Local Variables are initialized for Method [DEVT]
Initialized Arguments for Method [DEVT]: (1 arguments defined for method invocation)
Arg0: 00000000fe968048 <Obj> Integer 00000000000000D3
ACPI Error: Aborting method _SB.PCI0.LPCB.EC.HKEY.DEVT due to previous error (AE_NOT_FOUND) (20210331/psparse-529)
Related:
- Ubuntu 21.10 resume produces blank screen
- Suspend not working: Ubuntu 20.04 (does not work at all) / 21.10(in battery mode does not work )
- Suspend not working properly (cannot wake up) on Ubuntu 20.04 with NVIDIA
- Ubuntu 21.04 won't wake from sleep
- Getting suspend to work on Ubuntu (21.10 - impish release)?
- https://superuser.com/questions/1699286/ubuntu-21-10-suspension-problems
- https://www.youtube.com/watch?v=_36yNWw_07g
- https://itsfoss.community/t/ubuntu-21-10-not-reawakening-from-sleep/7782
- 31,312
If on Ubuntu 22.04.2, or any Ubuntu OS using Wayland
See my answer here: Wayland window manager causes my computer to stay on a black/blank screen and not wake up. I present 3 fixes there, in detail, so check them out first.
I've also started documenting these types of issues and fixes on my personal website, so I can keep track of them, since I need them myself every time I upgrade to the latest version of Ubuntu: Common ways to fix video driver (and related) issues in Linux Ubuntu.
Last resort: do the kernel interrupt soft reboot process before doing a hard reboot
Remember: before you hold down the power button to hard reboot, you can always soft reboot with this funky sequence:
Hold down Ctrl + Alt + PrScr, then press the following keys one-at-a-time while holding those first 3 keys down the whole time: R, E, I, S, U, B.
Note that on some (many?) laptops/keyboards,the PrScr button may require your Function key, Fn, to activate it, so you may have to hold down Ctrl + Alt + PrScr + Fn instead, while typing the REISUB reboot key sequence.
I don't remember where I learned this, but I read it from someone else years ago on Ask Ubuntu or SuperUser somewhere. The last key, "B", stands for 'B'oot. So, when you press that key your computer will restart.
Keep this in mind for any Linux problem. Only do a hard reboot if this soft reboot sequence first fails.
A few final thoughts
- If you have a Yubikey plugged in, unplug it! It enumerates itself as a USB keyboard to your computer and may have a "jammed key" or otherwise interfere with your computer's normal operation. I make a USB keyboard device called the "Computa Pranksta" and sometimes have a similar problem.
- You may have a hardware problem, as I once had on my computer here. To test this, boot into your BIOS/UEFI boot menu and choose to run a full hardware diagnostics test suite, assuming your computer has such an option from the factory. It may reveal bad RAM, a bad motherboard, or something else.
- This answer by @Vijay Prema looks promising, but unfortunately I don't have the BIOS password on the computer I'm having problems on, so I can't change the BIOS settings to find out.
- 11,502
- 14
- 97
- 142
Here is what fixed this issue for me on Kubuntu 20.04 Intel NUC PC (NUC8i7HVK), which has Intel HD graphics + embedded Radeon RX Vega M GH:
I went into UEFI BIOS settings and enabled PCIe ASPM (Active State Power Management). I left some other settings such as "Native ACPI OS PCIe" disabled
This is very easy to test so give it a shot and see if it helps.
- 526
Option 1 of Ciro Santilli's answer helped me when I was using Kubuntu 22.04, but when I upgraded to 24.04, problem returned and nothing helped, including all other answers.
What helped me with 24.04 is installing latest Nvidia driver with ppa. Here is what I did:
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update
Check which versions are available
sudo apt list | grep nvidia-driver
Install latest beta at the moment
sudo apt install nvidia-driver-565
sudo reboot
It's been 3 weeks without issues right now.
- 141
i fixed it by changing Graphics BIOS configuration: Advanced -> Built-In Device Options -> Graphics, then switched from Hybrid Graphics to UMA Graphics. (on an HP laptop)
- 21
For me worked:
sudo nano /etc/default/grub
And edit:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX="persistent"
- 151
Sorry if what I'm saying is weird (I'm using the google translator). In my case, I am using an Asus Vivobook S15. After desperately searching, I accidentally gave the solution (in my case) and I wanted to share it. What I did was install the Unity Desktop:
$ sudo apt install ubuntu-unity-desktop
And although it seems absurd, it began to work, almost magically. I hope this information is useful for someone. A greeting!
- 11
I've found that simply pressing the function ("Fn") key wakes the screen up when all else fails. All else being other random key-resses.
- 593
I tried all the answers given in this post, none of them helped me(changed drivers, updated drivers, edited /etc/default/grub, changed display manager, made more swap, spent some hours, prayed to laptop).
I then finally gave up & thought to enable hibernate mode, while enabling that I ran
cat /sys/power/state
Which gave me
disabled
Then I felt it is due to UEFI boot mode in BIOS. Made that option to legacy support which enabled another option Boot priority, let this be default as UEFI First.
After this I am able to resume the system after suspend.
cat /sys/power/state
now gives more options which has suspend.
This was done on Legion Y540 (GTX 1650 with Nvidia drivers - 418 (no IGPU) /Ubuntu 20 LTS/ Kernel 5.4/ latest BIOS as of date)
P.S. Windows never had any problem resuming from sleep.
- 354
- 1
- 4
- 15
For KDE / Kubuntu:
Along with changing volume, I could also see the mouse cursor and was able to move it around in the black background(screen). Because of the black "screen", I was not able to login/logout or perform a graceful shutdown or restart.Previously, killing plasmashell or Xorg from tty, would fix the issue, however this resulted in loss of open applications/windows and unsaved buffer data (like text in Kate etc.)
I finally figured out that I could kill kscreenlocker instead. To do the same.
ctrl + alt + f2pkill -9 kscreenlocker_gorpkill -9 kscreenlocker_greetctrl + alt + f1
Now, the kscreenlocker_greet should have restarted, allowing user login!
Note: This solution is restricted to KDE users only, however it doesn't require changing drivers/display settings, as suggested by above answers.
Cheers!
- 101
- 4
Probably the equivalent of someone pressing buttons to see if it fixes their problems, but looks like adding the persistent keyword to the GRUB_CMDLINE_LINUX_DEFAULT line did the trick for me.
What used to happen is every time I would lock my screen, it turned off my monitor.
After adding the persistent keyword to the GRUB_CMDLINE_LINUX_DEFAULT line of the /etc/default/grub file and running sudo update-grub, my screen no longer turns off after locking.
Nowadays, I can come back and enter my password to login and continue my work like a pro without having to do the ALT + F1, F2, F3 key combination that some of you may have gotten used to!
THANKS persistent KEYWORD IN MY GRUB_CMDLINE_LINUX_DEFAULT LINE! (and also megashake)
Here's a sample of my /etc/default/grub file.
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'
GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=menu
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=lsb_release -i -s 2> /dev/null || echo Debian
GRUB_CMDLINE_LINUX_DEFAULT="vga=0 rdblacklist=nouveau nouveau.modeset=0 acpi_osi=Linux persistent"
GRUB_CMDLINE_LINUX=""
Uncomment to enable BadRAM filtering, modify to suit your needs
This works with Linux (no patch required) and with any kernel that obtains
the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console
The resolution used on graphical terminal
note that you can use only modes which your graphic card supports via VBE
you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE=1024x768
Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true
Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"
Uncomment to get a beep at grub start
GRUB_INIT_TUNE="480 440 1"
#GRUB_DISABLE_OS_PROBER=false
- 119
- Bring pointer[ arrow ] to the bottom of screen
- Hold down left click bar which locate below touchpad of laptop then push arrow toward to center of screen which move the screen up and you will see the blank bar on the bottom of screen then click it .... It works for me every time....Good luck...
This seems to work for me (as a temporary solution).
Device: HP 245 G5
OS: Xubuntu 18.04
When your screen is blank, this sequence of actions seems to do the trick:
(wait 5 seconds)
CTRL + ALT + F2 (wait a second)
CTRL + ALT + F3 (wait a second)
CTRL + ALT + F7 (wait a second)
ESC (wait a second)
ENTER (3 times XD)
Close your laptop (wait 5 seconds).
Open back your laptop.
And the terrific blank screen is gone.
- Just try to change the boot mode to UEFI in bios.
- I too encountered the same problem in my lenovo laptop.
- Just changed the boot mode and i am running it flawlessly
- 9
