Gnome-shell animations smoother when external monitor is connected

Bug #1937127 reported by Sarmad Abdullah
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mutter (Ubuntu)
Fix Released
Medium
Daniel van Vugt

Bug Description

When no external monitor is connected Gnome Shell activities animation is sluggish. Once an external monitor is connected the animation becomes noticeably smoother. It looks like the OS is not properly responding to the extra processing demands by raising the CPU/GPU performance, and having an external monitor connected somehow triggers a higher performance level.

This is on a System76 Darter Pro machine with Intel® Core™ i7-8565U and Intel UHD 620 running Ubuntu 21.04 in Wayland session.

ProblemType: Bug
DistroRelease: Ubuntu 21.04
Package: gnome-shell 3.38.4-1ubuntu3~21.04.1
ProcVersionSignature: Ubuntu 5.11.0-7620.21~1624379747~21.04~3abeff8~dev-generic 5.11.21
Uname: Linux 5.11.0-7620-generic x86_64
ApportVersion: 2.20.11-0ubuntu65.1
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Wed Jul 21 12:51:55 2021
DisplayManager: gdm3
InstallationDate: Installed on 2021-07-14 (7 days ago)
InstallationMedia: Ubuntu 21.04 "Hirsute Hippo" - Release amd64 (20210420)
RelatedPackageVersions: mutter-common 3.38.4-1ubuntu2
SourcePackage: gnome-shell
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Sarmad Abdullah (sarmadka-f) wrote :
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Yes gnome-shell/mutter currently causes the GPU to stay in low power mode too much, unless you add extra demand.

This will be fixed in https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1441 or similar but it will take some months (or years) to complete.

Changed in gnome-shell (Ubuntu):
assignee: nobody → Daniel van Vugt (vanvugt)
tags: added: performance
Changed in gnome-shell (Ubuntu):
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
Sarmad Abdullah (sarmadka-f) wrote :

Years? Ouch. That's a bit too much. I understand that the switch to triple buffering can be a lot of work, but isn't there some hacky solution to improve the situation in the mean time? Something like manually telling the GPU to be in the same mode that it's in when an external monitor is connected, at least when an the machine is plugged into a power outlet?

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

I was just trying to avoid getting people's hopes up but most likely finished within months. Triple buffering itself is finished but it breaks the Wayland backend so that needs fixing yet.

And yes there is a hack to make an Intel GPU perform better at the expense of power and heat:

  cd /sys/class/drm/card0
  sudo cp gt_max_freq_mhz gt_min_freq_mhz

That's what I use on my desktop.

Revision history for this message
Sarmad Abdullah (sarmadka-f) wrote :

That sounds like a heavy solution to lock the frequency at the max.

How come this issue wasn't there in PopOS 20.04 (wayland session)? Was there a regression somewhere in the stack in 21.04, or is PopOS doing its own tuning? I haven't tried Ubuntu 20.04, nor PopOS 21.04, to know whether PopOS was doing something different, or just the older stack.

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

The issue has always existed. But with such a sharp edge between smooth and stuttering any slightest change in the GUI can push it over the edge. Also a little annoyingly, as we optimize more code it can sometimes make the problem *worse* as the GPU becomes less loaded and less likely to up-clock to smoothness.

Triple buffering is really the only solution that works with all drivers. Although sometimes you can tweak the graphics driver to change its clock scaling behaviour, I don't know if there's a more elegant workaround possible for Intel.

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

Using 'Ubuntu on Xorg' instead of 'Ubuntu' also helps. Because the former having more layers and less internal blocking actually dabbles in triple buffering sometimes by accident. Although I'm not sure if that's the reason it's smoother or just Xorg adds extra GPU load.

Since the default 'Ubuntu' session in 20.04 was Xorg and in 21.04 onward it is Wayland, that would explain a perceived performance drop that some users may notice.

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

Thank you for reporting this bug to Ubuntu.
Ubuntu 21.04 (hirsute) reached end-of-life on January 20, 2022.

See this document for currently supported Ubuntu releases:
https://wiki.ubuntu.com/Releases

We appreciate that this bug may be old and you might not be interested in discussing it any more. But if you are then please upgrade to the latest Ubuntu version and re-test. If you then find the bug is still present in the newer Ubuntu version, please add a comment here telling us which new version it is in.

Changed in gnome-shell (Ubuntu):
status: In Progress → Won't Fix
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Triple buffering was released in Ubuntu 22.04 as a patch to mutter 42.

affects: gnome-shell (Ubuntu) → mutter (Ubuntu)
Changed in mutter (Ubuntu):
status: Won't Fix → Fix Released
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.