Revision as of 10:49, 6 February 2018

Contents

Mesa glthread

Mesa developers are looking for feedback about which games benefit from Mesa's glthread implementation (OpenGL multithreading), also known as threaded dispatch. The functionality is disabled by default, but games known to benefit from this feature are then whitelisted in global mesa configuration file. This functionality is available for all Mesa drivers (RadeonSI, R600, Nouveau, Intel). Help them figure out the impact on your favorite games.

How to test

Enabling glthread

By default, it's off. To enable it, you can run the game from terminal with an environmental variable set:

$ mesa_glthread=true /path/to/your/game/executable

In steam, you can go into Properties -> Set Launch Options and use

mesa_glthread=true %command%

You can also modify a .desktop launcher for a game:

Exec=env mesa_glthread=true /path/to/your/game/executable

Alternatively, you can modify /etc/drirc accordingly.

Measuring FPS

If your game doesn't have a benchmark mode, go to an (ideally static) game location and observe the FPS on the screen.

Please note that the first execution of a game with updated drivers shows more stuttering (and therefore has lower average FPS in benchmarks) due to recompilation of shaders. Perform the test at least twice to verify results.

How to show a FPS counter:

Steam: If you run a game through Steam, simply enable FPS counter in Settings -> In-Game -> In-game FPS counter.

GALLIUM_HUD: Use GALLIUM_HUD=fps environment variable to show a FPS overlay. The basic command is:

$ GALLIUM_HUD=fps /path/to/your/game/executable

(as usual, replace game executable with %command% if you're setting this in Steam).

If you want to combine that with enabling glthread on a command line, it would look like:

which adds 3 more HUD charts. The API charts on the HUD show glthread counters. If they are 0 while playing (not in menu or during loading), glthread is force-disabled. Even if you enable glthread, Mesa can still decide to disable it for compatibility. In order to have a good chance of having higher performance, API-thread-offloaded-slots must be 2x or higher than API-thread-direct-slots. It's recommended to have a slower CPU compared to the GPU.

Finding the executable name

It's important to find the correct executable name so that Mesa can detect when this particular game is running. The easiest way is probably to run htop, the process is likely to consume lots of CPU and it will be somewhere on top (or you can use F5 Sorted view to see which child processed are spawned by steam, or GOG's start.sh script). Another option is to look at ps aux output.

Configuring game graphics settings

Mesa glthread can only help you when the CPU is the bottleneck of rendering, not when you're GPU-limited. So don't run in 4K on Ultra settings, if you get 30 FPS, because you'll be likely GPU-limited and you'll see no difference. Use graphics settings which yield reasonably high FPS (as you'd really like to play, e.g. 60-100 FPS), because then there's better chance you get CPU-limited and glthread can make some difference.

Results template

Use the following structure to document results. Several results for the same game (from different people) are useful - glthread might behave differently on different hardware.

Game name

Executable name

Improves performance

Performance description

Tester name

Date tested

Hardware used

Mesa version

Bioshock Infinite (EXAMPLE!)

bioshock.i386

yes/no/force-disabled

50% average FPS increase on max details in benchmark (70 -> 105 FPS)

YOUR_NICK

YYYY-MM-DD

Radeon R9 270X, Core i5-4570

17.2.0-0.67.git7896dee.fc26

Improves performance = force-disabled means glthread can't be enabled even if you specify mesa_glthread=true. That can be discovered by using GALLIUM_HUD. See Measuring FPS.

glthread can't be enabled (GALLIUM_HUD=API-thread* counters show zero), but on the other hand when running the integrated video stresss test framerates are reproducible improving from ~138 fps to ~142 fps. Did another test with the PTS test profile at 2560*1440, settings maxed out. Framerate stays const. at 103 fps.

Styx85

2017-07-17

Radeon RX 480, AMD Athlon II X4 640

Mesa 17.2.0-devel (git-373f707fbb) Arch Rolling

Big Pharma

Big Pharma.x86

no

with and without glthread const. ~70fps

Styx85

2017-07-16

Radeon RX 480, AMD Athlon II X4 640

Mesa 17.2.0-devel (git-f25c7f9f3e) Arch Rolling

Bioshock Infinite

bioshock.i386

yes

framerate goes up from ~30fps to ~90 fps, +200%

Styx85

2017-07-16

Radeon RX 480, AMD Athlon II X4 640

Mesa 17.2.0-devel (git-373f707fbb) Arch Rolling

Jotun

Jotun.x86

no

settings maxed out at 2560*1440@144Hz , ingame option to turn of vsync has to be set to activated to turn it off + vblank_mode=0. Framerates go down from 250-520fps to 200-470fps

Styx85

2017-07-17

Radeon RX 480, AMD Athlon II X4 640

Mesa 17.2.0-devel (git-f25c7f9f3e) Arch Rolling

Jotun

Jotun.x86_64

no

settings maxed out at 2560*1440@144Hz , ingame option to turn of vsync has to be set to activated to turn it off + vblank_mode=0 +%command%_64 for 64bit bin. Framerates go down from 280-520fps to 250-470fps

using gallium hud, each half second recording the framerate to a file, and then putting that file into libreoffice calc and averaging all of the output i got 61.2 without glthread enabled and 68.4 with glthread enabled. the game also seemed much smoother with glthread enabled, in critical places the framerate didnt drop so badly and it overal seemed to stay in the 100+ range but there were probably outliers bringing the average down. i played a single player exhibition match on the snowy stadium with no bots for five minutes each time, basically just driving in circles and scoring and trying to fly. all settings maxed, no antiliasing, no vsync, no changes to camera settings (so the fov was 90).

no change in FPS during a match, API-thread-direct-slots are much higher than API-thread-offloaded-slots

ripper

2017-07-17

Radeon R9 270, Core i5-4570

mesa-dri-drivers-17.2.0-0.70.git5ffe0c9.fc26, Fedora 26

Jotun

Jotun.x86_64

no

game is hard-capped to 60 FPS (even with disabled vsync in-game and using vblank_mode=0). No difference in smoothness. API-thread-offloaded-slots numbers are about the same as API-thread-direct-slots numbers. (I believe Styx85's opposite result is the outcome of a few dropped frames with vsync, thus going to 30 FPS momentarily. The intro is animated, not 3D, and the API-thread* numbers don't suggest there should be an improvement there).