App grid animation causes heavy CPU spikes and dropped frames in Wayland & Xorg

Bug #1750197 reported by Luke B.
38
This bug affects 6 people
Affects Status Importance Assigned to Milestone
gnome-shell (Ubuntu)
Fix Released
Medium
Daniel van Vugt
Bionic
Fix Released
Medium
Daniel van Vugt
Cosmic
Fix Released
Medium
Daniel van Vugt
Disco
Fix Released
Medium
Daniel van Vugt

Bug Description

Upstream Issues:
https://gitlab.gnome.org/GNOME/gnome-shell/issues/349
https://gitlab.gnome.org/GNOME/mutter/issues/233

Ubuntu Release: 17.10 and 18.04
gnome-shell version: 3.28.2
System Theme: CommuniTheme

Opening the Applications Overview (App Grid) displays a very janky animation, and my CPU will spike to nearly 90% for each open/close. This happens regardless of using XOrg or Wayland; however Wayland appears to have an overall higher impact on resource usage.

This same issue is still existent, but somewhat less noticeable on my other i5-6400 (GTX 1050) machine. Also, emulating this release in a VM with 2 CPUS and 4096MB of RAM renders it unresponsive for 3-5 seconds after opening/closing the app drawer.

Please do not hesitate to follow up with requests for more info, as I will be happy to help.

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: gnome-shell 3.28.2-0ubuntu0.1
ProcVersionSignature: Ubuntu 4.13.0-32.35-generic 4.13.13
Uname: Linux 4.13.0-32-generic x86_64
ApportVersion: 2.20.7-0ubuntu3.7
Architecture: amd64
CurrentDesktop: ubuntu-communitheme:ubuntu:GNOME
Date: Sat Feb 17 19:13:00 2018
DisplayManager: gdm3
ExecutablePath: /usr/bin/gnome-shell
InstallationDate: Installed on 2018-02-17 (0 days ago)
InstallationMedia: Ubuntu 17.10 "Artful Aardvark" - Release amd64 (20180105.1)
ProcEnviron:
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: gnome-shell
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Luke B. (duke7553) wrote :
Revision history for this message
Luke B. (duke7553) wrote : Re: App Drawer Animation Causes Heavy CPU Spikes in Wayland & XOrg

Upon further investigation, I can confirm that this issue only affects the App Drawer. Minimizing and Maximizing windows, and etc are all buttery smooth.

summary: - GUI Animations Cause Heavy CPU Spikes in Wayland & XOrg
+ App Drawer Animation Causes Heavy CPU Spikes in Wayland & XOrg
Revision history for this message
Gustavo Silva (gsilvapt) wrote :

How about changing screen brightness? The only animation that causes some sluggish behaviors is changing screen brightness (I'm on a laptop). Not sure if this is related or not but worth asking.

Revision history for this message
Luke B. (duke7553) wrote :

Yes, it does. When changing the screen brightness in 17.10, the slider wiggles around rapidly during a slight delay before the brightness actually adjusts.

Revision history for this message
Gustavo Silva (gsilvapt) wrote :

Well, my case is the opposite: The animation is slow but the adjustment is immediate. Thanks!

Luke B. (duke7553)
description: updated
tags: added: performance
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in gnome-shell (Ubuntu):
status: New → Confirmed
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thanks for the bug report. We are aware of this problem and hope to look at it in detail soon.

tags: added: bionic
Changed in mutter (Ubuntu):
status: New → Confirmed
Changed in gnome-shell (Ubuntu):
importance: Undecided → High
Changed in mutter (Ubuntu):
importance: Undecided → High
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I'm now looking at a profile of gnome-shell running normally, next to a profile of the same but with the activities overview open. I can now see at least two causes of the higher CPU (and higher GPU load?) when the overview is open.

Changed in gnome-shell (Ubuntu):
assignee: nobody → Daniel van Vugt (vanvugt)
Changed in mutter (Ubuntu):
assignee: nobody → Daniel van Vugt (vanvugt)
summary: - App Drawer Animation Causes Heavy CPU Spikes in Wayland & XOrg
+ Activities overview causes heavy CPU spikes in Wayland & XOrg
Changed in gnome-shell (Ubuntu):
status: Confirmed → In Progress
Changed in mutter (Ubuntu):
status: Confirmed → In Progress
summary: - Activities overview causes heavy CPU spikes in Wayland & XOrg
+ Activities overview causes heavy CPU spikes in Wayland & Xorg
Revision history for this message
Luke B. (duke7553) wrote : Re: Activities overview causes heavy CPU spikes in Wayland & Xorg

Just to clarify, the app drawer has this problem as well.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Yes, thanks for reminding me. I will also check that when I get back to this work.

Revision history for this message
Luke B. (duke7553) wrote :

Forgive me, but what method did you use to profile the resource usage of gnome-shell? I would like to see if the root cause you discovered matches what affects my system.

Revision history for this message
Luke B. (duke7553) wrote :

What I did was profile gnome-shell using sysprof, and I found that file /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5502.0 uses 25.06% of CPU time by itself. My guess is that it's called/utilized very frequently. Attached is part of the output that should explain what I'm stating.

Let me know if any more information is necessary.

summary: - Activities overview causes heavy CPU spikes in Wayland & Xorg
+ App drawer animation causes heavy CPU spikes in Wayland & Xorg
Changed in gnome-shell (Ubuntu):
assignee: Daniel van Vugt (vanvugt) → nobody
Changed in mutter (Ubuntu):
assignee: Daniel van Vugt (vanvugt) → nobody
Changed in gnome-shell (Ubuntu):
importance: High → Medium
Changed in mutter (Ubuntu):
importance: High → Medium
Changed in gnome-shell (Ubuntu):
status: In Progress → Confirmed
Changed in mutter (Ubuntu):
status: In Progress → Confirmed
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Sorry, I just realised these are indeed two very different bugs.

I am moving to bug 1757088 to focus on the activities overview.

P.S. I also have a patch which should help this bug 1750197 a bit:
https://gitlab.gnome.org/GNOME/mutter/merge_requests/26

P.P.S. Please use only Xorg sessions for now if you need the best performance. Wayland has its own unique performance bottlenecks I will work on later, probably in 18.10:
https://trello.com/c/Q6JYXPPs

Revision history for this message
Daniel van Vugt (vanvugt) wrote :
description: updated
Revision history for this message
Luke B. (duke7553) wrote :

I very much appreciate the work you have done upstream. I have been trying to follow along, but I cannot contribute to this particular issue due to my skillset. Are the upstream changes going to be seen in 18.10 or the existing 18.04 when finalized?

Revision history for this message
Luke B. (duke7553) wrote :

The upstream bugs related to this issue (found up top) have been updated, as work is being done upstream.

description: updated
summary: - App drawer animation causes heavy CPU spikes in Wayland & Xorg
+ App grid animation causes heavy CPU spikes and dropped frames in Wayland
+ & Xorg
Revision history for this message
Daniel van Vugt (vanvugt) wrote :
description: updated
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Please keep this old bug open as this is the one other sources are linking to.

Also, no fix has been released yet so it doesn't matter how old this bug is.

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):
status: Confirmed → In Progress
Changed in mutter (Ubuntu):
status: Confirmed → In Progress
tags: added: cosmic
Revision history for this message
Luke B. (duke7553) wrote :

Not to be nagging, but I can't help but enjoy this upstream fix as it was implemented in other distros like Fedora. Is there an ETA for Ubuntu's implementation?

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Those upstream fixes (https://gitlab.gnome.org/GNOME/gnome-shell/issues/349) were actually authored by Canonical. They will appear in Ubuntu when we ship gnome-shell 3.32 (likely Ubuntu 19.04).

Note however the high CPU (not the animation smoothness) fix (https://gitlab.gnome.org/GNOME/gjs/merge_requests/236) is being backported already, in bug 1803271. In hindsight though I could have used this bug instead...

Also, given how simple the fix for the animation smoothness is (https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/253) then I think yes it would be easy to get that backported to existing Ubuntu releases.

no longer affects: mutter (Ubuntu)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Seems the fix was already backported to gnome-shell 3.30.2, so is in disco already and soon cosmic.

Changed in gnome-shell (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Fix committed to cosmic (see bug 1813350).

Changed in gnome-shell (Ubuntu Cosmic):
status: New → Fix Committed
importance: Undecided → Medium
Changed in gnome-shell (Ubuntu Bionic):
importance: Undecided → Medium
status: New → Triaged
Changed in gnome-shell (Ubuntu Cosmic):
assignee: nobody → Daniel van Vugt (vanvugt)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Fix released as part of...

gnome-shell (3.30.2-0ubuntu1.18.10.1) cosmic; urgency=medium

  [ Iain Lane ]
  * New upstream release 3.30.2 (LP: #1813350)

  [ Marco Trevisan (Treviño) ]
  * d/p/power-Label-the-PENDING_CHARGE-state-as-Not-Charging.patch:
    - Label the PENDING_CHARGE state as "Not Charging" (LP: #1745032)
  * d/p/ibusManager-Don-t-pass-undefined-callback-to-ibus.patch:
    - Fix missing icon in keyboard indicator (LP: #1812266)

 -- Iain Lane <email address hidden> Fri, 25 Jan 2019 19:04:17 +0000

Changed in gnome-shell (Ubuntu Cosmic):
status: Fix Committed → Fix Released
Will Cooke (willcooke)
Changed in gnome-shell (Ubuntu Bionic):
assignee: nobody → Daniel van Vugt (vanvugt)
Changed in gnome-shell (Ubuntu Bionic):
status: Triaged → In Progress
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Found the fix hiding in gnome-shell_3.28.3+git20190124.orig.tar.xz

So it's already in bionic-proposed:

https://launchpad.net/ubuntu/+source/gnome-shell/3.28.3+git20190124-0ubuntu18.04.1

Changed in gnome-shell (Ubuntu Bionic):
status: In Progress → Fix Committed
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

gnome-shell (3.28.3+git20190124-0ubuntu18.04.1) bionic; urgency=medium

  * New git snapshot release up to commit 24cdcc56d (LP: #1811900)
    - Don't fill journal with osdWindow errors (LP: #1772677)
    - Fix missing icon in keyboard indicator (LP: #1812266)
  * d/p/authPrompt-Do-not-enable-sensitivity-if-retries-are-disal.patch,
    d/p/authPrompt-Unset-preemptiveAnswer-on-reset.patch,
    d/p/gdm-util-Always-allow-to-retry-login-in-unlock-mode.patch,
    d/p/ibus-set-content-type-no-holdKeyboard.patch,
    d/p/popupMenu-Don-t-handle-key-presses-directly-if-there-are-.patch,
    d/p/st-button-Ignore-pointer-emulated-touch-events.patch,
    d/p/shell-ignore-invalid-window-monitor-index.patch,
    d/p/workspace-fix-repositioned-windows-in-activities.patch:
    - Removed patches applied upstream
  * d/p/StIcon-only-compute-shadow-pipeline-when-the-texture-is-p.patch,
    d/p/js-fix-invalid-access-errors.patch,
    d/p/js-ui-Choose-some-actors-to-cache-on-the-GPU.patch,
    d/p/optional-hot-corner.patch,
    d/p/st-texture-cache-Cancel-sliced-image-loading-on-target-ac.patch,
    d/p/workaround_crasher_fractional_scaling.patch:
    - Refreshed as per upstream changes
  * d/p/keyboard-Filter-redundant-FocusTracker-position-changed-s.patch,
    d/p/keyboard-Listen-to-IbusPanelService-focus-in-out-to-track.patch:
    - Fix OSK activation on X11 (LP: #1760399)
  * d/p/power-Label-the-PENDING_CHARGE-state-as-Not-Charging.patch:
    - Label the PENDING_CHARGE state as "Not Charging" (LP: #1745032)
  * d/p/debian/patches/volume-Add-back-sound-feedback-on-scroll.patch:
    - Add missing include (LP: #1811908)

 -- Marco Trevisan (Treviño) <email address hidden> Fri, 25 Jan 2019 18:29:40 +0000

Changed in gnome-shell (Ubuntu Bionic):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.