Improving Performance
By /u/mutdan14
(This guide is an edited and reformatted version of an excellent Reddit post and was republished here with permission.)
When I started using Linux a couple months ago I found that resources on how to maximize performance in games was quite segregated across various places and posts online which made my first few days quite frustrating especially having a low end PC so my goal of this guide is to try and put everything together. These improvements were tested on Manjaro, but should apply to other distros, though installation instructions may differ.
Shader Caching
Shader caching is a strategy to reduce stuttering and improve overall performance by 'prebaking' some of the work your GPU has to do before it has to do so in-game.
AMD GPUs
Valve is working on ACO, a shader compiler that requires Mesa version 19.3 or higher.
For Arch-based distros (i.e. Arch, Manjaro)
- Get the mesa-git package from the AUR and add
RADV_PERFTEST=aco
as an environment variable for each game - OR get the mesa-aco-git package which has ACO enabled by default
For Ubuntu-based distros (i.e. Ubuntu, Pop_OS!, Mint)
- Use this PPA
You can also use the environment variable mesa_glthread=true
for OpenGL games.
NVidia GPUs
Make sure that you have the latest Nvidia drivers installed on your system. You can use these environment variables:
__GL_THREADED_OPTIMIZATION=1
for OpenGL games__GL_SHADER_DISK_CACHE=1
to create a shader cache for a game__GL_SHADER_DISK_CACHE_PATH=/path/to/location
to set the location for the shader cache.
Overclocking
For overclocking your AMD GPU, I would recommend this guide.
Feral Gamemode
Feral gamemode is a tool that applies automatic tweaks to your system when running games which can improve performance. Generally, this can result in games becoming a bit smoother with a small increase to performance.
Arch-based installation
- Install the gamemode and lib32-gamemode packages from AUR
Ubuntu-based installation:
- Use this PPA
To use gamemode
- Launching from Lutris: Select the “Enable feral gamemode” option under “System Options”
- Launching from Steam: enter
gamemoderun %command%
into the game's launch options.
You can verify that gamemode is working by entering gamemoded -s
into terminal while a game is running.
D9VK or Gallium Nine
For DirectX 9 games you can use D9VK, which Proton uses by default when given the PROTON_USE_D9VK=1
launch flag. Alternatively, there is Gallium Nine for AMD or Intel GPUs. I would recommend using D9VK as it has produced better results for me than Gallium Nine but if you are not satisfied with D9VK performance, Gallium Nine is worth a try.
Gallium Nine Installation:
- Use Winetricks or Protontricks
- Ensure it is enabled by running the command
wine ninewinecfg
for 32-bit, orwine64 ninewinecfg
for 64-bit from the System32 folder of the wine prefix.
Desktop environment
There is a performance difference between desktop environments depending on their base RAM and CPU usage, but it is very small between most of them so I would recommend just choosing the one you prefer. If you do want to eke out the most performance, you may wish to read this analysis,
In short, LXDE was the measured as the fastest desktop environment for gaming, while XFCE with compositor disabled came in second fastest out of the ones tested. If you need the maximum performance XFCE may be a good compromise between looks vs performance. You can use the “Disable desktop effects” option in Lutris which may reduce the overhead of the desktop environment further.
More Advanced Options
The following should be considered more advanced solutions, but if you're comfortable building from sources or installing kernels, please proceed!
Custom Proton Builds
Proton's versioning scheme mimics its upstream project, WINE. Its first two numbers (i.e. 4.11) correspond to the WINE version it is derived from. Proton trails behind the latest versions of WINE, which may include improvements that have yet to land for the official Proton build. In addition, some features may not be included with official Proton builds due to licensing restrictions.
For optimal performance and compatibility, you may benefit from trying a custom Proton build. Two popular ones are:
These custom versions are currently based on a newer version of Wine, have a newer DXVK and D9VK version, and have additional patches applied to improve compatibility. You can install a custom version of proton by downloading the top file from the links above under assets (not the source code) and extracting it.
For the TKG proton build you will need to put the extracted files inside a folder such as “Proton-TKG”. You will then need to create a folder called compatibilitytools.d
in the directory /home/YourUsername/.steam/root
and then place the proton folder inside and the custom version should appear within Steam or Lutris.
If you are using the standard Proton version, D9VK is not enabled by default so you will need to enter the command PROTON_USE_D9VK=1
as a launch option.
Fsync and Esync
Proton has had esync since its first release, which aims to reduce the performance overhead of Wine, especially in CPU bound scenarios. Fsync is a more recent alternative with even better performance improvements. However, you do need a kernel that supports it, and if your kernel does not, it should be considered an 'advanced' step compared to others in this guide. Installation instructions for the necessary kernels are here.
Within Steam, Esync is enabled by default, and Fsync is enabled by default if your system supports it. In Lutris, for Esync you need to enable in in the runner options, and for Fsync you can add WINEFSYNC=1
as an environmental variable.