Without a reason gnome-shell CPU usage gets high

Bug #1974054 reported by Islam
44
This bug affects 9 people
Affects Status Importance Assigned to Milestone
gnome-shell (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

Without a reason, CPU usage for gnome-shell jumps from 4% to 22%.
All I did this normal workflow, locking/unlocking multiple times over few hours and couple of suspends.

The screenshot is showing 37% because of the screenshot tool, but idling at 22%.
And if I re-logged or reboot, it idles at 4% normally.

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: gnome-shell 42.0-2ubuntu1
ProcVersionSignature: Ubuntu 5.15.0-30.31-generic 5.15.30
Uname: Linux 5.15.0-30-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.11-0ubuntu82.1
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Wed May 18 17:24:38 2022
DisplayManager: gdm3
ExecutablePath: /usr/bin/gnome-shell
GsettingsChanges:

InstallationDate: Installed on 2022-02-03 (103 days ago)
InstallationMedia: Ubuntu 21.10 "Impish Indri" - Release amd64 (20211012)
RelatedPackageVersions: mutter-common 42.0-3ubuntu2
SourcePackage: gnome-shell
UpgradeStatus: Upgraded to jammy on 2022-04-21 (26 days ago)

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

Thanks for the bug report. Please:

1. Open the Extensions app and ensure only the three Ubuntu extensions are enabled. No others.

2. Remove any locally-installed extensions:

   cd ~/.local/share/gnome-shell/
   rm -rf extensions

   and log in again.

3. Check to see if you have anything constantly changing on the screen. Make sure you don't have any performance indicators/graphs running, or web browsers open, when the problem occurs.

Changed in gnome-shell (Ubuntu):
status: New → Incomplete
tags: added: performance
Revision history for this message
Islam (islam) wrote :

I have no manually installed extensions and I also removed the above extensions dir too.

When I launch extension-manager (also cheese FYI) I get:
[3254489.563] wl_display@1.delete_id([3254489.568] wl_display@1.error(nil, 7, "failed to import supplied dmabufs: Arguments are inconsistent (for example, a valid context requires buffers not supplied by a ")
42)
Gdk-Message: 12:22:58.093: Error flushing display: Protocol error

Kindly note that the Brave browser is taking just 0.7%, there is nothing changing on the screen; and also when it happened, I closed all opened apps and CPU usage for gnome-shell was the same.

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

The "Protocol error" is bug 1965563.

There's a debug feature you can enable to check for sure how much of the screen is changing: Add CLUTTER_PAINT=damage-region to /etc/environment. It will show you what if anything is causing gnome-shell to keep redrawing.

Revision history for this message
Islam (islam) wrote :

This issue still happening and I enabled the above variable, gnome-shell wasn't blinking on any window up normally, I mean only when I perform an action it blinks that window until the event finish.

But CPU usage still idles at 20%.

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

Next time the high CPU of gnome-shell occurs, please run:

  journalctl -b0 > journal.txt

and attach the resulting text file here.

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

Thanks. The last messages in that log from ubuntu-appindicators may be related as it has caused bugs like this before.

Please:

1. sudo apt install gnome-shell-extension-prefs
2. Open the Extensions app
3. Disable Ubuntu AppIndicators
4. Log in again

If that doesn't solve it then maybe also try disabling the other extensions in the same way.

Revision history for this message
Islam (islam) wrote :

Is there a way to run the extensions app on Wayland or must switch to Xorg?

$ gnome-extensions-app
Gdk-Message: 09:49:57.059: Error flushing display: Protocol error

$ extension-manager
Gdk-Message: 09:50:09.674: Error 71 (Protocol error) dispatching to Wayland display.

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

That's bug 1965563... But yes you can just run:

  gsettings set org.gnome.shell disabled-extensions "['<email address hidden>']"

or a list of extensions like:

  gsettings set org.gnome.shell disabled-extensions "['<email address hidden>', '<email address hidden>']"

where the names are from /usr/share/gnome-shell/extensions/

Revision history for this message
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
Revision history for this message
Jorge Sivil (jorgesivil) wrote :

I had the same problem, and my computer graphics felt slow (i.e the side bar opening animation).
I had fixed this by messing with the nvidia drivers, using prime-select to select nvidia, etc.
However after update plus restart, this started to happen again.

I noticed gnome-shell always at 30% more or less. I disabled the extension "Vitals" but had the same issue, and disabled all extensions and the issue persisted.
So I logged out and in again, and it started working correctly.
I re-enabled extensions minus-vitals, and so far it is working correctly with the animations

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

This bug is closed.

Please open a new bug of your own by running:

  ubuntu-bug gnome-shell

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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