22

I have the Nvidia 1080ti graphics card, which is just a few days old. Furthermore, I have a clean installation of Ubuntu 18.04 and the latest nvidia-390 drivers installed, using apt:

~$ sudo dpkg -l  | grep nvidia
ii  libnvidia-cfg1-390:amd64                   390.59-0ubuntu0~gpu18.04.1              amd64        NVIDIA binary OpenGL/GLX configuration library
ii  libnvidia-common-390                       390.59-0ubuntu0~gpu18.04.1              all          Shared files used by the NVIDIA libraries
ii  libnvidia-compute-390:amd64                390.59-0ubuntu0~gpu18.04.1              amd64        NVIDIA libcompute package
ii  libnvidia-compute-390:i386                 390.59-0ubuntu0~gpu18.04.1              i386         NVIDIA libcompute package
ii  libnvidia-decode-390:amd64                 390.59-0ubuntu0~gpu18.04.1              amd64        NVIDIA Video Decoding runtime libraries
ii  libnvidia-decode-390:i386                  390.59-0ubuntu0~gpu18.04.1              i386         NVIDIA Video Decoding runtime libraries
ii  libnvidia-encode-390:amd64                 390.59-0ubuntu0~gpu18.04.1              amd64        NVENC Video Encoding runtime library
ii  libnvidia-encode-390:i386                  390.59-0ubuntu0~gpu18.04.1              i386         NVENC Video Encoding runtime library
ii  libnvidia-fbc1-390:amd64                   390.59-0ubuntu0~gpu18.04.1              amd64        NVIDIA OpenGL-based Framebuffer Capture runtime library
ii  libnvidia-fbc1-390:i386                    390.59-0ubuntu0~gpu18.04.1              i386         NVIDIA OpenGL-based Framebuffer Capture runtime library
ii  libnvidia-gl-390:amd64                     390.59-0ubuntu0~gpu18.04.1              amd64        NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
ii  libnvidia-gl-390:i386                      390.59-0ubuntu0~gpu18.04.1              i386         NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
ii  libnvidia-ifr1-390:amd64                   390.59-0ubuntu0~gpu18.04.1              amd64        NVIDIA OpenGL-based Inband Frame Readback runtime library
ii  libnvidia-ifr1-390:i386                    390.59-0ubuntu0~gpu18.04.1              i386         NVIDIA OpenGL-based Inband Frame Readback runtime library
ii  nvidia-390                                 390.59-0ubuntu0~gpu18.04.1              amd64        Transitional package for nvidia-driver-390
ii  nvidia-compute-utils-390                   390.59-0ubuntu0~gpu18.04.1              amd64        NVIDIA compute utilities
ii  nvidia-dkms-390                            390.59-0ubuntu0~gpu18.04.1              amd64        NVIDIA DKMS package
ii  nvidia-driver-390                          390.59-0ubuntu0~gpu18.04.1              amd64        NVIDIA driver metapackage
ii  nvidia-kernel-common-390                   390.59-0ubuntu0~gpu18.04.1              amd64        Shared files used with the kernel module
ii  nvidia-kernel-source-390                   390.59-0ubuntu0~gpu18.04.1              amd64        NVIDIA kernel source package
ii  nvidia-prime                               0.8.8                                   all          Tools to enable NVIDIA's Prime
ii  nvidia-settings                            396.24-0ubuntu0~gpu18.04.1              amd64        Tool for configuring the NVIDIA graphics driver
ii  nvidia-utils-390                           390.59-0ubuntu0~gpu18.04.1              amd64        NVIDIA driver support binaries
ii  xserver-xorg-video-nvidia-390              390.59-0ubuntu0~gpu18.04.1              amd64        NVIDIA binary Xorg driver

My problem is that every time I am waking my computer from suspend mode my background turns to this noise pattern (I have solid color set):

enter image description here

I think it is worth to mention that I do NOT have any graphical glitches on the login screen (it was sometimes a problem on Ubuntu 16.04). The login screen works perfectly here.

Any ideas how to solve this issue and where it comes from?

Anderson
  • 201
  • 1
  • 14
thedk
  • 321

9 Answers9

17

I'm also having a similar problem. I have a Dell/Alienware box with a GeForce GTX 860M, running Ubuntu 18.04.

When the computer wakes from suspend, I also have the problem with a corrupted desktop background, sometimes, white, or with with color "snow". I can fix the problem with:

dbus-send --type=method_call --dest=org.gnome.Shell /org/gnome/Shell org.gnome.Shell.Eval "string:global.reexec_self()"

I have my account set up to not have a lockscreen on resume, and I think that might be relevant. Lock-on-suspend doesn't seem to matter.

EDIT: I've changed my nvidia driver from 390 to 396, and that didn't fix it. But more interesting, if I use Unity desktop, the problem DOESN'T occur. This points a finger at the Gnome desktop software maybe...

I would love to fix this for real!

Anville
  • 181
16

Another way to work around this problem is to run: AltF2,r,Enter.
This will restart the Gnome desktop.

On some systems, or if you have FnLock off, you may need to run AltFnF2,r,Enter.

  • 1
    Tip: this is equivalent to running the command gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval 'Meta.restart(_("Restarting…"))'. You could add that script to your .bash_profile so it runs on login. (It might not work if your computer doesn't log you out on suspend.) – applemonkey496 Mar 26 '21 at 19:10
9

I have the same problem too running Ubuntu 18.04.1. I have the nvidia GT220, driver version 340.106. The bug was reported here : bugzilla.gnome.org a long time ago.It concerned Gnome 3.14, and Ubuntu 18 is now running Gnone 3.28. It should be fixed. With the Nouveau driver you don't get that issue.

Here's what Nvidia says about it :

Our current software architecture doesn't preserve the contents of FBOs across modeswitches or power events. As a result, our implementation relies on applications re-rendering to their FBOs every frame. This is a fundamental limitation of our design that will be fixed in the future.

Gnome uses FBOs to not have to render the background on every frames. But the content of FBOs are not saved when the computer enter in sleep mode.

nikau6
  • 221
5

I also have this issue. the workaround for me seems to be to use an image as a background instead of using a color.

terry
  • 51
3

This problem still exists up to July 2020. (Using color as Background)

Nvidia Driver Version 440.100, GTX 950 with AMD Ryzen 7, x470 motherboard

Need use Alt+F2, enter R to restart Gnome to solve the issue.

Eliah Kagan
  • 117,780
1

I also had the same problem in Ubuntu 18.04.3 using NVIDIA 390.129. The background showed a noisy image after waking the computer from suspend. I did not find a proper solution but hacked a way to set the proper background running a service when the computer wakes from suspend.

Let's first create the file change_background.sh in /usr/bin:

#!/bin/bash
source /usr/bin/discover_session_bus_address.sh
export GIO_EXTRA_MODULES=/usr/lib/x86_64-linux-gnu/gio/modules/
export DISPLAY=:0.0
gsettings set org.gnome.desktop.background picture-uri 'file:///usr/share/backgrounds/your_pick.jpeg'

Set the path to the picture you want.

We also need to create /usr/bin/discover_session_bus_address.sh and paste the following code courtesy of Adam Ryczkowski. change_background.sh sources the file in order to set the DBUS_SESSION_BUS_ADDRESS environment variable.

#!/bin/bash

# Remember to run this script using the command "source ./filename.sh"

# Search these processes for the session variable 
# (they are run as the current user and have the DBUS session variable set)
compatiblePrograms=( nautilus kdeinit kded4 pulseaudio trackerd )

# Attempt to get a program pid
for index in ${compatiblePrograms[@]}; do
    PID=$(pidof -s ${index})
    if [[ "${PID}" != "" ]]; then
        break
    fi
done
if [[ "${PID}" == "" ]]; then
    echo "Could not detect active login session"
    return 1
fi

QUERY_ENVIRON="$(tr '\0' '\n' < /proc/${PID}/environ | grep "DBUS_SESSION_BUS_ADDRESS" | cut -d "=" -f 2-)"
if [[ "${QUERY_ENVIRON}" != "" ]]; then
    export DBUS_SESSION_BUS_ADDRESS="${QUERY_ENVIRON}"
    echo "Connected to session:"
    echo "DBUS_SESSION_BUS_ADDRESS=${DBUS_SESSION_BUS_ADDRESS}"
else
    echo "Could not find dbus session ID in user environment."
    return 1
fi

return 0

Finally let's create a service file located in /etc/systemd/system named, for example, change_background.service

[Unit]
Description=Change background when waking up from suspend, by Edmundo. 
Before=sleep.target
StopWhenUnneeded=yes

[Service]
Type=oneshot
User=your_username
RemainAfterExit=yes
ExecStop=-/usr/bin/change_background.sh

[Install]
WantedBy=sleep.target

Make sure to give the correct permissions to all the files.

Start the service with:

sudo systemctl enable change_background.service

You can check the status with:

systemctl status change_background.service

I hope that solved your problem, now the background should be set to the picture of your choosing when the computer wakes from suspend.

0

In my case, the problem was solved by switching the GPU driver from proprietary one to the one that came with Ubuntu.

0

I had the same problem too... But I found a great solution.instead of using pre-installed backgrounds un Ubuntu, use something else...add a photo to background in background settings and use it instead...it will work very well without breaking out after suspend

0

I've made an workaround: a systemd service that reloads gnome-shell. It fix both wallpaper and widgets garbled on Gnome after a suspend/resume.

Just create a new service file, /etc/systemd/system/reload-gnome.service, with this:

[Unit]
Description=Reload gnome-shell 
Before=sleep.target
StopWhenUnneeded=yes

[Service] Type=oneshot User=your_username_here # <---------------------- CHANGE HERE! RemainAfterExit=yes ExecStop=-/usr/bin/killall -SIGQUIT gnome-shell

[Install] WantedBy=sleep.target

And enable it on systemd:

sudo systemctl enable reload-gnome.service
sudo systemctl daemon-reload