[nvidia] Corrupted wallpaper after resuming from suspend or hibernation

Bug #1809407 reported by Kevin McMurtrie on 2018-12-21
370
This bug affects 65 people
Affects Status Importance Assigned to Milestone
GNOME Shell
Unknown
Unknown
mutter (Ubuntu)
Status tracked in Eoan
Bionic
Undecided
Daniel van Vugt
Disco
Undecided
Daniel van Vugt
Eoan
High
Daniel van Vugt

Bug Description

https://trello.com/c/i5hENxSO

Every other wake from sleep presents a corrupted screen with no unlock app. There's a dock and system menu on a black background with pixel garbage. Some personal information in the dock's large window thumbnails. Bitmap garbage flashes on the screen when interacting with anything. Only workaround is doing another sleep-wake cycle.

ProblemType: Bug
DistroRelease: Ubuntu 18.10
Package: xorg 1:7.7+19ubuntu8
ProcVersionSignature: Ubuntu 4.18.0-12.13-generic 4.18.17
Uname: Linux 4.18.0-12-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
.proc.driver.nvidia.gpus.0000.4b.00.0: Error: [Errno 21] Is a directory: '/proc/driver/nvidia/gpus/0000:4b:00.0'
.proc.driver.nvidia.registry: Binary: ""
.proc.driver.nvidia.version:
 NVRM version: NVIDIA UNIX x86_64 Kernel Module 390.87 Tue Aug 21 12:33:05 PDT 2018
 GCC version: gcc version 8.2.0 (Ubuntu 8.2.0-7ubuntu1)
ApportVersion: 2.20.10-0ubuntu13.1
Architecture: amd64
BootLog: Error: [Errno 13] Permission denied: '/var/log/boot.log'
CompizPlugins: No value set for `/apps/compiz-1/general/screen0/options/active_plugins'
CompositorRunning: None
CurrentDesktop: ubuntu:GNOME
Date: Thu Dec 20 22:19:29 2018
DistUpgraded: 2018-12-01 23:07:50,385 ERROR got error from PostInstallScript ./xorg_fix_proprietary.py (g-exec-error-quark: Failed to execute child process “./xorg_fix_proprietary.py” (No such file or directory) (8))
DistroCodename: cosmic
DistroVariant: ubuntu
DkmsStatus:
 nvidia, 390.87, 4.18.0-11-generic, x86_64: installed
 nvidia, 390.87, 4.18.0-12-generic, x86_64: installed
 virtualbox, 5.2.18, 4.18.0-11-generic, x86_64: installed
 virtualbox, 5.2.18, 4.18.0-12-generic, x86_64: installed
ExtraDebuggingInterest: Yes, if not too technical
GraphicsCard:
 NVIDIA Corporation GP106 [GeForce GTX 1060 3GB] [10de:1c02] (rev a1) (prog-if 00 [VGA controller])
   Subsystem: eVga.com. Corp. GP106 [GeForce GTX 1060 3GB] [3842:6162]
InstallationDate: Installed on 2018-10-28 (54 days ago)
InstallationMedia: Ubuntu 18.04.1 LTS "Bionic Beaver" - Release amd64 (20180725)
MachineType: Gigabyte Technology Co., Ltd. Default string
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-4.18.0-12-generic root=UUID=a8c839e7-c579-4699-999a-748f804ff9e0 ro quiet splash vt.handoff=1
SourcePackage: xorg
Symptom: display
UpgradeStatus: Upgraded to cosmic on 2018-12-02 (18 days ago)
dmi.bios.date: 06/08/2017
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: F24
dmi.board.asset.tag: Default string
dmi.board.name: X99P-SLI-CF
dmi.board.vendor: Gigabyte Technology Co., Ltd.
dmi.board.version: x.x
dmi.chassis.asset.tag: Default string
dmi.chassis.type: 3
dmi.chassis.vendor: Default string
dmi.chassis.version: Default string
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvrF24:bd06/08/2017:svnGigabyteTechnologyCo.,Ltd.:pnDefaultstring:pvrDefaultstring:rvnGigabyteTechnologyCo.,Ltd.:rnX99P-SLI-CF:rvrx.x:cvnDefaultstring:ct3:cvrDefaultstring:
dmi.product.family: Default string
dmi.product.name: Default string
dmi.product.sku: Default string
dmi.product.version: Default string
dmi.sys.vendor: Gigabyte Technology Co., Ltd.
version.compiz: compiz N/A
version.libdrm2: libdrm2 2.4.95-1
version.libgl1-mesa-dri: libgl1-mesa-dri 18.2.2-0ubuntu1
version.libgl1-mesa-glx: libgl1-mesa-glx 18.2.2-0ubuntu1
version.nvidia-graphics-drivers: nvidia-graphics-drivers-* N/A
version.xserver-xorg-core: xserver-xorg-core 2:1.20.1-3ubuntu2.1
version.xserver-xorg-input-evdev: xserver-xorg-input-evdev N/A
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:18.1.0-1
version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.99.917+git20171229-1ubuntu1
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:1.0.15-3

Related branches

Daniel van Vugt (vanvugt) wrote :

This sounds like a combination of bug 1769383 and something else. Can you please provide a photo of the issue so we can figure out what the second part is?

affects: xorg (Ubuntu) → gnome-shell (Ubuntu)
Changed in gnome-shell (Ubuntu):
status: New → Incomplete
tags: added: nvidia
Changed in gdm3 (Ubuntu):
status: New → Incomplete
summary: - No unlock screen
+ [nvidia] Lock screen is a black background with pixel garbage. Bitmap
+ garbage flashes on the screen when interacting with anything.
summary: - [nvidia] Lock screen is a black background with pixel garbage. Bitmap
- garbage flashes on the screen when interacting with anything.
+ [nvidia] After resume the unlock screen is a black background with pixel
+ garbage. Bitmap garbage flashes on the screen when interacting with
+ anything.
tags: added: resume suspend-resume

I did some random trial and error debugging.

There's always a login screen on console 1 and there's always a desktop GUI on console 2. It's sometimes waking from sleep into display 2 while still locked. There's a dock, a system menu, and random bitmap garbage. Hitting CTRL-ALT-F1 goes to the login screen. After logging in, it jumps to a normally working display 2.

Not sure if it's related: CTRL-ALT-fkey is sometimes generating app keyboard events rather than switching consoles.

Installing 18.04 completely corrupted my system and I had wipe the disk. This isn't an old crusty installation.

Launchpad Janitor (janitor) wrote :

[Expired for gdm3 (Ubuntu) because there has been no activity for 60 days.]

Changed in gdm3 (Ubuntu):
status: Incomplete → Expired
Launchpad Janitor (janitor) wrote :

[Expired for gnome-shell (Ubuntu) because there has been no activity for 60 days.]

Changed in gnome-shell (Ubuntu):
status: Incomplete → Expired
Changed in gdm3 (Ubuntu):
status: Expired → New
Changed in gnome-shell (Ubuntu):
status: Expired → New
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gdm3 (Ubuntu):
status: New → Confirmed
Changed in gnome-shell (Ubuntu):
status: New → Confirmed
Changed in nvidia-graphics-drivers-390 (Ubuntu):
status: New → Confirmed
Changed in nvidia-graphics-drivers-418 (Ubuntu):
status: New → Confirmed
no longer affects: gdm3 (Ubuntu)
Changed in mutter (Ubuntu):
status: New → Confirmed
tags: added: disco

Hi Daniel, I've seen you marked my bug as this duplicate, but for me this doesn't happen on Ubuntu 18.10, only after the 19.04 upgrade

Daniel van Vugt (vanvugt) wrote :

That's OK. This bug is tagged 'disco' meaning it also occurs in 19.04.

Okay, it's fine anyway I tested 18.10 again as well with another distribution with roughly the same packages and I was not able to reproduce the issue

I'll try Debian testing

Hi, in debian testing this does not happen, neither in debian unstable or other distros with the same gnome-shell package version

I confirm it's a regression from 18.10 to 19.04

In 18.10 it works fine

summary: - [nvidia] After resume the unlock screen is a black background with pixel
- garbage. Bitmap garbage flashes on the screen when interacting with
- anything.
+ [nvidia] Corrupted wallpaper after resuming from sleep
summary: - [nvidia] Corrupted wallpaper after resuming from sleep
+ [nvidia] Corrupted wallpaper after resuming from suspend
tags: added: xenial

Hmm, actually, if the problem did get worse or more common in 19.04 then we should use bug 1822179 instead.

Certainly after July [1], Ubuntu 18.10 won't be relevant any more.

[1] https://wiki.ubuntu.com/Releases

Ryan Ward (ryandward) wrote :

Just chiming in from Arch Linux, we got it too.

Jeremy Soller (jackpot51) wrote :

There is an upstream bug related to GNOME 3.32 here: https://gitlab.gnome.org/GNOME/gnome-shell/issues/1084

Jeremy Soller (jackpot51) wrote :

I was able to work around this with the attached patch. Apply by adding the file to debian/patches and its name to the end of debian/patches/series

Changed in gnome-shell:
status: Unknown → New

The attachment "nvidia-background-workaround.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Ghanshyam (gparvind) wrote :

I got this bug too after upgrading to 19.04 release with nvidia driver 418.
I see the corruption in lock screen and desktop background.

Additionally, if VS Code is open, terminal window in the vs code becomes blank. This used to happen in 18.10 as well. Not sure if it's related but just as additional info if it helps.

no longer affects: nvidia-graphics-drivers-390 (Ubuntu)
no longer affects: nvidia-graphics-drivers-418 (Ubuntu)
Changed in gnome-shell (Ubuntu):
importance: Undecided → High
Changed in mutter (Ubuntu):
importance: Undecided → High
Changed in gnome-shell (Ubuntu):
status: Confirmed → Triaged
Changed in mutter (Ubuntu):
status: Confirmed → Triaged
Daniel van Vugt (vanvugt) wrote :

Also in Trello: https://trello.com/c/i5hENxSO

Though all conversations really for now should occur upstream: https://gitlab.gnome.org/GNOME/gnome-shell/issues/1084

description: updated
tags: added: eoan
tags: added: rls-ee-incoming
Gwolf2u (gwolf2u-website) wrote :

What I've made a temp fix is this
place file in /lib/systemd/system-sleep
credits to: Paul Knopf (https://gitlab.gnome.org/GNOME/gnome-shell/issues/1084)

file content:
#!/bin/bash
#place file in /lib/systemd/system-sleep

PROGNAME=$(basename "$0")
state=$1
action=$2

function log {
    logger -i -t "$PROGNAME" "$*"
}

log "Running $action $state"

if [[ $state == post ]]; then
    log "WAKE UP"
    #gsettings set org.gnome.desktop.background picture-uri "file:///usr/share/backgrounds/Xplo_by_Hugo_Cliff.png"
    dbus-send --type=method_call --dest=org.gnome.Shell /org/gnome/Shell org.gnome.Shell.Eval "string:global.reexec_self()"
fi

I added @gwolf2u-website patch as /lib/systemd/system-sleep/nvidia.sh and changed permissions to a+w. The problem persists

If I run `dbus-send --type=method_call --dest=org.gnome.Shell /org/gnome/Shell org.gnome.Shell.Eval "string:global.reexec_self()"` manually, gnome restarts (faster) but all my windows are shown in the same virtual-desktop. If I switch screens (ctr+alt+up or down), windows return to their original desktop

Sorry... chmod a+x (I haven't got my coffee yet)

I've just tested adding the

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

command to the /lib/systemd/system-sleep/nvidia.sh file, and it didn't work neither.

Sebastien Bacher (seb128) wrote :

Daniel, you seem to have a looked at that/pinged Jonas, I'm assigning to you

Changed in gnome-shell (Ubuntu):
assignee: nobody → Daniel van Vugt (vanvugt)
Changed in mutter (Ubuntu):
assignee: nobody → Daniel van Vugt (vanvugt)
Changed in gnome-shell (Ubuntu Disco):
assignee: nobody → Daniel van Vugt (vanvugt)
Changed in mutter (Ubuntu Disco):
assignee: nobody → Daniel van Vugt (vanvugt)
tags: removed: rls-ee-incoming
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gnome-shell (Ubuntu Disco):
status: New → Confirmed
Changed in mutter (Ubuntu Disco):
status: New → Confirmed

Tried to resume, and was greeted with this (attached photo).

It then threw me back to the display manager (lightdm?) where I had to enter password, then the mutter/window manager's unlock screen opened and I had to enter password again. No crash this time but very odd behaviour

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gnome-shell (Ubuntu Bionic):
status: New → Confirmed
Changed in mutter (Ubuntu Bionic):
status: New → Confirmed

Here's a video of a typical loop. It's still sometimes possible to type my password and press Enter to get out of this.

This is after a wake from sleep.

Daniel van Vugt (vanvugt) wrote :

Petter,

Sorry, I may have prematurely marked bug 1828358 as a duplicate of this one. It's not any more. Please continue using bug 1828358 instead.

Changed in gnome-shell (Ubuntu Bionic):
assignee: nobody → Daniel van Vugt (vanvugt)
Changed in mutter (Ubuntu Bionic):
assignee: nobody → Daniel van Vugt (vanvugt)
Changed in mutter (Ubuntu Eoan):
status: Triaged → In Progress
kanna kamui (kannalo) wrote :

I dont think this issue is exclusive to ubuntu I get the same thing on arch using gnome https://imgur.com/a/ILOLikj

Daniel van Vugt (vanvugt) wrote :

It's a general problem with the Nvidia driver. A fix is on the way here:
https://gitlab.gnome.org/GNOME/mutter/merge_requests/600

no longer affects: gnome-shell (Ubuntu)
no longer affects: gnome-shell (Ubuntu Bionic)
no longer affects: gnome-shell (Ubuntu Disco)
no longer affects: gnome-shell (Ubuntu Eoan)
Daniel van Vugt (vanvugt) wrote :

Since this is a potentially large set of fixes required (in the long term), I am explicitly only aiming to fix the background wallpaper corruption in this bug. If anyone finds other things corrupt upon resuming from suspend then please open additional bugs for those.

Will this be fixed for disco as well?

Aleksandar Palic (codepushr) wrote :

I'm also interested in this, will it be fixed for 19.04 too?

Daniel van Vugt (vanvugt) wrote :

The Ubuntu release process requires that we always get the fix into the _next_ release first. That means 19.10. After that we are free to propose it for 19.04 and earlier. I have nominated 19.10, 19.04 and 18.04 at the top of this bug.

summary: - [nvidia] Corrupted wallpaper after resuming from suspend
+ [nvidia] Corrupted wallpaper after resuming from suspend or hibernation
satmandu (satadru-umich) wrote :

I fixed the workaround script mentioned above here:

https://gist.github.com/satmandu/2f2da70a7a6bbbacdba01ef8fb8c18f4

This "works" on my system.

(dbus-send doesn't get the right info to work unless you give it the info of the logged in user, which "machinectl shell" can do.)

Hopefully the fix gets merged soon and I can stop using this ugly hack. :)

#!/bin/bash
# Place file in /lib/systemd/system-sleep/
# Run chmod +x on the file.
# This works around the wallpaper corruption on resume from suspend with Nvidia GPUs
# reported at https://gitlab.gnome.org/GNOME/gnome-shell/issues/1084
# and due to this feature of the Nvidia driver:
# https://www.khronos.org/registry/OpenGL/extensions/NV/NV_robustness_video_memory_purge.txt
# Adapted from Paul Knopf (https://gitlab.gnome.org/GNOME/gnome-shell/issues/1084)
# and via https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/1809407/comments/22
# Note that this does show the user's screen when coming out of sleep briefly.
# machinectl can be found in the systemd-container package on Ubuntu.

PROGNAME=$(/usr/bin/basename "$0")
state=$1
action=$2

function log {
    /usr/bin/logger -i -t "$PROGNAME" "$*"
}

log "Running $action $state"
if [[ $state == post ]]; then
    log "WAKE UP"
    pid_Gnome=($(/usr/bin/pgrep gnome-session))
    pid_Gnome=("${pid_Gnome[@]%%:*}")
    command="/usr/bin/dbus-send --type=method_call --dest=org.gnome.Shell /org/gnome/Shell org.gnome.Shell.Eval "string:global.reexec_self\(\)""
        for i in "${pid_Gnome[@]}"
    do
        user=$(/bin/ps -o user= -p $i)
        log $i $user
        if [ "$user" != "gdm" ]; then
            log "machinectl shell $user@.host $command"
            /bin/machinectl shell $user@.host $command
        fi
    done
fi
exit 0

Daniel van Vugt (vanvugt) wrote :

The formal fix is awaiting review;

  https://gitlab.gnome.org/GNOME/mutter/merge_requests/600

but you can download it as a patch:

  https://gitlab.gnome.org/GNOME/mutter/merge_requests/600.patch

slimbook (slimbook) wrote :

Hello,
A few weeks ago we fixed this bug with this script:

https://slimbook.es/tutoriales/linux/422-fixing-the-broken-desktop-after-resuming-from-a-suspension-in-gnome

I hope it helps someone.

Daniel van Vugt (vanvugt) wrote :

The official fix landed upstream last night. It is fixed in mutter version 3.33.4 and later.

Francisco Lopes (oblita) wrote :

@vanvugt can this fix be backported to gnome-3-32 branch? I just talked to the package maintainer in Arch repos and they said 3.33.4 is odd numbered, hence not a stable release, so we would have to wait for 3.34, but given how this is affecting many people I wished it sooner rather than later. They said they track 3.32, so if it gets backported, the package registry will pick it.

Changed in gnome-shell:
importance: Unknown → Undecided
importance: Undecided → Unknown
status: New → Unknown
Daniel van Vugt (vanvugt) wrote :

I want to give the fix time to settle, because the number of sub-fixes required seemed to change between the 3.33 source and 3.32. And aside from that, we are required to get the fix into 19.10 first.

So I will probably wait for this fix to enter 19.10 via mutter 3.34.0 (when it is ready). And then will assess backports to 3.32.

tags: removed: cosmic
WinEunuchs2Unix (ricklee518) wrote :

I have three screens:

1) nVidia GTX 970M HDMI port of laptop. 1920x1080
2) USB-C, Thunderbolt III HDMI dongle. 3840x2160
3) Laptop eDP1 (i7 6700HQ, HD 530 iGPU). 1920x1080

Upon resume the 3840x2160 screen's wallpaper is **OK**.

The two 1920x1080 screens wallpaper is all white.

Ubuntu 16.04.6 LTS upgrade direct to 19.04 w/kernel 5.0.0-23 yesterday.

Diego (diego-giglio) wrote :

Sorry for inconvenient Daniel, but the version 3.33.4 was rejected in review?

Daniel van Vugt (vanvugt) wrote :

The fix for this bug is in mutter version 3.33.4, which will eventually reach Ubuntu version 19.10, and then maybe others after that.

Nothing has been rejected.

To post a comment you must log in.