High CPU usage in gnome-shell just redrawing the screen (Firefox is running)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
firefox (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
gnome-shell (Ubuntu) |
Invalid
|
High
|
Unassigned | ||
mutter (Ubuntu) |
Invalid
|
High
|
Unassigned |
Bug Description
Even when doing nothing at all, gnome-shell uses around 70% CPU.
```
inxi -t cm
Processes: CPU: % used - top 5 active
1: cpu: 68.6% command: gnome-shell pid: 1399
2: cpu: 50.4% command: Xwayland pid: 1405
3: cpu: 19.7% command: firefox pid: 3684
4: cpu: 2.4% command: gnome-shell pid: 1859
5: cpu: 1.5% command: gnome-tweak-tool (started by: python) pid: 13603
Memory: MB / % used - Used/Total: 2350.1/11897.0MB - top 5 active
1: mem: 1033.63MB (8.6%) command: firefox pid: 3684
2: mem: 317.59MB (2.6%) command: gnome-shell pid: 1859
3: mem: 267.55MB (2.2%) command: gnome-software pid: 2058
4: mem: 111.25MB (0.9%) command: Xorg pid: 1506
5: mem: 90.90MB (0.7%) command: nautilus-desktop pid: 2055
```
It's also strange that Xwayland is active as I did choose the "normal" gnome session upon signin.
```
echo $XDG_SESSION_TYPE
x11
```
While searching I found a recent problem with AMD GPUs, but I'm using an Intel GPU
```
glxinfo
name of display: :0
display: :0 screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:
GLX_
GLX_
GLX_
GLX_
GLX_
GLX_
GLX_
GLX_
GLX_
GLX_
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
client glx extensions:
GLX_
GLX_
GLX_
GLX_
GLX_
GLX_
GLX_
GLX_
GLX_
GLX_
GLX_
GLX_
GLX_
GLX version: 1.4
GLX extensions:
GLX_
GLX_
GLX_
GLX_
GLX_
GLX_
GLX_
GLX_
GLX_
GLX_
GLX_
GLX_
GLX_
Extended renderer info (GLX_MESA_
Vendor: Intel Open Source Technology Center (0x8086)
Device: Mesa DRI Intel(R) Haswell Mobile (0xa16)
Version: 17.1.0
Accelerated: yes
Video memory: 1536MB
Unified memory: yes
Preferred profile: core (0x1)
Max core profile version: 4.5
Max compat profile version: 3.0
Max GLES1 profile version: 1.1
Max GLES[23] profile version: 3.1
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Haswell Mobile
OpenGL core profile version string: 4.5 (Core Profile) Mesa 17.1.0
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_S3_s3tc
OpenGL version string: 3.0 Mesa 17.1.0
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_ARB_shadow, GL_ARB_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_EXT_texture, GL_EXT_texture3D, GL_EXT_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
OpenGL ES profile version string: OpenGL ES 3.1 Mesa 17.1.0
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10
OpenGL ES profile extensions:
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
GL_
40 GLX Visuals
visual x bf lv rg d st colorbuffer sr ax dp st accumbuffer ms cav
id dep cl sp sz l ci b ro r g b a F gb bf th cl r g b a ns b eat
-------
0x041 24 tc 0 32 0 r y . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None
0x042 24 dc 0 32 0 r y . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None
0x0ec 24 tc 0 32 0 r y . 8 8 8 8 . . 0 0 0 0 0 0 0 0 0 None
0x0ed 24 tc 0 32 0 r . . 8 8 8 8 . . 0 0 0 0 0 0 0 0 0 None
0x0ee 24 tc 0 32 0 r . . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None
0x0ef 24 tc 0 24 0 r y . 8 8 8 0 . . 0 0 0 0 0 0 0 0 0 None
0x0f0 24 tc 0 24 0 r . . 8 8 8 0 . . 0 0 0 0 0 0 0 0 0 None
0x0f1 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 0 0 None
0x0f2 24 tc 0 24 0 r . . 8 8 8 0 . . 0 24 8 0 0 0 0 0 0 None
0x0f3 24 tc 0 32 0 r y . 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 Slow
0x0f4 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 0 0 None
0x0f5 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 16 16 16 0 0 0 Slow
0x0f6 24 tc 0 32 0 r y . 8 8 8 8 . . 0 0 0 0 0 0 0 4 1 None
0x0f7 24 tc 0 32 0 r y . 8 8 8 8 . . 0 0 0 0 0 0 0 8 1 None
0x0f8 24 tc 0 32 0 r y . 8 8 8 8 . . 0 24 8 0 0 0 0 4 1 None
0x0f9 24 tc 0 32 0 r y . 8 8 8 8 . . 0 24 8 0 0 0 0 8 1 None
0x0fa 24 tc 0 24 0 r y . 8 8 8 0 . . 0 0 0 0 0 0 0 4 1 None
0x0fb 24 tc 0 24 0 r y . 8 8 8 0 . . 0 0 0 0 0 0 0 8 1 None
0x0fc 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 4 1 None
0x0fd 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 8 1 None
0x0fe 24 dc 0 32 0 r y . 8 8 8 8 . . 0 0 0 0 0 0 0 0 0 None
0x0ff 24 dc 0 32 0 r . . 8 8 8 8 . . 0 0 0 0 0 0 0 0 0 None
0x100 24 dc 0 32 0 r . . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None
0x101 24 dc 0 24 0 r y . 8 8 8 0 . . 0 0 0 0 0 0 0 0 0 None
0x102 24 dc 0 24 0 r . . 8 8 8 0 . . 0 0 0 0 0 0 0 0 0 None
0x103 24 dc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 0 0 None
0x104 24 dc 0 24 0 r . . 8 8 8 0 . . 0 24 8 0 0 0 0 0 0 None
0x105 24 dc 0 32 0 r y . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None
0x106 24 dc 0 32 0 r y . 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 Slow
0x107 24 dc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 0 0 None
0x108 24 dc 0 24 0 r y . 8 8 8 0 . . 0 24 8 16 16 16 0 0 0 Slow
0x109 24 dc 0 32 0 r y . 8 8 8 8 . . 0 0 0 0 0 0 0 4 1 None
0x10a 24 dc 0 32 0 r y . 8 8 8 8 . . 0 0 0 0 0 0 0 8 1 None
0x10b 24 dc 0 32 0 r y . 8 8 8 8 . . 0 24 8 0 0 0 0 4 1 None
0x10c 24 dc 0 32 0 r y . 8 8 8 8 . . 0 24 8 0 0 0 0 8 1 None
0x10d 24 dc 0 24 0 r y . 8 8 8 0 . . 0 0 0 0 0 0 0 4 1 None
0x10e 24 dc 0 24 0 r y . 8 8 8 0 . . 0 0 0 0 0 0 0 8 1 None
0x10f 24 dc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 4 1 None
0x110 24 dc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 8 1 None
0x0ab 32 tc 0 32 0 r y . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None
64 GLXFBConfigs:
visual x bf lv rg d st colorbuffer sr ax dp st accumbuffer ms cav
id dep cl sp sz l ci b ro r g b a F gb bf th cl r g b a ns b eat
-------
0x0ac 0 tc 0 16 0 r y . 5 6 5 0 . . 0 0 0 0 0 0 0 0 0 None
0x0ad 0 tc 0 16 0 r . . 5 6 5 0 . . 0 0 0 0 0 0 0 0 0 None
0x0ae 0 tc 0 16 0 r y . 5 6 5 0 . . 0 16 0 0 0 0 0 0 0 None
0x0af 0 tc 0 16 0 r . . 5 6 5 0 . . 0 16 0 0 0 0 0 0 0 None
0x0b0 0 tc 0 16 0 r y . 5 6 5 0 . . 0 24 8 0 0 0 0 0 0 None
0x0b1 0 tc 0 16 0 r . . 5 6 5 0 . . 0 24 8 0 0 0 0 0 0 None
0x0b2 24 tc 0 32 0 r y . 8 8 8 8 . . 0 0 0 0 0 0 0 0 0 None
0x0b3 24 tc 0 32 0 r . . 8 8 8 8 . . 0 0 0 0 0 0 0 0 0 None
0x0b4 24 tc 0 32 0 r y . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None
0x0b5 24 tc 0 32 0 r . . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None
0x0b6 24 tc 0 24 0 r y . 8 8 8 0 . . 0 0 0 0 0 0 0 0 0 None
0x0b7 24 tc 0 24 0 r . . 8 8 8 0 . . 0 0 0 0 0 0 0 0 0 None
0x0b8 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 0 0 None
0x0b9 24 tc 0 24 0 r . . 8 8 8 0 . . 0 24 8 0 0 0 0 0 0 None
0x0ba 0 tc 0 16 0 r y . 5 6 5 0 . . 0 16 0 0 0 0 0 0 0 None
0x0bb 0 tc 0 16 0 r y . 5 6 5 0 . . 0 16 0 16 16 16 0 0 0 Slow
0x0bc 32 tc 0 32 0 r y . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None
0x0bd 24 tc 0 32 0 r y . 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 Slow
0x0be 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 0 0 None
0x0bf 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 16 16 16 0 0 0 Slow
0x0c0 0 tc 0 16 0 r y . 5 6 5 0 . . 0 0 0 0 0 0 0 4 1 None
0x0c1 0 tc 0 16 0 r y . 5 6 5 0 . . 0 0 0 0 0 0 0 8 1 None
0x0c2 0 tc 0 16 0 r y . 5 6 5 0 . . 0 16 0 0 0 0 0 4 1 None
0x0c3 0 tc 0 16 0 r y . 5 6 5 0 . . 0 16 0 0 0 0 0 8 1 None
0x0c4 24 tc 0 32 0 r y . 8 8 8 8 . . 0 0 0 0 0 0 0 4 1 None
0x0c5 24 tc 0 32 0 r y . 8 8 8 8 . . 0 0 0 0 0 0 0 8 1 None
0x0c6 24 tc 0 32 0 r y . 8 8 8 8 . . 0 24 8 0 0 0 0 4 1 None
0x0c7 24 tc 0 32 0 r y . 8 8 8 8 . . 0 24 8 0 0 0 0 8 1 None
0x0c8 24 tc 0 24 0 r y . 8 8 8 0 . . 0 0 0 0 0 0 0 4 1 None
0x0c9 24 tc 0 24 0 r y . 8 8 8 0 . . 0 0 0 0 0 0 0 8 1 None
0x0ca 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 4 1 None
0x0cb 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 8 1 None
0x0cc 0 dc 0 16 0 r y . 5 6 5 0 . . 0 0 0 0 0 0 0 0 0 None
0x0cd 0 dc 0 16 0 r . . 5 6 5 0 . . 0 0 0 0 0 0 0 0 0 None
0x0ce 0 dc 0 16 0 r y . 5 6 5 0 . . 0 16 0 0 0 0 0 0 0 None
0x0cf 0 dc 0 16 0 r . . 5 6 5 0 . . 0 16 0 0 0 0 0 0 0 None
0x0d0 0 dc 0 16 0 r y . 5 6 5 0 . . 0 24 8 0 0 0 0 0 0 None
0x0d1 0 dc 0 16 0 r . . 5 6 5 0 . . 0 24 8 0 0 0 0 0 0 None
0x0d2 24 dc 0 32 0 r y . 8 8 8 8 . . 0 0 0 0 0 0 0 0 0 None
0x0d3 24 dc 0 32 0 r . . 8 8 8 8 . . 0 0 0 0 0 0 0 0 0 None
0x0d4 24 dc 0 32 0 r y . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None
0x0d5 24 dc 0 32 0 r . . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None
0x0d6 24 dc 0 24 0 r y . 8 8 8 0 . . 0 0 0 0 0 0 0 0 0 None
0x0d7 24 dc 0 24 0 r . . 8 8 8 0 . . 0 0 0 0 0 0 0 0 0 None
0x0d8 24 dc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 0 0 None
0x0d9 24 dc 0 24 0 r . . 8 8 8 0 . . 0 24 8 0 0 0 0 0 0 None
0x0da 0 dc 0 16 0 r y . 5 6 5 0 . . 0 16 0 0 0 0 0 0 0 None
0x0db 0 dc 0 16 0 r y . 5 6 5 0 . . 0 16 0 16 16 16 0 0 0 Slow
0x0dc 24 dc 0 32 0 r y . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None
0x0dd 24 dc 0 32 0 r y . 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 Slow
0x0de 24 dc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 0 0 None
0x0df 24 dc 0 24 0 r y . 8 8 8 0 . . 0 24 8 16 16 16 0 0 0 Slow
0x0e0 0 dc 0 16 0 r y . 5 6 5 0 . . 0 0 0 0 0 0 0 4 1 None
0x0e1 0 dc 0 16 0 r y . 5 6 5 0 . . 0 0 0 0 0 0 0 8 1 None
0x0e2 0 dc 0 16 0 r y . 5 6 5 0 . . 0 16 0 0 0 0 0 4 1 None
0x0e3 0 dc 0 16 0 r y . 5 6 5 0 . . 0 16 0 0 0 0 0 8 1 None
0x0e4 24 dc 0 32 0 r y . 8 8 8 8 . . 0 0 0 0 0 0 0 4 1 None
0x0e5 24 dc 0 32 0 r y . 8 8 8 8 . . 0 0 0 0 0 0 0 8 1 None
0x0e6 24 dc 0 32 0 r y . 8 8 8 8 . . 0 24 8 0 0 0 0 4 1 None
0x0e7 24 dc 0 32 0 r y . 8 8 8 8 . . 0 24 8 0 0 0 0 8 1 None
0x0e8 24 dc 0 24 0 r y . 8 8 8 0 . . 0 0 0 0 0 0 0 4 1 None
0x0e9 24 dc 0 24 0 r y . 8 8 8 0 . . 0 0 0 0 0 0 0 8 1 None
0x0ea 24 dc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 4 1 None
0x0eb 24 dc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 8 1 None
```
ProblemType: Bug
DistroRelease: Ubuntu 17.10
Package: gnome-shell 3.24.2-0ubuntu6
ProcVersionSign
Uname: Linux 4.10.0-22-generic x86_64
ApportVersion: 2.20.5-0ubuntu4
Architecture: amd64
CurrentDesktop: GNOME
Date: Wed Jun 7 07:30:40 2017
DisplayManager: lightdm
InstallationDate: Installed on 2017-06-03 (3 days ago)
InstallationMedia: Ubuntu 17.10 "Artful Aardvark" - Alpha amd64 (20170602)
SourcePackage: gnome-shell
UpgradeStatus: No upgrade log present (probably fresh install)
summary: |
- High CPU usage in gnome-shell + High CPU usage in gnome-shell just redrawing the screen (Firefox is + running) |
Changed in gnome-shell (Ubuntu): | |
importance: | Undecided → High |
Changed in mutter (Ubuntu): | |
importance: | Undecided → High |
status: | New → Confirmed |
tags: | added: gnome-17.10 |
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 |
Changed in gnome-shell (Ubuntu): | |
assignee: | Daniel van Vugt (vanvugt) → nobody |
assignee: | nobody → Daniel van Vugt (vanvugt) |
Yeah I noticed too; gnome-shell is surprisingly inefficient.
The good news is that v3.25 aims to make things more efficient, so that's something to look forward to.
Just a note: The exact CPU usage will depend on your CPU model and what apps you're running (not just the Gnome version). I experience 20%+ CPU usage by gnome-shell on a high-end Xeon desktop, just while it's redrawing the screen, which is surprisingly bad. But it will take some time before the upstream optimizations trickle into Ubuntu, and before I have time to look at more detailed optimizations in future.