High CPU when just moving the mouse

Bug #1848951 reported by Stojan on 2019-10-20
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mutter
Fix Released
Unknown
gnome-shell (Ubuntu)
Medium
Daniel van Vugt
mutter (Ubuntu)
Medium
Daniel van Vugt
xorg-server (Ubuntu)
Undecided
Unassigned

Bug Description

I have installed fresh Ubuntu 18.04.03 on my PC. Previously I had Ubuntu 16.04 version but didn't have any such problems with the cpu usage.

But I have saw in terminal that somehow the processes Xorg and gnome-shell use always 20% when just moving the mouse around for 18.04 version.

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: xorg 1:7.7+19ubuntu7.1
ProcVersionSignature: Ubuntu 5.0.0-31.33~18.04.1-generic 5.0.21
Uname: Linux 5.0.0-31-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.7
Architecture: amd64
CompositorRunning: None
CurrentDesktop: ubuntu:GNOME
Date: Sun Oct 20 20:54:50 2019
DistUpgraded: Fresh install
DistroCodename: bionic
DistroVariant: ubuntu
DkmsStatus: amdgpu, 19.30-855429, 5.0.0-31-generic, x86_64: installed
ExtraDebuggingInterest: No
GraphicsCard:
 Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller [8086:0412] (rev 06) (prog-if 00 [VGA controller])
   Subsystem: Gigabyte Technology Co., Ltd Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller [1458:d000]
 Advanced Micro Devices, Inc. [AMD/ATI] Cape Verde XT [Radeon HD 7770/8760 / R7 250X] [1002:683d] (prog-if 00 [VGA controller])
   Subsystem: Micro-Star International Co., Ltd. [MSI] R7770-PMD1GD5 [1462:2710]
InstallationDate: Installed on 2019-10-19 (0 days ago)
InstallationMedia: Ubuntu 18.04.3 LTS "Bionic Beaver" - Release amd64 (20190805)
MachineType: Gigabyte Technology Co., Ltd. B85M-D2V
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-5.0.0-31-generic root=UUID=1df6f37d-128f-4083-bd66-0a5c437227a0 ro quiet splash vt.handoff=1
SourcePackage: xorg
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 08/06/2015
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: F2
dmi.board.asset.tag: To be filled by O.E.M.
dmi.board.name: B85M-D2V
dmi.board.vendor: Gigabyte Technology Co., Ltd.
dmi.board.version: x.x
dmi.chassis.asset.tag: To Be Filled By O.E.M.
dmi.chassis.type: 3
dmi.chassis.vendor: Gigabyte Technology Co., Ltd.
dmi.chassis.version: To Be Filled By O.E.M.
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvrF2:bd08/06/2015:svnGigabyteTechnologyCo.,Ltd.:pnB85M-D2V:pvrTobefilledbyO.E.M.:rvnGigabyteTechnologyCo.,Ltd.:rnB85M-D2V:rvrx.x:cvnGigabyteTechnologyCo.,Ltd.:ct3:cvrToBeFilledByO.E.M.:
dmi.product.family: To be filled by O.E.M.
dmi.product.name: B85M-D2V
dmi.product.sku: To be filled by O.E.M.
dmi.product.version: To be filled by O.E.M.
dmi.sys.vendor: Gigabyte Technology Co., Ltd.
version.compiz: compiz N/A
version.libdrm2: libdrm2 2.4.97-1ubuntu1~18.04.1
version.libgl1-mesa-dri: libgl1-mesa-dri 19.0.8-0ubuntu0~18.04.3
version.libgl1-mesa-glx: libgl1-mesa-glx 19.0.8-0ubuntu0~18.04.3
version.xserver-xorg-core: xserver-xorg-core N/A
version.xserver-xorg-input-evdev: xserver-xorg-input-evdev N/A
version.xserver-xorg-video-ati: xserver-xorg-video-ati N/A
version.xserver-xorg-video-intel: xserver-xorg-video-intel N/A
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau N/A

Stojan (stojan97) wrote :
Stojan (stojan97) wrote :
Stojan (stojan97) on 2019-10-20
information type: Public → Public Security
information type: Public Security → Public
description: updated

The attachment "Screenshot from 2019-10-20 20-01-53.png" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Daniel van Vugt (vanvugt) wrote :

I've been working on a number of issues causing this. It is much improved in Ubuntu 19.10 but not yet quite at the point of being declared fixed.

Tracking in: https://gitlab.gnome.org/GNOME/mutter/issues/283

affects: xorg (Ubuntu) → mutter (Ubuntu)
Changed in mutter (Ubuntu):
assignee: nobody → Daniel van Vugt (vanvugt)
status: New → Confirmed
summary: - Xorg and gnome-shell consuming large amount of CPU
+ Xorg and gnome-shell consuming large amount of CPU when just moving the
+ mouse

Your mouse is very fast (1000Hz) so you will notice the problem 8x more than most people (most mice are 125Hz).

http://x7.a4tech.com/product.aspx?id=68

summary: - Xorg and gnome-shell consuming large amount of CPU when just moving the
- mouse
+ High CPU when just moving the mouse
Changed in xorg-server (Ubuntu):
status: New → Confirmed
Changed in gnome-shell (Ubuntu):
status: New → Confirmed
assignee: nobody → Daniel van Vugt (vanvugt)
tags: added: performance
Stojan (stojan97) wrote :

Is there anything I can do by my side to at least lower the cpu usage or no?

Daniel van Vugt (vanvugt) wrote :

In theory you might be able to avoid around 87% of the problem by changing your mouse polling rate from 1000Hz to 125Hz. To do that you need to add a kernel parameter:

  usbhid.mousepoll=8

or similar... https://wiki.archlinux.org/index.php/Mouse_polling_rate

Changed in mutter:
status: Unknown → New
Changed in mutter (Ubuntu):
status: Confirmed → In Progress
Changed in gnome-shell (Ubuntu):
status: Confirmed → In Progress
importance: Undecided → Medium
Changed in mutter (Ubuntu):
importance: Undecided → Medium
tags: added: champagne focal
Changed in mutter (Ubuntu):
milestone: none → ubuntu-20.03
Changed in gnome-shell (Ubuntu):
milestone: none → ubuntu-20.03
tags: removed: champagne
tags: added: fixed-in-3.35.92 fixed-upstream
Changed in gnome-shell (Ubuntu):
status: In Progress → Triaged
Changed in mutter (Ubuntu):
status: In Progress → Triaged
Changed in gnome-shell (Ubuntu):
status: Triaged → In Progress
Changed in gnome-shell (Ubuntu):
status: In Progress → Fix Committed
Changed in mutter (Ubuntu):
status: Triaged → Fix Committed
Launchpad Janitor (janitor) wrote :
Download full text (5.6 KiB)

This bug was fixed in the package gnome-shell - 3.36.0-2ubuntu1

---------------
gnome-shell (3.36.0-2ubuntu1) focal; urgency=medium

  * Merge with Debian. Ubuntu bugs resolved since 3.35.91-1ubuntu2:
    - gnome-shell crashed when enable-animations was false (LP: #1866044)
    - Overview animations were not reliably smooth (LP: #1725180)
    - Higher than necessary CPU usage on mouse movement (LP: #1848951)
    - Extension's preferences did not load (LP: #1866146)
  * debian/control:
    - Breaks yaru (<< 20.04.3~)
    - Breaks gnome-session (<< 3.35.3-1ubuntu4~) as per gdm yaru gresources
    - Breaks gnome-shell-extension-ubuntu-dock (<< 67ubuntu20.04.3)
    - Update Vcs-* to point to salsa ubuntu branches
  * ubuntu.json: Use Yaru gresource file for theming in ubuntu mode
  * debian/patches: Refresh
  * d/p/overview-Fade-in-out-over-the-desktop-instead-of-replacin.patch:
    - Fade in/out the desktop instead of replacing it (LP: #1847712)
  * d/p/ubuntu/gdm_alternatives.patch:
    - Set the default theme resource for gdm session to 'gdm3-theme.gresource'
    - Alias the default gnome-shell.css to gdm3.css
  * gnome-shell-common.install: Don't install compiled css file anymore
  * gnome-shell-common.{preinst,prerm}:
    - Remove obsolete alternative gdm3.css symlink
  * gnome-shell-common.postinst:
    - Set gnome-shell-theme.gresource as alternative for gdm3-theme.gresource
  * Remaining changes from debian:
    + Replace gnome-backgrounds dep with ubuntu-wallpapers and Suggests
      gnome-themes-standard-data, gnome-backgrounds
    + Add some Recommends:
      - ubuntu-session (| gnome-session) to have the ubuntu session available
      - xserver-xorg-legacy
      - yaru-theme-gnome-shell for the default ubuntu theming
    + Update debian/gbp.conf with Ubuntu settings
    + gnome-shell-common.prerm: Remove deprecated ubuntu theme alternative
    + ubuntu/desktop_detect.patch:
      - add caching for desktop detection to avoid querying the current
        desktop env variable as iterate through the list each time. For the
        time of the Shell process, we can expect this env variable to stay
        stable.
    + ubuntu/smarter_alt_tab.patch:
      - quick alt-tab (without showing up the switcher) switch only between
        the last window of the last 2 applications to be focused instead of
        raising all windows of those apps.
    + ubuntu/lightdm-user-switching.patch:
      - Allow user switching when using LightDM.
    + ubuntu/lock_on_suspend.patch
      - Respect Ubuntu's lock-on-suspend setting.
    + ubuntu/background_login.patch
      - Change default background color as we modified the default GDM color
        for our ubuntu session.
    + ubuntu/gdm_alternatives.patch
      - Add support for GDM3 theme alternatives
    + optional-hot-corner.patch
      - enable patch proposed by upstream developer already in package (but
        not in series) to add a settings for optional hot corner activation.
    + main-show-an-error-message-on-gnome-shell-crash.patch,
      global-make-possible-to-set-debug-flags-dynamically.patch,
      main-increase-the-granularity-of-backtraces-in-SHELL_DEBU.patch,
      main-add-backtrace-c...

Read more...

Changed in gnome-shell (Ubuntu):
status: Fix Committed → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mutter - 3.36.0-2ubuntu1

---------------
mutter (3.36.0-2ubuntu1) focal; urgency=medium

  * Merge with debian. Remaining changes:
    + debian/control:
      - Update VCS flags to point to ubuntu salsa branch
    + debian/gbp.conf: update branch to point to ubuntu/master
    + debian/patches/x11-Add-support-for-fractional-scaling-using-Randr.patch:
      - X11: Add support for fractional scaling using Randr
  * d/p/clutter-master-clock-default-Sync-timelines-to-hardware-v.patch:
    - Improves smoothness and reduce input-to-output latency
      levels (LP: #1862308)
  * debian/libmutter-6-0.symbols:
    - Update as per background mipmap levels patch symbol addition
  * Ubuntu bugs resolved since 3.35.91-1ubuntu1:
    - Higher than necessary CPU usage on mouse movement (LP: #1848951)
    - No mouse cursor drawn for radeon in Wayland sessions (LP: #1867080)
    - Restarting displays apps running on other workspaces (LP: #1819890)
    - Volume/brightness OSD make fullscreen video flicker (LP: #1828697)

mutter (3.36.0-2) experimental; urgency=medium

  * control: Build against gnome-desktop 3.36 and break old gnome-shell. So we
    get dependencies on libgnome-desktop-3-19. Otherwise we get two different
    versions of gnome-desktop loaded into GNOME Shell, which crashes. Break
    old gnome-shell for the inverse reason - it needs to be upgraded otherwise
    we get the mismatch the other way around.

mutter (3.36.0-1) experimental; urgency=medium

  * New upstream release
    + Fix placement of popup windows in multi-monitor setups
    + Fix invisible mouse cursor on some hardware
    + Updated translations

mutter (3.35.92-1) experimental; urgency=medium

  * New upstream release
    + Add side channel for starting required X11 services
    + Allow remote desktop services to inhibit animations
    + Avoid flicker when (un)redirecting windows
    + Fix clipping glitches in long text entries
    + Fix visibility of initially hidden windows
    + Implement scaled/transformed hardware cursors
    + Let BindConstraints update the preferred size
    + Make check-alive timeouts configurable
    + Make each stage view correspond to a single CRTC
    + Make Xwayland startup asynchronous
    + Ping windows on every window focus
    + Remove overhead from hot code paths
    + Support synchronized wayland popup moving
    + Update screen-cast code to PipeWire 0.3 API
    + Use DMA buffers for screencasting if possible
  * d/p/*: Rebase
  * rules: Disable remote-desktop temporarily. This now requires pipewire 0.3
    which is not packaged yet and needs to be worked on
  * control: Bump wayland-protocols dep to 1.19 per meson.build
  * debian/libmutter-6-0.symbols: Add new symbols for this release. One symbol
    which was introduced in .90 was dropped; -6's ABI is not stable yet.

 -- Marco Trevisan (Treviño) <email address hidden> Thu, 19 Mar 2020 15:51:05 +0000

Changed in mutter (Ubuntu):
status: Fix Committed → Fix Released
Changed in mutter:
status: New → Fix Released
Mathew Hodson (mhodson) on 2020-04-24
no longer affects: xorg-server (Ubuntu)
Daniel van Vugt (vanvugt) wrote :

Last I checked Xorg was still affected by this problem.

Changed in xorg-server (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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