protonscr

[Gnome 3 Shell] Preformace Drop

steamclosed reviewedWindow manager
ValveSoftware/steam-for-linux#2163 · opened 2013-03-15 by Half-Shot · updated 2014-02-13 · 25 comments · github
HHalf-Shot 2013-03-15 github

I have noticed that the standard Gnome 3 shell (3.6) has a large performance drop on source based games vs the bundled gnome classic. Not sure at which end the problem lies.

Processor Information:
    Vendor:  AuthenticAMD
    Speed: 1500 Mhz
    4 logical processors
    4 physical processors
    HyperThreading:  Unsupported
    FCMOV:  Supported
    SSE2:  Supported
    SSE3:  Supported
    SSSE3:  Unsupported
    SSE4a:  Supported
    SSE41:  Unsupported
    SSE42:  Unsupported

Network Information:
    Network Speed:  

Operating System Version:
    Ubuntu 12.10 (64 bit)
    Kernel Name:  Linux
    Kernel Version:  3.5.0-25-generic
    X Server Vendor:  The X.Org Foundation
    X Server Release:  11300000
    X Window Manager:  Metacity
    Steam Runtime Version:  steam-runtime-release-i386_2013-03-08

Video Card:
    Driver:  ATI Technologies Inc. AMD Radeon HD 6520G
    Driver Version:  4.2.12172 Compatibility Profile Context 12.10.17
    Desktop Color Depth: 24 bits per pixel
    Monitor Refresh Rate: 59 Hz
    VendorID:  0x1002
    DeviceID:  0x9647
    Number of Monitors:  1
    Number of Logical Video Cards:  1
    Primary Display Resolution:  1366 x 768
    Desktop Resolution: 1366 x 768
    Primary Display Size: 13.54" x 7.64"  (15.51" diag)
                                            34.4cm x 19.4cm  (39.4cm diag)
    Primary VRAM Not Detected

Sound card:
    Audio device: ATI R6xx HDMI

Memory:
    RAM:  3427 Mb

Miscellaneous:
    UI Language:  English
    LANG:  en_GB.UTF-8
    Microphone:  Not set
    Total Hard Disk Space Available:  187739 Mb
    Largest Free Hard Disk Block:  61155 Mb
Jjohndrinkwater 2013-03-16 github

Have you set ‘Unredirect Fullscreen Windows’ under gnome 3? I imagine that’s the issue here.

HHalf-Shot 2013-03-18 github

I thought that was a option in compiz. My gnome setup dosn't use that.

Mmagcius 2013-05-01 github

GNOME 3 automatically unredirects some full-screen windows. Games (or SDL2) don't set the recently added _NET_WM_BYPASS_COMPOSITOR hint, so we fall back to heuristics: a non-ARGB32 full-screen / monitor-sized window that does 100 full-screen redraws in a row. If that happens, then the window should be unredirected. I'll see if I can test this in TF2, once I manage to get it working.

Nnmirthes 2013-05-08 github

Has this netwm hint been implemented yet in current SDL2?

Mmagcius 2013-05-08 github

No. I wanted to submit a patch to the list, but I haven't been able to get SDL from hg to compile properly. It has some weird linker issues.

Mmagcius 2013-05-14 github

I investigated this with the beta of Portal and I can confirm that it does unredirect windows. However, with my crummy Ironlake, it takes around 10 seconds of uninterrupted full-screen display for it to unredirect.

Are you sure that you have the game playing full-screen and that you do not see the same delays with metacity?

Nnmirthes 2013-05-14 github

How are you confirming an unredirected window? As I (dimly) understand it, mutter/clutter should detect an override redirect attribute on the window, disable the compositor(?), and avoid redirecting the window. This doesn't appear to happen for me on Ubuntu Gnome (gnome 3.6 and 3.8). I need to export CLUTTER_PAINT=disable-clipped-redraws:disable-culling to eliminate tearing if running gnome-shell. i'd assume SDL2 full-screen windows would need _NET_WM_BYPASS_COMPOSITOR and such to make this happen consistently.

I've done some rudimentary benchmarks with Lost Coast:

Gnome fall-back session - 156 fps
Gnome session - 110 fps
Gnome session with clutter variable - 135 fps

This is with vblank disabled for both the driver and the game.

Processor Information:
    Vendor:  GenuineIntel
    Speed: 2393 Mhz
    4 logical processors
    4 physical processors
    HyperThreading:  Unsupported
    FCMOV:  Supported
    SSE2:  Supported
    SSE3:  Supported
    SSSE3:  Supported
    SSE4a:  Unsupported
    SSE41:  Unsupported
    SSE42:  Unsupported

Network Information:
    Network Speed:

Operating System Version:
    Ubuntu 13.04 (64 bit)
    Kernel Name:  Linux
    Kernel Version:  3.8.0-19-generic
    X Server Vendor:  The X.Org Foundation
    X Server Release:  11303000
    X Window Manager:  GNOME Shell
    Steam Runtime Version:  steam-runtime-release-i386_2013-05-08

Video Card:
    Driver:  NVIDIA Corporation GeForce GTS 250/PCIe/SSE2

    Driver Version:  3.3.0 NVIDIA 310.44
    Desktop Color Depth: 24 bits per pixel
    Monitor Refresh Rate: 59 Hz
    VendorID:  0x10de
    DeviceID:  0x615
    Number of Monitors:  1
    Number of Logical Video Cards:  1
    Primary Display Resolution:  1680 x 1050
    Desktop Resolution: 1680 x 1050
    Primary Display Size: 18.66" x 11.65"  (21.97" diag)
                                            47.4cm x 29.6cm  (55.8cm diag)
    Primary Bus: PCI Express 16x
    Primary VRAM: 1024 MB
    Supported MSAA Modes:  2x 4x 8x 16x

Sound card:
    Audio device: AV200

Memory:
    RAM:  3888 Mb

Miscellaneous:
    UI Language:  English
    LANG:  en_CA.UTF-8
    Microphone:  Not set
    Total Hard Disk Space Available:  447150 Mb
    Largest Free Hard Disk Block:  326700 Mb

Installed software:

Recent Failure Reports:
Mmagcius 2013-05-14 github

I patched mutter to print out when a window becomes redirected, and ran Portal for a bit. It's possible there's a bug in the X server or in mutter that causes unredirection not to work.

Mmagcius 2013-05-14 github

Also, are those numbers with GNOME 3.6 or with 3.8? The workaround that's supposed to detect Source games has only been implemented in 3.8.

Mmagcius 2013-05-14 github

I managed to get SDL2 compiled and running and filed a patch at http://bugzilla.libsdl.org/show_bug.cgi?id=1852 .

Nnmirthes 2013-05-14 github

Nice! Numbers are from Gnome 3.6. I'd had 3.8 installed via a testing repo, but downgraded.

Mmagcius 2013-05-14 github

Check again with GNOME 3.8. Both the heuristic and hint are only implemented there.

Nnmirthes 2013-05-14 github

Three runs of Lost Coast with no demanding processes:
Gnome 3.8.1 - 156 fps
Openbox 3.5.x - 156 fps

It also seems I no longer need the clutter environment variable. I'd have sworn the compositor-related tearing was present under both 3.6 and 3.8. Either I missed something, or updates have fixed the issue.

Mmagcius 2013-05-14 github

Good to know it's fixed in GNOME 3.8.

Nnmirthes 2013-05-15 github

Seems I hadn't missed anything. I'm now back to reduced fps and tearing resulting from what I assume is mutter/clutter redirecting the window.

Mmagcius 2013-05-15 github

Under 3.8? Have you waited for 10 or so seconds of the window being full-screen to be unredirected?

Nnmirthes 2013-05-15 github

Yes, 3.8 and multiple changes to try to track what was happening. Back to 110 fps in the Loast Coast stress test and tearing identical to [#627](https://github.com/ValveSoftware/Source-1-Games/issues/627)

I've just moved to Nvidia's 313 series driver from 310 and the tearing is gone. However, frame rate is at 132 fps.

Mmagcius 2013-05-15 github

Does the Clutter environment variable affect FPS under the new driver?

Nnmirthes 2013-05-15 github

Indeed, the clutter environment variable puts the frame rate back up toward parity with Openbox (155-ish).

Mmagcius 2013-05-30 github

The issue has been found and fixed upstream: https://bugzilla.gnome.org/show_bug.cgi?id=701224

Nnmirthes 2013-05-31 github

Well that bug report explains much of my confusion. Good news!

Nnmirthes 2013-07-16 github

Or not. The Gnome 3.8.x repo I'm using finally started pushing Gnome 3.8.3 packages, which I assume have the patches mentioned in https://bugzilla.gnome.org/show_bug.cgi?id=701224

I'm still losing ~20 fps under Mutter+Gnome Shell

Ddrago01 2013-07-21 github

@nmirthes

It got broken in 3.8.3 again due to another patch. I have fixed it again (fix is in the 3.8 branch but 3.8.4 has not been released yet).

You can apply this mutter patch: https://git.gnome.org/browse/mutter/commit/?h=gnome-3-8&id=7b36dcf4a06bbb69231ab360356c269f9e7ccce8 to fix it.

See https://bugzilla.gnome.org/show_bug.cgi?id=701224#c32

HHalf-Shot 2014-02-13 github

Closing loose ends, works fine in Arch, Gnome 3.10.

Nothing extracted yet.