Bug 100529 - Xwayland (from X.org server 1.19.2) takes all CPU and is very slow on ATI R300 because of glamor
Summary: Xwayland (from X.org server 1.19.2) takes all CPU and is very slow on ATI R30...
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/Acceleration/glamor (show other bugs)
Version: unspecified
Hardware: IA64 (Itanium) Linux (All)
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL: https://lists.x.org/archives/xorg-dev...
Depends on:
Reported: 2017-04-02 09:49 UTC by Émeric Maschino
Modified: 2018-12-13 18:26 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Description Émeric Maschino 2017-04-02 09:49:53 UTC

This BR is similar to bug #88316, but in the opposite way, it seems. Let me explain.

I'm running Gentoo Linux on an ia64 workstation (probably irrelevant here) sporting an ATI FireGL X1 graphics adapter (PCI ID 1002:4e47), the professional equivalent to ATI Radeon 9700 Pro cards.

When running GNOME 3.22 on X11, glxinfo reports that I'm using Gallium 0.4 on ATI R300 as OpenGL renderer (Mesa 13.0.5). That's fine and GL apps are running OK.

When running GNOME 3.22 on Wayland, glxinfo reports that I'm using Gallium 0.4 on softpipe as OpenGL renderer and GL apps are barely usable.

Bug #88316 told me this could be related to glamor. So I first ensured that I can enable glamor acceleration (rather than EXA) for my graphics adapter under GNOME on X11. Enabling DRI3 wasn't a problem, but glamor refuses to initialize, reporting in /var/log/Xorg.0.log:

glamor requires at least 128 instructions (64 reported).

Haha, hence the reason. Googling for this error deeper, I found it comes from a check added in glamor [1] to prevent weak hardware (such as in bug #88316) to enable glamor and get terrific performances.

As a quick test, I've rebuilt my X.org server 1.19.2, lowering GLAMOR_MIN_ALU_INSTRUCTIONS in glamor/glamor_priv.h from 128 to 64, to match the value reported by my graphics adapter. glamor acceleration was then successfully enabled under GNOME 3.22 on X11. Furthermore, running GNOME 3.22 on Wayland was a globally smoother experience (it appears that GNOME Shell itself is still using Xwayland), glxinfo no more reports Gallium 0.4 on softpipe as OpenGL renderer (but Gallium 0.4 on ATI R300) and GL apps are running near-X11 performances.

Where I'm puzzled is why failing to enable glamor (for 2D hardware acceleration) also falls back to 3D software rendering?



[1] https://lists.x.org/archives/xorg-devel/2015-February/045527.html
Comment 1 Olivier Fourdan 2017-04-05 14:19:50 UTC
DRI3 support in Xwayland relies on glamor:

Comment 2 Émeric Maschino 2017-04-05 22:45:53 UTC
(In reply to Olivier Fourdan from comment #1)
> DRI3 support in Xwayland relies on glamor:
> https://cgit.freedesktop.org/xorg/xserver/tree/hw/xwayland/xwayland-glamor.
> c?h=server-1.19-branch#n574

OK, but what happens for Xwayland when glamor cannot be initialized? It's apparently not completely disabled, so how does it then work without glamor?

Comment 3 Michel Dänzer 2017-04-06 02:24:37 UTC
When glamor fails to initialize, Xwayland and all X clients use software rendering.

Lowering GLAMOR_MIN_ALU_INSTRUCTIONS might just happen to work as long as you don't hit any functionality using shaders which actually need more instructions.
Comment 4 GitLab Migration User 2018-12-13 18:26:04 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/xserver/issues/105.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.