Gaming +MangoHud +GameMode

Linux gaming is growing steadily with a lot of high quality titles. With more games the need for tools and helpers is increasing, luckily there are great applications already.

MangoHud + FPS limiter

MangoHud (license MIT, https://github.com/flightlessmango/MangoHud) is a HUD for Vulkan and OpenGL. On Vulkan it will show as well if the game runs on DXVK.

Since MangoHud 0.3.5 it will show the GPU and driver name. Plus it shows if the application is 64bit or still legacy 32bit.

Bugs:

  • Wayland support missing
  • Doesn’t work yet if the game uses a launch script

Config file example:

--COPY FROM /usr/share/doc/mangohud/MangoHud.conf.example
MangoHud configuration file
Uncomment any options you wish to enable. Default options are left uncommented
Use some_parameter=0 to disable a parameter (only works with on/off parameters)
Everything below can be used / overridden with the environment variable MANGOHUD_CONFIG instead
########## PERFORMANCE
Limit the application FPS
fps_limit=
VSYNC [0-3] 0 = adaptive; 1 = off; 2 = mailbox; 3 = on
vsync=3
OpenGL VSYNC [0-N] 0 = off; >=1 = wait for N v-blanks, N > 1 acts as a fps limiter (fps = display refresh rate / N)
gl_vsync=1
############# VISUAL
Display the current CPU information
cpu_stats
cpu_temp
Display the current GPU information
gpu_stats
gpu_temp
gpu_core_clock
gpu_mem_clock
Display loaded MangoHud architecture
arch
Display the frametime line graph
frame_timing
Display the current system time
time
Time formatting examples
time_format = %H:%M
time_format = [ %T %F ]
time_format = %X # locally formatted time, because of limited glyph range, missing characters may show as '?' (e.g. japanese)
Change the hud font size (default is 24)
font_size=24
Change the hud position (default is top-left)
+rf left
position=top-left
Display the current CPU load & frequency for each core
core_load
IO read and write for the app (not system)
io_read
io_write
Display system ram / vram usage
ram
vram
Disable / hide the hud by deafult
no_display
Hud position offset
offset_x=0
offset_y=20
Hud dimensions
width=
height=
Hud transparency / alpha
+rf 0.5
background_alpha=0.0
alpha=
Color customization
text_color=FFFFFF
gpu_color=2E9762
cpu_color=2E97CB
vram_color=AD64C1
ram_color=C26693
engine_color=EB5B5B
io_color=A491D3
frametime_color=00FF00
background_color=020202
Change default font (set location to .TTF/.OTF file )
font_file
Crosshair overlay (default size is 30)
crosshair
crosshair_size=15
#RRGGBB=Black
crosshair_color=00FF00
Show Spotify metadata
media_player
Specify gpu with pci bus id for amdgpu and NVML stats.
Set to 'domain:bus:slot.function'
pci_dev = 0:0a:0.0
############ INTERACTION
Change toggle keybinds for the hud & logging
toggle_hud=F12
toggle_logging=F2
reload_cfg=F4
############ LOG
Set amount of time in second that the logging will run for
log_duration
Define name and location of the output file (Required for logging)
output_file

GameMode 1.2

Gamemode (license BSD, https://github.com/FeralInteractive/gamemode) has been released by Feral as a library and daemon (based on systemd) to enable game optimizations automatically like the CPU governor “performance” when a game is started and to deactivate them as soon as the game stops. You can install it from AUR

yay gamemode
yay lib32-gamemode

Once you’ve installed gamemode, you can then tell any game to use it by doing this command:

gamemoderun./game

You can also add it as a Steam launch option for each of your games like this

gamemoderun %command%

If you wish to know what current CPU governor is in use, you can run this command in terminal:

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

You probably need to enable and start the gamemoded daemon:

systemctl --user enable gamemoded systemctl --user start gamemoded

Global Environment Variables

sudo nano /etc/environment

## Wayland
# Firefox Wayland
export MOZ_ENABLE_WAYLAND=1
# SDL Wayland
#export SDL_VIDEODRIVER=wayland

### Firefox
# Plasma integration 
export GTK_USE_PORTAL=1 
# Firefox Touchscreen support
export MOZ_USE_XINPUT2=1

### Vulkan (default RADV for AMD if nothing is set) ###
# Enable ACO instead of LLVM compiler in RADV
export RADV_PERFTEST=aco
# RADV
#export VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/radeon_icd.x86_64.json
# AMDVLK
#export VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/amd_icd64.json
# AMDVLK-Pro (thanks, TK-Glitch)
#export VK_ICD_FILENAMES=/opt/amdgpu-pro/etc/vulkan/icd.d/amd_icd64.json
# AMDVLK Experimental Features
#export AMDVLK_ENABLE_DEVELOPING_EXT="all"

### OpenGL
# Prefer new Intel Iris Gallium driver instead of classic one
### INTEL
#export MESA_LOADER_DRIVER_OVERRIDE=iris
### AMDGPU/MESA Tuning ###
# AMD Debug options
export radeonsi_enable_nir=true

### Wine Variables ###
# Wine Esync
#export WINEESYNC=1
# Wine PBA
#export PBA_ENABLE=1
# DXVK Async
#export DXVK_ASYNC=1

# HUD
# GALLIUM (AMD, Iris) *Only for testing, do not use if your desktop is using OpenGL acceleration*
# export GALLIUM_HUD=simple,cpu,GPU-load,temperature,fps
# Vulkan Overlay doesn't work as an environment variable
#export VK_INSTANCE_LAYERS=VK_LAYER_MESA_overlay
#export VK_LAYER_MESA_OVERLAY_CONFIG=submit,draw,pipeline_graphics,position=top-right
# MangHud Vulkan only
MANGOHUD=1
# Wine/Proton DXVK
export DXVK_HUD=devinfo,api

Game Manager

GameHub

GameHub (license GPLv3, https://tkashkin.tk/projects/gamehub, https://github.com/tkashkin/GameHub) is a new Game Manager that allows you to sync Steam (including multiple Steam accounts if Family sharing is active), GOG and even HumbleBundle library. It works great on Wayland. Install it from AUR:

yay gamehub

GameHub scales nicely even on 4k screen and if offers many functions that are missing in Lutris.

Lutris

With Lutris (license GPLv3, https://lutris.net, https://github.com/lutris/lutris) you can manage your game library of locally installed Linux games, Steam and Wine in one overview. Lutris runs natively on Wayland, it is based on Gtk 3.

sudo pacman -Sy lutris python-pyinotify

On the website of Lutris you can create an account and link this to your steam account to automate library sync with Steam.

So far lutris is far away from providing an easy overview about all games. It doesn’t manage multiple Steam accounts, it doesn’t even show all installed games of your Steam account and it doesn’t show all not installed games. Bug https://github.com/lutris/lutris/issues/757.

GOG support has been added in 5.0, but no HumbleBundle support so far. But the new version doesn’t work anymore in any window manager except Gnome (bug). Lutris doesn’t scale well on 4k screens in Plasma Wayland.

One thought on “Gaming +MangoHud +GameMode

  1. Pingback: OpenGL Games – synappsis

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.