Black screen after login about 1/3 of the time, when coming out of sleep

Ubuntu Version:
XUbuntu 24.04 LTS, fully updated

Desktop Environment (if applicable):
XFCE

Problem Description:
When trying to log into the machine after leaving it sit for a while, I successfully get to a graphical login screen and can log in. About 1/3 of the time, however, after logging in, I am brought to a black screen with only a working mouse cursor. I can do nothing on this screen except move the mouse around. Switching to another VT and back does not help. The only way I’ve found to proceed is to switch to another VT and trigger a reboot from the commandline. Unlike this similar problem ( Bug #2089709 “Ubuntu 24.04 sometimes logs in to a black screen i...” : Bugs : mutter package : Ubuntu ), it never happens on boot, only when waking from monitor sleep.

Relevant System Information:
Dell XPS desktop with 11th gen i5. I have an nVidia GTX 3060 video card installed that may or may not play some part in this. I’ve tried many versions of the official drivers for this card. I’m currently using version 580. This machine is also on a KVM, if that matters.

Screenshots or Error Messages:
I’ve never found any error messages that seem to be related to this issue.

What I’ve Tried:
I have found a couple other posts mentioning similar problems, but none of their suggested fixes have worked.

I saw issues similar to what you describe when I updated to Ubuntu Studio 24.04 LTS. Similar black screen on resume from sleep; different in that it happened every time and there wasn’t even a mouse cursor.

Did you try bypassing the script in /usr/bin/nvidia-sleep.sh? From what I can tell this script messes with the VT somehow. You can bypass it by adding “exit 0” as the first non-comment line.

This all worked for me with my old NVidia GeForce GTX 750 with the 535 proprietary driver. The 580 driver was broken in the same way for me and the script bypass trick didn’t work. Hope this helps.

1 Like

Please define “sleep”.
Do you mean suspend, hibernate or just screen off?

1 Like

By sleep, I’m just referring to “screen off”. I have suspend and hibernate disabled.

OK, can’t help there, sorry. What NVidia cards and drivers do is a closed book to me.
But please use the right terms.

I’ve just discovered that the following command, when run from another VT, will successfully restart the desktop without needing a reboot:

sudo systemctl restart lightdm

Everything I had open previously is killed by this command, so it’s only a minor help. Still looking for a true solution so it doesn’t happen in the first place.