Bug 108330 - WarThunder game performance killed after Ryzen optimisations
Summary: WarThunder game performance killed after Ryzen optimisations
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Gallium/radeonsi (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Default DRI bug account
QA Contact: Default DRI bug account
Depends on:
Blocks: mesa-18.3
  Show dependency treegraph
Reported: 2018-10-11 22:44 UTC by aceman
Modified: 2018-11-26 06:48 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Description aceman 2018-10-11 22:44:16 UTC
After the recent optimisation of radeonsi for Ryzen CPUs (apparently change in thread management distributing them to CPU cores), the performance of the WarThunder game dived radically.

Normally it was 40-60FPS. After the change it appears OK when in plain fields, but when moving the vehicle into a more intensive area, where shots are fired or other player vehicles are around, the FPS drops to 0-10 with really noticeable freezes and stuttering. This was never the case before the change,

The GPU is Radeon RX 560 (4GB memory).

The CPU is AMD Threadripper 1920x (12 cores/24 threads) so it may be one where the optimisations are applied. Are Threadripper CCX/core layout properly recognized by the patch for Ryzen?

Before the patch I noticed, the speed of the game can be visibly negatively affected if other tasks are running on the CPU. So I always run the game with no other CPU heavy tasks running. The report is also with no other tasks. It may be the change of thread scheduling from the patch has now invoked the core/thread load scenario the game is sensitive to.

I run Mesa from git so I noticed this problem when it was merged.

Now running on Mesa 18.2.2 stable and the problem is not there.
Comment 1 Emil Velikov 2018-10-30 17:44:30 UTC
Just to double-check, you're talking about commit 28e542dcdbb "gallium/u_threaded: increase batch size to increase performance"

Marek, Ken do you have any suggestions?
Comment 2 aceman 2018-10-30 18:05:16 UTC
No, I assume it was
as that one was reported at https://www.phoronix.com/scan.php?page=news_item&px=RadeonSI-Zen-Tuning-Merged and that is the tie the problem started.
Comment 3 aceman 2018-11-09 19:12:43 UTC
Could we get a patch like https://lists.freedesktop.org/archives/mesa-dev/2018-November/208785.html so that I can try to turn off the L3 cache thread pinning for this game?
Comment 4 Alex Deucher 2018-11-09 19:59:41 UTC
(In reply to aceman from comment #3)
> Could we get a patch like
> https://lists.freedesktop.org/archives/mesa-dev/2018-November/208785.html so
> that I can try to turn off the L3 cache thread pinning for this game?

Just use that patch and add an entry for your game like this:

> +        <application name="Blender" executable="blender">
> +            <option name="disable_L3_thread_pinning" value="true"/>
> +        </application>
> +

replace blender with the name and executable of your app.
Comment 5 aceman 2018-11-09 23:57:05 UTC
Good idea:)
I did that, but it seems to not help in any way.
How do I check if the option is picked up?

Why is drirc now called 00-mesa-defaults.conf ? Where should it be put in /etc ?
Comment 6 aceman 2018-11-13 19:33:37 UTC
So strangely the patch didn't work, but updating mesa today (presents itself as 19.0.0), containing the commit https://cgit.freedesktop.org/mesa/mesa/commit/?id=e0c7114eb3c19d4c2653f661698a6baa3bc9bedf FIXES the problem immediately.
The current mesa is even faster than 18.2.x that I had to use while this problem was existing.
Comment 7 Emil Velikov 2018-11-16 15:14:04 UTC
As pointed out L3 thread pinning is disabled now. With the commit present in both master and 18.3.0-rc3.
Comment 8 aceman 2018-11-26 06:48:41 UTC
And the new version of the patch, https://cgit.freedesktop.org/mesa/mesa/commit/?id=bc5adc27b5e52d27eca6a61ad1e049b160570c98 seems to work OK. WarThunder has mesa_glthread=true in drirc.

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.