Ubuntu 24.04 Wayland Gnome 46 SLEEP Problem

Ubuntu Version: 24.04.2
Desktop Environment : Gnome 46 Wayland, Nvidia driver 570.124.06
Problem Description:
On my laptop, I use 3 configurations for screens:

  • only the built-in screen when I don’t connect external display
  • Work: only HDMI and Display Port for 2 external displays (built-in screen is off)
  • Home: - only Display Port for 2 external displays chained (built-in screen is off)

I finally found a way to have the sleep mode functioning using the last Nvidia driver 570 and Wayland when I don’t change monitors configuration.

But the problem is this one: if I connect external monitors, the built-in display is off. When I put the laptop in sleep mode and I remove the external monitors before resume the laptop, the built-in display is off with no possibility to be able to enable this display. It seems that it’s the same when I change from Work configuration to Home configuration;

Describe what you’re trying to do and what’s happening instead
Put the laptop in sleep mode with external monitors connected and be able to resume even if the configuration of the monitors change (only built-in monitor or other external monitors).

Relevant System Information
Laptop Asus GL502vsk, Intel 7700hq, Nvidia GTX1070

What I’ve Tried:
I tried to use a service to save the monitors configuration in a temporary file before sleep: it works. But I use xrandr to get information (which is working under Wayland) but it’s not working in the service I launch after resume;
Many other commandswere tested. For example, I use this one to switch on the built-in display from a terminal and it’s working during my Wayland session but it’s not working in my resume service:
gdbus call --session --dest=org.gnome.Mutter.DisplayConfig --object-path /org/gnome/Mutter/DisplayConfig --method org.gnome.Mutter.DisplayConfig.ApplyMonitorsConfig 3 1 “[(0, 0, 1, 0, true, [(‘eDP-1’, ‘1920x1080@120.114’, )] )]” “

  • other commands tested:
    • kscreen-doctor: not working on Wayland + Gnome 46
    • wlr-randr : not working
    • ddcutils: not working
    • nvidia-settings --assign “eDP-1: 1920x1080_60”: not working
    • loginctl + ydotool: not working
    • systemctl restart gdm: not working in resume service
    • gnome-shell --replace & : not working in resume service
    • tried to modify ~/.config/monitors.xml during resume service: not working.

Comments
It seems that many people have problems with Nvidia + Sleep Mode. Maybe harder with Wayland. All the solutions I found were tested, maybe the options of the command were not appropriate. I hope someone has a solution, because it’s difficult to lost each day my session due to this problem of sleep mode.

Thanks for reply

Many users have reported issues with NVIDIA graphics cards and sleep mode on Linux systems. Common problems include the system failing to wake up properly, experiencing a black screen, or freezing upon resume. Here are some of the reported issues and solutions:

  • Black Screen on Resume: Some users have experienced a black screen when resuming from sleep, particularly with specific NVIDIA drivers and hardware configurations. One solution involves modifying the kernel parameters to include acpi_osi=! "acpi_osi=Windows 2009" or a similar version-specific string. This can be done by editing the /etc/default/grub file and running sudo update-grub afterward.

  • System Freezes: Another common issue is the system freezing or becoming unresponsive after resuming from sleep. This can be mitigated by ensuring that the nvidia-suspend.service, nvidia-resume.service, and nvidia-hibernate.service are enabled using systemctl. However, even with these services enabled, some users still experience issues.

  • Overheating: In some cases, the GPU overheats during 3D rendering, leading to the system entering a power-saving mode or failing to resume properly. Users have reported temperatures reaching 93°C, which can cause the system to shut down or freeze. Ensuring proper ventilation and cleaning the GPU can help mitigate this issue.

  • Conflicting Configuration Files: Some users have found that conflicting configuration files can cause sleep issues. Removing unused packages marked with rc using sudo apt-get purge $(dpkg -l | awk '/^rc/ { print $2 }') can sometimes resolve the problem.

  • USB Devices: Disabling USB devices that might wake the system can also help. Users can check and disable these devices by setting the power/wakeup attribute to disabled in /sys/bus/usb/devices/usb*/power/wakeup.

These solutions have helped various users, but the effectiveness can vary depending on the specific hardware and driver versions. If the issue persists, it may be helpful to consult the NVIDIA forums or the Arch Linux forums for more detailed and hardware-specific solutions.

All the above is most likly a repeat of what you already have discovered.

Even if I unload the nVidia-driver the problem remains, and Nvidia has no real interest in fixing yet.

Just a rather clumsy idea for a work around: can you switch to built-in-display always just before your system is going to sleep? Perhaps on waking up you need to check actively for external connected displays and switch again …

Hi,
Some news: I found where is the problem. Nvidia installs a service with the geforce driver for sleep/hibernate/resume. This service launch this file: /usr/bin/nvidia-sleep.sh
In this file, the part for resume is this one:
resume)
echo “$1” > /proc/driver/nvidia/suspend
RestoreVT
exit 0

RestoreVT is a function. Here the beginning:
RestoreVT() {
#
# Check if Xorg was determined to be running at the time
# of suspend, and whether its VT was recorded. If so,
# attempt to switch back to this VT.
#

It’s talking about Xorg, but I’m using Wayland. And even with X11, this function doesn’t rescan the monitors configuration, but only restore the last one during resume.

I continue to look at solutions.

Hi,
Very good idea.

I add 2 lines in the beginning of the part suspend|hibernate) in file /usr/bin/nvidia-sleep.sh
The first line is very long, the second one is just to sleep 2 seconds.

gdbus call --session --dest=org.gnome.Mutter.DisplayConfig --object-path /org/gnome/Mutter/DisplayConfig --method org.gnome.Mutter.DisplayConfig.ApplyMonitorsConfig 3 1 “[(0, 0, 1, 0, true, [(‘eDP-1’, ‘1920x1080@120.114’, )] )]” “
sleep 2

I installed this this morning and tested it multiple times. It seems working.

Thank you very much Gerhard @g-schick

I will give news if something goes wrong.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.