Low framerate in 2D applications under Wayland when multiple displays connected
Affected versions
Distro & Mutter
Nobara Linux 38$ uname -r
6.3.12-205.fsync.fc38.x86_64
$ mutter --version
mutter 44.3
$ gsettings get org.gnome.mutter experimental-features
['scale-monitor-framebuffer', 'variable-refresh-rate']
Hardware & drivers
CPU: AMD Ryzen 5 2400G (8) @ 3.600GHz GPU: AMD ATI Radeon RX 5500/5500M / Pro 5500M$ inxi -G --display
Graphics:
Device-1: AMD Navi 14 [Radeon RX 5500/5500M / Pro 5500M] driver: amdgpu
v: kernel
Display: wayland server: X.Org v: 23.1.2 with: Xwayland v: 23.1.2
compositor: gnome-shell v: 44.2 driver: X: loaded: amdgpu
unloaded: fbdev,modesetting,radeon,vesa dri: radeonsi gpu: amdgpu
resolution: 1: 1920x1080~60Hz 2: 1920x1080~60Hz
API: OpenGL v: 4.6 Mesa 23.1.4 renderer: AMD Radeon RX 5500 XT (navi14
LLVM 15.0.7 DRM 3.52 6.3.12-205.fsync.fc38.x86_64)
Bug summary
With an AMD GPU, running Mutter with Wayland, having 2 displays connected to the GPU results in a lack of smoothness in animation throughout the OS in windowed applications.
This is readily present when viewing moving 2d graphics (such as on https://testufo.com using either Firefox or Chrome), scrolling through text, or dragging windows around.
TestUfo browser test fluctuates with a stable framerate of 30~38fps, occationally spiking to ~45fps, with the scrolling animation visibly stuttery. On Xorg, or while only a single monitor is connected, the framerate is locked solid at 60fps.
glxgears
is also both visually and statistically stuttery under this setup:
# Wayland
$ glxgears
Running synchronized to the vertical refresh. The framerate should be
approximately the same as the monitor refresh rate.
272 frames in 5.0 seconds = 54.397 FPS
259 frames in 5.0 seconds = 51.799 FPS
267 frames in 5.0 seconds = 53.227 FPS
265 frames in 5.0 seconds = 52.992 FPS
^C
# Xorg
$ glxgears
Running synchronized to the vertical refresh. The framerate should be
approximately the same as the monitor refresh rate.
305 frames in 5.0 seconds = 60.930 FPS
301 frames in 5.0 seconds = 60.004 FPS
300 frames in 5.0 seconds = 59.998 FPS
301 frames in 5.0 seconds = 59.988 FPS
Interestingly, this framerate issue temporarily fixes itself if a Youtube video is launched in Firefox. The issue stays present, however, if such a video is launched on Chrome.
No issues are present when running fullscreen video games (only two examples tested, CSGO (native) and BattleBit Remastered (proton-wine)).
Steps to reproduce
- Install Nobara 38
- Login in Wayland mode
- Attach 2 monitors to an AMD GPU (in my case an AMD 5500 XT)
- Observe stuttery behavior in the DE and Web browsers
What happened
Stuttery 2d compositing, worse than under Xorg
What did you expect to happen
Equal smoothness of animation as under Xorg
Relevant logs, screenshots, screencasts etc.
I'm not sure how to find any relevant logs, but if anyone can point me to them, I'll gladly post 'em.