New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
X11 Crashes on resume from suspend; suspend hangs with black screen #234
Comments
Up.... |
Confirm that. I have installed Gnome (openrc), nvidia-drivers-515.57 (tried also 510.73.05-r1). With gdm and Gnome (wayland) and Gnome (X11):
I didn't find anything in the logs that clearly indicates the reason Sway from git + sddm - the same behavior. Openbox with gdm - the same. Old system with Openbox and sddm - all is OK. I tried suspend with |
I can also confirm that. I am using latest stable gnome desktop with gdm on xorg-21.1.4. Suspending with Would any logs be helpful? |
I have the same issue as avalonwilliams described when I don't use a display manager and start X session with xinit or startx on my NVidia/Intel hybrid laptop. |
Can confirm that the issue only occurs without a display manager. Using lxdm works fine on my machine. |
For me the issue occurs with gdm(not just with no DM). I run elogind 246.10 on (non)guix. Nvidia driver 515.65.01, kernel 5.18.18, gdm and xfce. With HandleNvidiaSleep=no machine suspends fine, but on resume it hangs with the cursor visible on the left top of the screen. With HandleNvidiaSleep=yes it suspends fine, hangs on black screen on resume. No errors are logged at all. If I switch to a text console and use loginctl suspend it suspends and resumes correctly. Then after resume I can switch to xorg again and it works fine. I too tested it with deep sleep with no difference. |
Could you post the output of |
Here my loginctl show-session self. I'm use i3wm:
|
As I suspected, it seems like this bug mostly occurs when elogind has the session Most likely this stems from the suspend code falsely assuming that anything with For now the solution seems like to use LightDM or LXDM, but to use those it seems like you have to run X as root, which kind of defeats half of the purpose of logind. |
I have this issue also on two computers. One is a laptop with an nvidia quadro card and on other is a regular desktop with a 1080 ti. I have two other computers with AMD GPUs running the same version of elogind and the library versions are exactly the same as on the nvidia computers. There I do not have any issues with suspend. As others have mentioned the In sway when I type If I then try to reboot or power off the computer with the I've tried with and without the |
I had quite similar problem but solved it on Artix by editing /lib64/elogind/system-sleep/nvidia
|
Interesting... I have an Optimus Laptop, too, sporting a Nvidia T2000, and hibernate/suspend + wakeup/resum works just fine. Let's investigate this once the next release is at least at rc level. |
I was change like yours, but still not solved. |
Interesting. Can you share your setup? |
Gentoo Linux running openrc+elogind with Plasma/X11, wayland still does not work well with nvidia + external monitors, on a Dell Precision M7550 with 10th gen i7, 64GB RAM, a bunch of 5 external hard drives, video editing needs a lot of space, and a nvidia Quadro T2000 alongside the regular Intel HD. I do neither use a hook script to call Here is what I have configured for Optimus:
Oh! And I also have this in my
I did several suspend-resume-cycles in the last 2 hours while testing v252_rc2, and nvidia-smi still shows 46 entries. What else do you want to know? |
I experience similar issues. For me both suspend and hibernate work if I call nvidia-sleep.sh with a system-sleep script. However when I enable One further issue I noticed when using the nvidia-sleep.sh script is that suspend-then-hibernate does not work perfectly. After coming from hibernation, the vt is not switched back and stays at 63. That is because the nvidia-sleep.sh script is called with hibernate when coming from suspend, which then overwrites the saved vt. Hardcoding the vt value to be 1 breaks the nvidia-sleep.sh script since then we hibernate sometimes while on vt 1 (because resume in the nvidia-sleep script is triggered in a bad moment I guess). This could be fixed if elogind would provide the system-sleep scripts more information what will happen. For example hibernate-after-suspend instead of only hibernate in the case of suspend-then-hibernate. Then one could patch the nvidia script so that it does not switch vts when going from suspend to hibernate. |
Thank You. This seems to only happen when not using the display manager. I really miss suspend being able to work on my laptop again. For a while, i didn't use elogind to suspend my laptop. |
This is deemed to be on hold until the next release is out and the issue can be reproduced with it. |
I'm experiencing the same issue on Guix running Elogind 252.9, Xorg 21.1.4, and Nvidia driver 515.76. I'm using ThinkPad p15 gen 2 with RTX A2000 Mobile. Here is what I discovered after some digging: Somewhere during suspend the system switches to VT 63. For me it happens even when suspending manually using
When the switch happens, Xorg takes action (xf86VTSwitch) and ultimately calls systemd_logind_ack_pause that calls elogin's
When suspending manually that's not a problem and elogind happily sends a response, and VT switch completes successfully:
However, that's not the case when suspending using elogind. When Xorg sends the message, elogind is stuck writing to
I've tried to check whether that's the case by applying a patch that makes elogind write to Full log for the manual suspend: Full log with the patch applied: Full log without the patch: I'd be glad to provide more info |
AWESOME! The patch also seems to fix the suspend issue for me! |
The patch seems to have solved the suspend issues on all nvidia computers I have in the computer lab (I tested 5 of them). All works well now in Xorg and I can suspend in Wayland now as well. However in Wayland I get graphical corruption when resuming from suspend. But I guess this could be solved if the "HandleNvidiaSleep=yes" and "NVreg_PreserveVideoMemoryAllocations=1" was working (which they are not even with the patch sadly). |
experiencing same thing with but I didn't debug what is happening in this process after VT changes |
sys-auth/elogind 246.10-r3, still having this issue with wayland+kde+nvidia. In X11 everything works without any problem |
246.10 is very old, but glad to hear that it works. |
On the contrary, you may have found the root issue! Although elogind is an enhanced version of systemd-logind, the sleep component integrates systemd-sleep. So the correct method, if not forking out another process, would be to start a separate thread, because elogind can not react to dbus messages it sends to itself in the main thread and await an answer from itself, can it? In other words, your idea could finally eradicate these suspend-resume issues pestering us for years. Thank you very much! |
systemd starts individual processes to reboot or suspend a machine, like systemd-sleep for example. Some operations need to communicate with elogind via dbus, which is not possible while elogind is performing the operation by itself. All operations that reboot, poweroff, suspend or hibernate the machine are now forked off, so the operation can communicate with elogind from the outside. Many thanks to @rsauex for coming up with this idea! Bug: #234 Signed-off-by: Sven Eden <sven@eden-worx.com>
The issue should be fixed, but I can not test it properly. I never had any problems with suspend resume loading the module with |
systemd starts individual processes to reboot or suspend a machine, like systemd-sleep for example. Some operations need to communicate with elogind via dbus, which is not possible while elogind is performing the operation by itself. All operations that reboot, poweroff, suspend or hibernate the machine are now forked off, so the operation can communicate with elogind from the outside. Many thanks to @rsauex for coming up with this idea! Bug: #234 Signed-off-by: Sven Eden <sven@eden-worx.com>
Just noting that on Gentoo with elogind 252.9 with a GTX 1060 it is still required to have this script placed in #!/bin/sh
case "${1-}" in
'pre')
/usr/bin/nvidia-sleep.sh suspend
;;
'post')
/usr/bin/nvidia-sleep.sh resume &
;;
*)
exit 1
;;
esac |
I've had a similar issue (for years actually, only today I realized it was related to elogind), and elogind-252.23 works perfectly on 2 of 2 affected machines I have. Thank you! |
I'm running Gentoo with elogind/openrc, and since install (a couple months ago) I've had issues with suspend/resume, since setting up NVIDIA drivers. I'm on an Optimus laptop, (Thinkpad T15g gen 1 with an RTX2070), and have the proprietary drivers.
Depending on the setting of
HandleNvidiaSleep
and/or the presence of a script like the ones posted in #140 I will get two different behaviors. If I haveHandleNvidiaSleep=yes
or in my config or if I have a suspend script that calls nvidia-sleep.sh (or one does chvt and such manually), my system will hang indefinetly with a black screen (backlight is still on, however, and system hasn't yet entered sleep state from what the kernel logs say). However, if I do not have any settings for handling NVIDIA sleep, I get a black screen for around 20-30 seconds, and then it goes to sleep; when my laptop wakes up, my X server segfaults, with the Xorg.0.log showing this:From some debugging/logging done with a hook script, I managed to figure out that the indefinite hanging I experience happens when changing VTs.
These problems occur regardless of the setting of
SuspendMode
(I tried setting it to deep to see if that would help, it didn't), and otherwise I have default configs.I'm on elogind version 246.10-r2, kernel version 5.15.48-gentoo-dist, and NVIDIA driver version 510.73.05-r1, though it should be noted that these issues have persisted across updates of all three of these, as well as updates of X.
No display manager is used, I just run startx in my .profile
Also, manually suspending via
echo mem > /sys/power/state
works fine, as does runningloginctl suspend
from a TTY.Xorg.0.log
emerge --info
outputPossibly related to #140
The text was updated successfully, but these errors were encountered: