Black screen after suspend and hibernate

Hi,

I’m having a problem whenever I put my laptop to hibernate or suspend. When powering up the laptop again, I see the manufacturer logo for a few seconds and then nothing, black screen.
I am able to switch to a tty and I tried to run startx but it gives me the following error:
xf86EnableIOPorts: failed to set IOPL for I/O (Operation not permitted)

I am using nVidia hybrid prime drivers 450 and Optimus Manager set to auto. Tried to go back at version 440 and delete the free drivers from the MHWD but the problem remains. The kernel was updated yesterday I think but I didn’t check if the problem was also happening on the previous version.

Update: The problem only happens when the nVidia GPU is used with optimus-manager. I guess there is a problem when powering on the GPU again after suspend or hibernate.

Here is my config:
Kernel: 5.8.16-2-MANJARO
CPU: Intel Core i5-7300HQ
Graphics:Device-1: Intel HD Graphics 630
Device-2: NVIDIA GP107M GeForce GTX 1050 Mobile

1 Like

This is not really an error, and can safely be ignore here. There is probably something else in the Xorg log. Run startx -- -keeptty -logverbose 99 and then check the log.

1 Like

Thank you for your answer. Here is the log I got from the command:

https://pastebin.com/zpDTXHpi

I first booted normally using hybrid mode of optimus manager and then from the desktop switched to nVidia and put the laptop to hibernation.

When this happens, please run the following and see what happens:

sudo systemctl isolate multi-user
sudo systemctl isolate graphical

Moreover, have you tried enabling the nvidia-hibernate, nvidia-suspend, nvidia-resume services?

When running the commands I got the LightDM greeter and was able to go back to desktop. I then enabled the services you mentionned as follows:

sudo systemctl enable nvidia-hibernate.service
sudo systemctl enable nvidia-suspend.service
sudo systemclt enable nvidia-resume.service

When resuming from hibernation I still got a black screen

That’s unfortunate, what about suspend?

Same, black screen. I tried running systemctl --all but was unable to find the nvidia services, maybe they are not installed by default?

After reading the nVidia documentation, there is an issue mentioned in the power management section:

On some systems, where the default suspend mode is “s2idle”, the system may not resume properly due to a known timing issue in the kernel. The suspend mode can be verified by reading the contents of the file /sys/power/mem_sleep.
In the interim, the default suspend mode on the affected systems should be set to “deep” using the kernel command line parameter “mem_sleep_default” -

mem_sleep_default=deep

I checked /sys/power/mem_sleep and it’s already set to “deep”.

I’m not sure what might be the problem, for now please disable those nvidia services. When you log in the tty after the black screen, is Xorg running? If Xorg is running, what’s in its log? What does nvidia-smi and DISPLAY=:0 xrandr say (if :0 doesn’t work, try :1, :2, etc.)?

Xorg log: https://pastebin.com/gicZXUD7 (this is Xorg.2.log, I guessed it’s the latest)
nvidia-smi: https://pastebin.com/nvzA8d8k
xrandr: https://pastebin.com/97VjaJjP

Could you ensure you have the REISUB method ready before proceeding to reboot from the black screen.

Then execute:

systemctl suspend

Then please do the following:

journalctl --system --boot=-1 | grep "suspend entry"
journalctl --system --boot=-1 | grep "suspend exit"

then have a look at the begin and end time and post the output of:

journalctl --system --boot=-1 --since "YYYY-MM-DD HH:MM:SS" --until "YYYY-MM-DD HH:MM:SS"

where obviously --since is the datetime of suspend entry and --until is the datetime of suspension exit.

:+1:

I’m not sure if I did it in the good order. My laptop boots into hybrid mode, I switched to nVidia then ran systemctl suspend. From there I did the REISUB method and the commands given. Here is the result:

oct. 22 21:09:18 hp-pavilion15 systemd-sleep[3420]: Suspending system...
oct. 22 21:09:18 hp-pavilion15 kernel: PM: suspend entry (deep)
oct. 22 21:09:18 hp-pavilion15 kernel: Filesystems sync: 0.004 seconds

So no suspend exit.
:thinking:

Can you do a

journalctl --system --boot=-1 --since "YYYY-MM-DD HH:MM:SS"

instead? (I.E. no --until, unless the above is all you’ve got…)

Here it is: https://pastebin.com/kaGd29aP

1 Like

Could you run the following when the black screen occurs:

export DISPLAY=:0
xrandr --setprovideroutputsource modesetting 0x0 && xrandr --setprovideroutputsource modesetting NVIDIA-0 && xrandr --output eDP-1-1 --auto

and see what happens?

oct. 22 21:09:28 hp-pavilion15 kernel: ACPI: EC: interrupt blocked
oct. 22 21:09:28 hp-pavilion15 kernel: ACPI: Preparing to enter system sleep state S3

add kernel parameter pci=acpi

oct. 22 21:09:28 hp-pavilion15 kernel: unchecked MSR access error:

Looks like a kernel bug. :scream: Output of inxi --admin --verbosity=7 --filter --no-host --width, please?

Huh. It does come out of suspend:

oct. 22 21:09:28 hp-pavilion15 kernel: PM: suspend exit

Do @pobrn 's request first!

:innocent:

Furthermore, have you tried what happens if an external monitor is connected?

@pobrn Nothing happened after the commands, I will try connecting to an external screen.

inxi output: https://pastebin.com/txM8xJFu

LightDM only shows up on the external monitor when I start the laptop after suspend and after the login screen the laptop monitor works too

That’s interesting. What happens if you switch to an unused tty, and then immediately switch back to the tty where the X server is running? Aren’t there any i915 errors in journalctl right after resume?

1 Like

I switch to tty2 when the black screen happens, if I switch back to tty1 there is just a blinking cursor there. Should I startx on tty2 and then switch to tty1?