LinuxGamingGuide
An incomplete compilation of things that may improve your gaming experience on Linux
Install / Use
/learn @AdelKS/LinuxGamingGuideREADME
A linux gaming guide
This is some kind of guide/compilation of things, that I got to do/learn about while on my journey of gaming on linux. I am putting it here so it can be useful to others! If you want to see something added here, or to correct something where I am wrong, you are welcome to open an issue or a PR !
Table of Content
- A linux gaming guide
- Table of Content
- Gaming kickstart
- Extras
- Advanced topics for those interested
Gaming kickstart
Gaming on Linux has never been easier
- Chose your Linux distribution
- Install your GPU drivers
- AMD
- Needs
mesa, which ships theRADVvulkan driver. Probably already part of the base distro
- Needs
- Nvidia
- RTX 2000 and newer: install Nvidia's "open" driver
- Older GPUs: use Nvidia's "closed" driver
- AMD
- Install the Steam client (prefer a distro that ships it so dependencies get properly pulled)
- If the games you want to run isn't in Steam, see Prefix managers
- Game on!
Extras
Performance overlays
Performance overlays are small "widgets" that stack on top of your game view and show performance statistics (framerate, temperatures, frame times, CPU/RAM usages... etc). Two possibilities:
- Recommended: MangoHud
- Available in the repositories of most linux distros
- To activate it, add the environment variable
MANGOHUD=1 - Configuration
- Config files/env vars: HUD Configuration.
- GUI: GOverlay
- Ideal for benchmarking.
- Fallback: DXVK
- Has its own HUD and can be enabled by setting the variable
DXVK_HUD- The possible values are explained in its repository
- Has its own HUD and can be enabled by setting the variable
SteamTinkerLaunch
Steam Tinker Launch opens a window after starting a game from Steam that offers adding in various tweaks before actually starting the game.
Steam Tinker Launch is a versatile Linux wrapper tool for use with the Steam client which allows for easy graphical configuration of game tools, such as GameScope, MangoHud, modding tools and a bunch more. It supports both games using Proton and native Linux games, and works on both X11 and Wayland.
Make sure to follow these instructions.
Game mode
GameMode is wrapper script that puts your computer in performance mode:
- Changes the CPU frequency scaling to
performance - Can change the game's processes priority
- Can change the GPU's power profile
- (see config) to see what it can offer
How to use:
- Archwiki entry on GameMode
- SteamTinkerLaunch can be set to use it
- Lutris uses it automatically if it's detected
Is it running ?
- Run the command
gamemoded -s. - Waybar can be setup to show the state of GameMode.
streaming: OBS
OBS is the famous open source streaming software: it helps streaming and recording your games, desktop, audio input/output, webcams, IP cameras... etc.
obs-vkcapture: low-overhead game capture method
obs-vkcapture implements the "dma-buf" sharing protocol for capturing games with low/no overhead.
To use it:
-
Use
game captureas "source" in OBS-
You may need to run
obs-studiowith the environment variable,OBS_USE_EGL=1OBS_USE_EGL=1 obs
-
-
Run your game with either
OBS_VKCAPTURE=1environment variable- or: prepend your game launch with
obs-vkcapture %command% - Note: SteamTinkerLaunch can help with that
GPU Encoders
- AMD GPUs, prefer using
ffmpeg-vaapito leverage the GPU for encoding. - NVidia GPUs, prefer using
nvencto leverage the GPU for encoding.
Software encoding on AMD Ryzen CPUs
If you want to use a software encoder, it's a very good idea to manually assign separate CCX/CCDs for the game and OBS on AMD CPUs that have more than two. I benchmarked it and it makes a difference.
Saving replays
OBS: replay Buffer
OBS offers saving the last X seconds of your gaming session in RAM, and it saves it to a file once you press a pre-defined keyboard shortcut.
To enable it:
- Settings > Output > Replay Buffer > Enable Replay Buffer
- You can also set there how long is the saved window
- This adds a new button the the main window: "Start replay buffer"
- It will keep in RAM the last X seconds all the time
- While "replay buffer" is started and running, you can either
- press the "save" button that is right next to "stop replay buffer"
- trigger the keyboard shortcut for "save replay"
gpu-screen-recorder
gpu-screen-recorder is a cli, GUI and overlay tool for recording, replay and streaming efficiently with the GPU.
You can run this command with GameMode to be able to save replays with a hotkey. Needs more prep on wayland.
gpu-screen-recorder -w DP-1 -f 60 -q medium -r 20 -k av1 -bm vbr -c webm -ac opus -a "$(pactl get-default-sink).monitor" -o /tmp -v no -sc scripts/clip_upload.sh > /tmp/gamemode.log 2>&1
Useful examples are here.
Linux distribution recommendation
If you are hesitating on what Linux distribution to use. Here's this guide's recommendation:
The reasons for the recommendation:
- To get the best performance, one simply needs the latest updates, as soon as possible.
- Cutting-edge new gaming tools are shipped on those distributions first
CachyOS
- Based on Archlinux
- Rolling-release distro: packages continuously get updated.
- Ships package updates just few days after they get released. While remaining perfectly stable.
- Has a specific Gaming guide
- Many kernels to chose from
CachyOS does compile packages with the x86-64-v3, x86-64-v4 and Zen4 instruction set and LTO to provide a higher performance. Core packages als
