8.7 KiB
title, description, published, date, tags, editor, dateCreated
title | description | published | date | tags | editor | dateCreated |
---|---|---|---|---|---|---|
07 Gaming | true | 2023-05-03T05:36:10.081Z | markdown | 2023-04-28T08:00:15.742Z |
Introduction
So if you want to play games on your machine you might want to follow this guide
Enable Multilib
Steam is a 32 bit application, like many of the games in its library, So to be able to install it we need to add multilib to our 64 bit system.
Edit /etc/pacman.conf and uncomment the multilib section.
sudo vim /etc/pacman.conf
Remove the # in front of all the multilib section lines so that section looks like this
[multilib]
Include = /etc/pacman.d/mirrorlist
Now simply update the system to enable 32 bit applications
sudo pacman -Syyuu
If you are running KDE be sure to install lib32-fontconfig with the following command
sudo pacman -S lib32-fontconfig
GPU Drivers
Having the right GPU drivers is imporant, else games won't run properly.
If you have a GTX9xx or newer you need the newest drivers, If you even have an older card, manually check which driver you need: https://www.nvidia.com/Download/index.aspx?lang=en-us But install them trough the AUR.
Nvidia For the newest Nvidia you need these packages so install them.
sudo pacman -S nvidia-dkms nvidia-settings nvidia-utils lib32-nvidia-utils lib32-opencl-nvidia opencl-nvidia libvdpau libxnvctrl vulkan-icd-loader lib32-vulkan-icd-loader
AMD you need these packages so install them if you have a AMD GPU
sudo pacman -S mesa lib32-mesa mesa-vdpau lib32-mesa-vdpau lib32-vulkan-radeon vulkan-radeon glu lib32-glu vulkan-icd-loader lib32-vulkan-icd-loader
Now update and reboot
sudo pacman -Syu && sudo reboot
If you use Gnome or GDM with Nvidia you might need to disable Wayland, This is not always the case, But I include it here just in case, If your System won't reboot you can try this
sudo vim /etc/gdm/custom.conf
Remove the # in front of the #WaylandEnable=false line and it should force Xorg.
Feral Gamemode
Gamemode puts all your hardware in performance mode, it fixes some common problems and it just sounds cool :P
Gamemode is in the repos these days, so simply run the following command to install gamemode.
sudo pacman -S gamemode lib32-gamemode
Now that it is installed we need to enable the service with this command
systemctl --user enable gamemoded && systemctl --user start gamemoded
To use gamemode for supertuxkart for example, run this terminal
gamemoderun supertuxkart
To use it in Steam edit the launch option for the desired game to
gamemoderun %command%
Nvidia Improvements
Nvidia users might want to enable all options listed here to improve performance in games
Force Full Composition Pipeline avoids screen tearing by letting the GPU do all the scaling. Triple Buffer avoids stuttering gameplay It allows for a stream of data instead of chunks of data. IndirectGLXProtocol forces the game to directly communicate with the Nvidia drivers. Coolbits enables your card to be overclocked which gamemode will make use of.
Create a Xorg Config file:
sudo nvidia-xconfig
Move it to the right directory:
sudo mv /etc/X11/xorg.conf /etc/X11/xorg.conf.d/20-nvidia.conf
Edit the file with the following command
sudo nano /etc/X11/xorg.conf.d/20-nvidia.conf
Add in these lines under the "Device" section between the other options
Option "TripleBuffer" "on"
Option "Coolbits" "28"
Add in these lines under the "Screen" section between the other options. Don't add the ForceFullCompositionPipeline line if you want Gsync
Option "metamodes" "nvidia-auto-select +0+0 {ForceCompositionPipeline=On, ForceFullCompositionPipeline=On}"
Option "AllowIndirectGLXProtocol" "off"
Try this one with risk, It will be sure to crash GNOME, I am not sure about other DEs
just add it to the end of the file
Section "Extensions"
Option "Composite" "Disable"
EndSection
If you run into any problems, just hit CTRL ALT F3 to switch to a different tty login, run the command to edit the file again and put a # in front of the options that are giving you trouble and reboot
Alternatively you can just completely remove the file with the following command and reboot
sudo rm /etc/X11/xorg.conf.d/20-nvidia.conf
Libstrangle
Libstrangle is a tool that helps you control framerates but also vsync settings. This is especially handy for games that do not support these features, You would like to half your framerate to make it run better save some power or just give your hardware a break.
Install it with the following command
git clone https://aur.archlinux.org/libstrangle.git && cd libstrangle && makepkg -si && cd
Libstrangle can be used in multiple ways depending on what you want to achieve.
To use libstrangle you can simply type strangle and then the amount of frames you want to run. There are some examples below, But the features you will probably use are Vsync which you use by using the -v option, the rules for OpenGL and Vulkan are different, Here is what each number does for the different apis.
OpenGL 0 Force off, 1 Force on, n - Sync to refresh rate Vulkan 0 Force off, 1 Mailbox mode, 2 Traditional vsync, 3 Adaptive vsync
You can also limit the game depending on the power state of your device, Set it to 60 while charging and on 30 while discharging for example. You do this by adding a second number right after a colon. in example, strangle 60:30. There are more features but they are not that commonly used, you can check the gitlab link above or simply type strangle -h for more information.
To limit the framerate of supertuxkart to 30 simply run
strangle 30 supertuxkart
To Force enable vsync on 60 fps for an OpenGL Steam game set the launch option to
strangle -v 1 60 %command%
To set the framerate of a vulkan game on Steam to 120 fps but 60 on battery power with adaptive vsync set this as your launch command
strangle -v 3 120:60 %command%
Mangohud
Mangohud is a monitoring tool for Vulkan and OpenGL applications. It can show CPU and GPU usage, temps, But also framerates, frametimes and a lot more.
Install it with the following command
git clone https://aur.archlinux.org/mangohud.git && cd mangohud && makepkg -si && cd
Don't forget about the 32bit version
git clone https://aur.archlinux.org/lib32-mangohud.git && cd lib32-mangohud && makepkg -si && cd
To configure it with a GUI you can check out GOverlay below. For a manual configuration you can edit
~/.config/MangoHud/MangoHud.conf
If you want exactly my configuration you can just copy this into it without the need for GOverlay.
background_alpha=0.3
font_size=20
background_color=020202
text_color=ffffff
position=top-right
no_display
toggle_hud=F11
cpu_stats
cpu_temp
cpu_color=007AFA
gpu_stats
gpu_temp
gpu_color=00BD00
ram
ram_color=B3000A
vram
vram_color=00801B
io_read
io_write
io_color=B84700
arch
engine_color=B200B0
frame_timing=1
frametime_color=00ff00
#output_file=/home/houtworm/mangohud_log_
#fps_limit 120
#media_player
#toggle_logging=F10
You can tweak all the little things you want here. You can also create different configurations per game by adding a MangoHud.conf file to the game directory.
To use it for any game change its launch option to
mangohud %command%
To use it with non Steam games use the following command
mangohud supertuxkart
Some games might need the 32 bit version, try this if the normal command fails.
mangohud.x86 %command%
VKBasalt
VKBasalt is a post processing layer for Vulkan which enables you to enhance graphics further. It only works with Vulkan, This includes all Proton games.
Install it with the following command
git clone https://aur.archlinux.org/vkbasalt.git && cd mangohud && makepkg -si && cd
To configure it first you need to create a config file, Run the following command to copy the example to a folder you can edit as the user.
mkdir ~/.config/vkBasalt && cp /usr/share/vkBasalt/vkBasalt.conf.example ~/.config/vkBasalt/vkBasalt.conf
You can tweak all the little things you want here. You can also create different configurations per game by adding a vkBasalt.conf file to the game directory.
To use VKBasalt for any particular game enter this as a launch option.
ENABLE_VKBASALT=1 %command%
You can also start non Steam games this way by typing the following command
ENABLE_VKBASALT=1 supertuxkart
GOverlay
GOverlay is a Graphical User Interface for managing MangoHud and VKBasalt
git clone https://aur.archlinux.org/vkbasalt.git && cd vkbasalt && makepkg -si && cd
mesa-demos and vulkan-tools are optional, You need them if you want to show the previews. Install them with the following command
sudo pacman -S mesa-demos vulkan-tools
AOC Compiler
WIP!
fsync
WIP!
Freesync
WIP!
Gsync
WIP!
Monitor switching hotkey
WIP!
disabling composition
WIP!
Open Joystick Display
WIP!
Gamescope
WIP!
Using a separate special gaming DE at login
WIP!