Higher power consumption when running gnome-shell compared to unity

Bug #1795342 reported by Irfan on 2018-10-01
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
The Ubuntu Power Consumption Project
Undecided
Unassigned
gnome-shell (Ubuntu)
Undecided
Unassigned

Bug Description

Hi,

I am running Ubuntu on Thinkpad. I am facing battery back up issues on both 18.04 and 18.10 versions. Before that I was running Ubuntu 16.04 with a normal back of almost 4 hours ( 2 Sony Batteries with normal back up of up to min of 6 hours on Linux Mint 19) and when upgrading to 18.04 it reduced to 3 hours max on normal usage and less than 2 hours on heavy use.
I tried installing Unity session on 18.04/10, the back up increased. I think it is Gnome doing the mess.
---
ProblemType: Bug
ApportVersion: 2.20.10-0ubuntu13.1
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
DisplayManager: gdm3
DistroRelease: Ubuntu 18.10
InstallationDate: Installed on 2018-12-02 (1 days ago)
InstallationMedia: Ubuntu 18.10 "Cosmic Cuttlefish" - Release amd64 (20181017.3)
Package: gnome-shell 3.30.1-2ubuntu1
PackageArchitecture: amd64
ProcVersionSignature: Ubuntu 4.18.0-11.12-generic 4.18.12
Tags: cosmic
Uname: Linux 4.18.0-11-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip lpadmin plugdev sambashare sudo
_MarkForUpload: True

Daniel van Vugt (vanvugt) wrote :

Please run this command to send us more system info:

   apport-collect 1795342

Changed in gnome-shell (Ubuntu):
status: New → Incomplete
Changed in ubuntu-power-consumption:
status: New → Incomplete
Will Cooke (willcooke) wrote :

Out of interest, do you have an Nvidia Prime setup?

Daniel van Vugt (vanvugt) wrote :

That question would be answered by attaching output from:

  lspci -k

which is often done automatically by apport (see comment #1).

Irfan (irfan.hamid) wrote :

This is the hardware info:

00:00.0 Host bridge: Intel Corporation Skylake Host Bridge/DRAM Registers (rev 08)
 Subsystem: Lenovo Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers
 Kernel driver in use: skl_uncore
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 520 (rev 07)
 Subsystem: Lenovo Skylake GT2 [HD Graphics 520]
 Kernel driver in use: i915
 Kernel modules: i915
00:14.0 USB controller: Intel Corporation Sunrise Point-LP USB 3.0 xHCI Controller (rev 21)
 Subsystem: Lenovo Sunrise Point-LP USB 3.0 xHCI Controller
 Kernel driver in use: xhci_hcd
00:14.2 Signal processing controller: Intel Corporation Sunrise Point-LP Thermal subsystem (rev 21)
 Subsystem: Lenovo Sunrise Point-LP Thermal subsystem
 Kernel driver in use: intel_pch_thermal
 Kernel modules: intel_pch_thermal
00:16.0 Communication controller: Intel Corporation Sunrise Point-LP CSME HECI #1 (rev 21)
 Subsystem: Lenovo Sunrise Point-LP CSME HECI
 Kernel driver in use: mei_me
 Kernel modules: mei_me
00:16.3 Serial controller: Intel Corporation Device 9d3d (rev 21)
 Subsystem: Lenovo Device 5053
 Kernel driver in use: serial
00:17.0 SATA controller: Intel Corporation Sunrise Point-LP SATA Controller [AHCI mode] (rev 21)
 Subsystem: Lenovo Sunrise Point-LP SATA Controller [AHCI mode]
 Kernel driver in use: ahci
 Kernel modules: ahci
00:1c.0 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port (rev f1)
 Kernel driver in use: pcieport
 Kernel modules: shpchp
00:1c.2 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port (rev f1)
 Kernel driver in use: pcieport
 Kernel modules: shpchp
00:1f.0 ISA bridge: Intel Corporation Sunrise Point-LP LPC Controller (rev 21)
 Subsystem: Lenovo Sunrise Point-LP LPC Controller
00:1f.2 Memory controller: Intel Corporation Sunrise Point-LP PMC (rev 21)
 Subsystem: Lenovo Sunrise Point-LP PMC
00:1f.3 Audio device: Intel Corporation Sunrise Point-LP HD Audio (rev 21)
 Subsystem: Lenovo Sunrise Point-LP HD Audio
 Kernel driver in use: snd_hda_intel
 Kernel modules: snd_hda_intel, snd_soc_skl
00:1f.4 SMBus: Intel Corporation Sunrise Point-LP SMBus (rev 21)
 Subsystem: Lenovo Sunrise Point-LP SMBus
 Kernel modules: i2c_i801
00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection I219-LM (rev 21)
 Subsystem: Lenovo Ethernet Connection I219-LM
 Kernel driver in use: e1000e
 Kernel modules: e1000e
02:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS522A PCI Express Card Reader (rev 01)
 Subsystem: Lenovo RTS522A PCI Express Card Reader
 Kernel driver in use: rtsx_pci
 Kernel modules: rtsx_pci
04:00.0 Network controller: Intel Corporation Wireless 8260 (rev 3a)
 Subsystem: Intel Corporation Wireless 8260
 Kernel driver in use: iwlwifi
 Kernel modules: iwlwifi

Daniel van Vugt (vanvugt) wrote :

Thanks. So it's Intel-only graphics:

00:02.0 VGA compatible controller: Intel Corporation HD Graphics 520 (rev 07)
 Subsystem: Lenovo Skylake GT2 [HD Graphics 520]
 Kernel driver in use: i915
 Kernel modules: i915

Next, please run the command from comment #1.

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
Launchpad Janitor (janitor) wrote :

[Expired for The Ubuntu Power Consumption Project because there has been no activity for 60 days.]

Changed in ubuntu-power-consumption:
status: Incomplete → Expired
Daniel van Vugt (vanvugt) wrote :

This bug is now closed. If you would like to reopen it then please answer comment #1.

apport information

tags: added: apport-collected cosmic
description: updated

apport information

apport information

apport information

Thanks. Please try installing 'powertop' and then run 'sudo powertop'. You may find a reason for the high power consumption there.

Also, please try running regular 'top' and see if any process is using high CPU.

Changed in ubuntu-power-consumption:
status: Expired → New
Changed in gnome-shell (Ubuntu):
status: Expired → New
Changed in ubuntu-power-consumption:
status: New → Incomplete
Changed in gnome-shell (Ubuntu):
status: New → Incomplete
Irfan (irfan.hamid) wrote :

Hey thanks,

I have attached the powertop report. Can you confirm.

Daniel van Vugt (vanvugt) wrote :

Thanks, that's a nice report.

It appears your main power consumers are Firefox, Gnome Shell and the Intel graphics driver. Actually that's all likely just due to Firefox, which may be consuming more power since it is now being composited through Gnome Shell and both of them use the Intel graphics driver...

To test this theory, please close Firefox and leave the laptop idle for some time while Gnome Shell is still open. Does eliminating Firefox stop the high power consumption?

P.S. You can probably also uninstall the 'removeaccesibility' extension. You can do the same thing in:
  Settings > Universal Access > Always Show Universal Access Menu = OFF

Daniel van Vugt (vanvugt) wrote :

Please also try shrinking the Firefox window so that it is not touching the screen edges (not touching the Gnome panel and Ubuntu dock). Does that improve things?

tags: added: performance
Irfan (irfan.hamid) wrote :

1. Closed firefox and left the laptop idle for an hour and the battery is almost fast drained again.
2. removeaccesibity extension is important for me because I have a HiDpi display and normally the screen looks tiny and enabling Universal access helps and at the same time I don't like the icon present always there, makes me feel sick, sorry about that!

Daniel van Vugt (vanvugt) wrote :

It looks like you're also running skypeforlinux, slack and more. Please try with all apps closed (just log out and log in again). Is the power usage still high with zero apps?

Irfan (irfan.hamid) wrote :

Thanks and I tested it many times. Kept the system idle with zero apps running and the power usage was still high.

Daniel van Vugt (vanvugt) wrote :

OK. Next we need to figure out what system component is to blame.

Please open a Terminal window and run:

  top -d60

That will only update once per minute. Please wait a couple of minutes (of doing nothing) and then tell us what processes come to the top of the list, and what their %CPU is. Or better yet, just take a screenshot (after a few minutes) and attach it here.

Irfan (irfan.hamid) wrote :

Thank you.
Attached is the output of top -d60

Irfan (irfan.hamid) wrote :

Please ignore the previous one, I took that screenshot sooner. Consider this one.

Daniel van Vugt (vanvugt) wrote :

Thanks. Although gnome-shell, snapd and deja-dup-monitor are the top users for the previous 60 seconds, it also shows that snapd has used an accumulated 4m40s which is way above everything else.

Given your uptime is 5h34m then that means snapd has used an average of over 1% of your CPU for that entire uptime. So I think snapd is the next thing to look at.

Please try disabling snapd for a while:

  sudo systemctl stop snapd.socket
  sudo systemctl stop snapd.service

Again leave the desktop idle, and tell us if that has improved the power use.

Irfan (irfan.hamid) wrote :

Disabled snapd service and left the laptop idle, almost same power usage.

Daniel van Vugt (vanvugt) wrote :

OK. There's one more thing to check before we can blame the kernel...

Reboot, login, and leave the machine completely idle without ever having launched any apps. Is the power usage still too high? If yes, please then run 'ps auxw > allprocs.txt' and attach 'allprocs.txt' here. Then try uninstalling the 'removeaccesibility' extension and retest.

Irfan (irfan.hamid) wrote :

Hi, please confirm the attached output of `ps auxw`.

Daniel van Vugt (vanvugt) wrote :

Thanks. That only shows a few seconds of CPU usage. How long was the machine running when you collected that?

Can you please try again, leaving the machine idle for as many hours as possible?

Also, did you confirm the power usage is still too high before sending allprocs.txt?

Irfan (irfan.hamid) wrote :

Please ignore the previous output file, took that too soon after system boot.

Consider the attachment with this comment, the power usage is still same and high. I left the machine completely idle for longer.

Daniel van Vugt (vanvugt) wrote :

Did you confirm the power usage is still too high before sending allprocs.txt?

Even that second file doesn't seem to show any long term execution. So maybe forget about leaving the machine idle. Just leave it on for multiple hours/days, use it, and then please send another allprocs.txt.

Irfan (irfan.hamid) wrote :

Ok. here's another file. Left the laptop idle for few hours, still high power usage.

Daniel van Vugt (vanvugt) wrote :

Some notable CPU users from that file:

16:57 0:42 /usr/lib/snapd/snapd
16:57 3:01 /usr/sbin/preload -s /var/lib/preload/preload.state
16:57 0:30 [irq/125-iwlwifi] <--- this is the Intel Wifi driver
16:57 0:21 /usr/bin/tor --defaults-torrc /usr/share/tor/tor-service-defaults-torrc -f /etc/tor/torrc --RunAsDaemon 0
16:58 0:30 /usr/bin/gnome-shell

But I can't see any very high power users so maybe we're looking in the wrong place. And maybe we need to be more scientific about this...

To be more scientific about the problem we need to display the current power usage in watts. You can do that using either 'sudo powertop' or in the Power Statistics app looking at your battery information.

Next, now that you can see the exact power usage watts, try changing things like running a different shell. For example Unity: sudo apt install unity-session

You may also then want to try different kernel versions (older and newer) and compare the power usage of those:
https://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D

Irfan (irfan.hamid) wrote :

I installed a new kernel 4.20 on Gnome-shell and the power consumption was almost same/high.
Then, I removed the kernel and switched back to 4.18 that comes with 18.10 base and installed unity-session and I noticed a sudden decrease in power consumption. I don't know, if the problem is Gnome-shell but this is what seems by switching to unity.

Daniel van Vugt (vanvugt) wrote :

Cool. What are the approximate power usage numbers you see in watts?

summary: - High Power Consumption
+ Higher power consumption when running gnome-shell compared to unity
Changed in ubuntu-power-consumption:
status: Incomplete → New
Changed in gnome-shell (Ubuntu):
status: Incomplete → New
Daniel van Vugt (vanvugt) wrote :

Also, can you please confirm what version of package 'gjs' you have installed?

Irfan (irfan.hamid) wrote :

gjs version is 1.54.3.

Daniel van Vugt (vanvugt) wrote :

What are the approximate power usage numbers you see in watts? (Gnome Shell vs Unity)

Changed in ubuntu-power-consumption:
status: New → Incomplete
Changed in gnome-shell (Ubuntu):
status: New → Incomplete
Launchpad Janitor (janitor) wrote :

[Expired for The Ubuntu Power Consumption Project because there has been no activity for 60 days.]

Changed in ubuntu-power-consumption:
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
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers