gnome-shell has high cpu usage and causes significant lag

Bug #2070313 reported by khevans

This bug report will be marked for expiration in 59 days if no further activity occurs. (find out why)

8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gnome-shell (Ubuntu)
Incomplete
Undecided
Unassigned

Bug Description

I've lately been noticing a substantial lag that consumes an entire core on my CPU (CPU% 1.00+). It's most noticeable with the cursor, where it starts "jumping" around instead of moving smoothly across the screen.

It seems to stem from `gnome-shell` but I'm not sure how to further debug this and find the root cause. I've included a couple screenshots as well as debug information from `ubuntu-bug gnome-shell`.

If I reboot, it tends to go away. It only seems to happen after 4-5 hours of uptime.

Please let me know how to further debug this problem or if any other information is needed.

```
$ lsb_release -rd
No LSB modules are available.
Description: Ubuntu 23.10
Release: 23.10
```

```
$ apt-cache policy gnome-shell
gnome-shell:
  Installed: 45.2-0ubuntu1.1
  Candidate: 45.2-0ubuntu1.1
  Version table:
 *** 45.2-0ubuntu1.1 500
        500 http://us.archive.ubuntu.com/ubuntu mantic-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu mantic-security/main amd64 Packages
        100 /var/lib/dpkg/status
     45.0-1ubuntu2 500
        500 http://us.archive.ubuntu.com/ubuntu mantic/main amd64 Packages
```

ProblemType: Bug
DistroRelease: Ubuntu 23.10
Package: gnome-shell 45.2-0ubuntu1.1
ProcVersionSignature: Ubuntu 6.5.0-41.41-generic 6.5.13
Uname: Linux 6.5.0-41-generic x86_64
ApportVersion: 2.27.0-0ubuntu5
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Mon Jun 24 14:09:02 2024
DisplayManager: gdm3
InstallationDate: Installed on 2023-11-01 (236 days ago)
InstallationMedia: Ubuntu 23.10.1 "Mantic Minotaur" - Release amd64 (20231016.1)
ProcEnviron:
 LANG=en_US.UTF-8
 PATH=(custom, no user)
 SHELL=/bin/bash
 TERM=xterm-256color
 XDG_RUNTIME_DIR=<set>
RelatedPackageVersions: mutter-common 45.2-0ubuntu4
SourcePackage: gnome-shell
UpgradeStatus: No upgrade log present (probably fresh install)

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

Thanks for the bug report. The only similar issue I'm aware of is that sometimes the cursor can become laggy but that is also fixed by putting the screen to sleep (Super+L) and waking it up again. That issue is so rare that I haven't seen it in months.

If that doesn't work around your issue adequately then the next thing to try is to remove all local extensions:

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

and then log in again.

Please also note that Ubuntu 23.10 reaches end of life next month and we recommend 24.04 instead. https://wiki.ubuntu.com/Releases

Changed in gnome-shell (Ubuntu):
status: New → Incomplete
Revision history for this message
khevans (khevans) wrote :

Thanks for the reply.

I noticed today that at just under 6 hours of uptime, the mouse became quite laggy and gnome-shell was consuming an entire CPU again. I had also removed my extensions (they had already been disabled).

I tried locking the computer with Super+L but that did not change anything even after the screens went to standby. However, putting the entire computer to sleep (Power menu -> Sleep) did indeed fix it. Is there another issue on here about this problem that I can track instead of this one?

re: 23.10 EOL. I'll be upgrading to 24.04.1 once it is released later this year. I'm excited to see the changes!

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

Thanks. It's interesting that sleep-resume fixed it.

Next time the problem starts happening, please run:

  journalctl -b0 > journal.txt

and attach the resulting text file here.

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

I completely forgot about bug 2063036 because I hadn't seen it in a while.

Please try:

  gnome-extensions disable <email address hidden>

Revision history for this message
khevans (khevans) wrote :

It's currently maxing out the first CPU core on my laptop. Putting it to sleep solved the problem.

While gnome-shell was maxing out the CPU core, I captured the output of journalctl. Hopefully there's nothing too sensitive in there. :-)

I had also disabled the extensions previously:

```
kevin@kevinbuntu:~$ gnome-extensions list --disabled
<email address hidden>
<email address hidden>
<email address hidden>
<email address hidden>
<email address hidden>
<email address hidden>
<email address hidden>
<email address hidden>
<email address hidden>
<email address hidden>
<email address hidden>
<email address hidden>
<email address hidden>

kevin@kevinbuntu:~$ gnome-extensions list --enabled
<email address hidden>
<email address hidden>
<email address hidden>
```

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

Please try adding MUTTER_DEBUG_KMS_THREAD_TYPE=user to /etc/environment and reboot. That will disable the new highly optimized cursor movement code that was introduced in 23.10.

Also a reminder: 23.10 reaches end of life this month. https://wiki.ubuntu.com/Releases

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.