Deadlock

Deadlock

212 ratings
Deadlock Linux Central Guide
By index and 2 collaborators
Centralizing all of the info known about running the game on Linux and Steam Deck.
14
7
14
2
3
2
2
   
Award
Favorite
Favorited
Unfavorite
Game crashing on map load
Virtual memory mapping might be too low below is the provided solution

Background Info
As of right now Source 2 in Proton exceeds Linux's default limit for per process memory mapping which is 65530 memory map areas. This is probably a bug and this fix might become irrelevant soon.
For now the limit is just too low. We can confirm this if we run the command sudo sysctl vm.max_map_count or cat /proc/sys/vm/max_map_count and we should get a value of 65530.
Our goal here is to allow the game to utilize more memory map areas.

Solution
For this solution we will use a limit of 1048576 of memory map areas as it's the becoming the new default on many Linux Systems.
To permanently change your memory mapping limit you must edit a system file that you will need escalated privileges for.
We will be editing sysctl.conf but depending on your system's configuration you might need to change a different file.

Open the file via the editor of your choice with sudo. For example sudo nano /etc/sysctl.conf and add the line vm.max_map_count=1048576 to the bottom of the file and reboot your machine. If it doesn't work, check if you have another configuration file that could be causing conflicts. As the higher the number in the config name, the later it makes the change to your system. So sysctl.conf will run before 99-sysctl.conf.

Notes​
  • We can temporarily achieve the same result with the following command sudo sysctl -w vm.max_map_count=1048576.
  • You can read about max_map_count and memory mapping in the documentation provided in the sources.
  • As per this message from Yoshi, information about a proper Linux build or further Proton support is unknown at this time.

  • As per this message from Yoshi, the Steam Deck might receive further support.

Additional Info
This section of the guide was copied over from the official discord as we wanted the information to be more accessible.

Credits
Basic launch options with gamemodedrun
Make sure to have Gamemode[github.com] installed before running:
gamemoderun
Steam Deck
Steam Deck matchmaking unavailable?? currently you have to use
SteamDeck=0 %command%
in the launch options. (Warning: SteamDeck is case sensitive!) It's also best to use the lowest settings possible as the game is still unoptimized in the beta.

Notes
As per this message from Yoshi, the Steam Deck might receive further support.
AMD Section
Currently not much is needed to improve the performance on AMD.
Best bet is to use the following launch options:
gamemoderun %command% -nojoy
Advanced and experimental launch options:
RADV_FORCE_VRS=2x2 RADV_PERFTEST="dccmsaa,sam,nircache,transfer_queue" gamemoderun %command% -nojoy -threads <number of threads>
Notes
  • Replace <number of threads> with your CPU's thread count
  • -nojoy disables your controller and joystick
Nvidia Section
1. Game not launching on a NVIDIA GPU? try adding this command in the launch options:
PROTON_HIDE_NVIDIA_GPU=1 %command%
2. Advanced, experimental launch options:
gamemoderun %command% -high -nojoy -threads <numer of threads> +engine_low_latency_sleep_after_client_tick true
Notes
  • Replace <number of threads> with your CPU's thread count
  • -nojoy disables your controller and joystick
Valve Proton or GloriousEggroll (Proton-GE)
What's better to use: GE Proton or Valve Proton?
Based of my own research on my all AMD setup and the research of similar Linux users, it seems it's currently better to use GE Proton[github.com] over Valve Proton.
DXVK or Vulkan
General conclusion in testing from the community members:
If you have an RTX card, do your own testing between DXVK and VK and please submit.
If you have a GTX card, use VK.
If you have an AMD card, use DXVK.
Findings from one of the Discord community members below (thanks @Miuzu):
Running Arch linux, kernel version 6.10.6-arch1-1 with Wayland + sway as window manager.
CPU: Ryzen 5 1600x, GPU: AMD Radeon RX 6600, RAM: 16GB, game installed on SSD
RADV_FORCE_VRS=2x2 vk_radv gamemoderun mangohud %command% -high -nojoy -threads 12 +engine_low_latency_sleep_after_client_tick true +mat_queue_mode 2 +cl_forcepreload 1 -dx11 for launch commands.
Last option interchanged with -vulkan during tests
@awth13 from discord
awth13 — Today at 19:03 Flatpak Steam Wayland RTX 2070 i7-9750H No launch options apart from gamemode because I think they don't do anything
From @leibniz2574 on discord
Arch Linux
sched ext kernel (forgor the name Xd)
scheduler: bpfland
DE: KDE Plasma6 (Wayland)

Ryzen 5 3600
Radeon RX6600 (MECH 2X)

custom ingame settings: stretch, 100%
RADV_PERFTEST="dccmsaa,gpl,sam,nircache,transfer_queue" vk_radv gamescope -W 1770 -H 996 %command% -w 1770 -h 996 -high -nojoy +engine_low_latency_sleep_after_client_tick true +mat_queue_mode 2 +cl_forcepreload 1
From @_tyke on discord
Running Nobara, kernel version 6.10.6 with KDE on top of X11
CPU: 7800X3D
GPU: NVIDIA 3090 (Founders)
RAM: 32GB DDR5 6000 MT/s
Storage: Game is installed on an SSD (WD Black NVMe)
Launch options:
mangohud gamemoderun %command% -nojoy -high -threads 8 +engine_low_latency_sleep_after_client_tick true +mat_queue_mode 2

On the majority of tested devices, the differences in both average performance and performance stability are negligible. The two outliers are the powerful machine with a 3090 and an older machine with a 1650, on both of which VK performed significantly better in terms of frame stability.
AMD P-state CPU governor
amd-pstate is the AMD CPU performance scaling driver that introduces a new CPU frequency control mechanism on modern AMD APU and CPU series in Linux kernel. The new mechanism is based on Collaborative Processor Performance Control (CPPC) which provides finer grain frequency management than legacy ACPI hardware P-States. Current AMD CPU/APU platforms are using the ACPI P-states driver to manage CPU frequency and clocks with switching only in 3 P-states. CPPC replaces the ACPI P-states controls and allows a flexible, low-latency interface for the Linux kernel to directly communicate the performance hints to hardware.

In order to maximize performance with AMD CPUs you should enable the p_state driver:
AMD 4G Decoding [REBAR]
What is Resizable BAR?

All gaming PCs produce an on-screen image by way of the CPU processing data – textures, shaders and the like – from the graphics card’s frame buffer. Usually the CPU can only access this buffer in 256MB read blocks, which obviously isn’t very much when modern GPUs regularly have 8GB of video memory or much, much more.

Resizable BAR essentially makes the entirety of the graphics frame buffer accessible to the CPU at once; where it could once sip, it now guzzles. The idea is that once textures, shaders and geometry are loading in faster, games should run faster with higher frame rates.

To enable AMD REBAR you do have to enable it in your BIOS. Enable the setting named Above 4G Decode or >4GB MMIO in your motherboard settings.
Restart your PC and run this test in the terminal:
dmesg | grep BAR=
Which should return something like this:
[drm] Detected VRAM RAM=8176M, BAR=8192M
Note
  • VRAM AND BAR should have the same amount to verify that it's working
  • We did some testing on low end systems and there is marginal differences (take those with a grain of salt)
Thanks again @Miuzu from the discord
DXVK vs VULKAN with REBAR enabled:

Compared to DXVK vs VULKAN with REBAR Disabled:
Experimental: Disabling your compositioning
If you are still struggling with FPS, disabling your compositor is worth a shot, it seems to have helped me and some other users (X11/XFCE/X) (note: disabling your wayland compositor will render nothing for you)
Various
NixOS
Memory Map Areas
For NixOS users, to increase your memory map areas limit, just add the following to your /etc/nixos/configuration.nix:
boot.kernel.sysctl = { "vm.max_map_count" = 1048576; };
Extest library
Fix for gyro mouse in Steam input not working, just add the following to your /etc/nixos/configuration.nix:
programs.steam.extest.enable = true
Credits
  • Tia maço
  • MM2000
Newest findings
It takes too long to process Vulkan shaders
The current consensus is to disable shader pre-caching. You can disable it globally on steam settings, under Downloads section.

TLDR: Fossilize is, in theory, a useful tool for preventing stutters during real time gameplay. Especially for older hardware, however for most users pre-cache is not necessary. And, even for the users who it IS beneficial for I still recommend turning it off, and instead just watching a replay or live match.
------
My system should be where it is useful, I am unable to connect to a match if I do not pre-compile shaders as I timeout for taking to long to join. Even still, I have pre-cache disabled. From scratch, it takes my CPU three and a half hours to compile just the deadlock shaders. Everytime valve updates the cache, and everytime my gpu driver updates I have to rebuild the cache.

If I either watch a replay or watch a match live, it takes about 10 minutes of watching for all the non-hero-specific shaders to get built. There is actually a DXVK launch argument `DXVK_HUD=compiler ` that will show you the progress for shaders, that you want to put near the beginning of your launch steam launch arguments. (Before the %command%) You can also go to the heroes tab and cycle through all the heroes to compile shaders in the menu.

There are a few other reasons why Fossilize ins't great: one it's just simply overkill. They render over 1.1 million[github.com] frames for deadlock to build the cache, and two weeks later it grew to 1.4 million[github.com] frames. Two: the progress % is incredibly inaccurate. When it starts compiling it estimates it only has 110 thousand frames, causing it to rapidly progress. Three, It also build cache for every single shader any user encounters, which includes workshop contnet. This doesn't matter for deadlock yet, but for games like Hat in Time with massive workshop content this causes the cache to get massive[github.com]. Valve-kiosk or the dev working on it has not responded to any of these issues.

Pre-loading shaders that keep 0 out of 0

Use the following launch args:
%command% -no_prewarm_map
1[forums.playdeadlock.com]
Game gets very laggy after 20-30 minutes

Enabling steam overlay might fix it.

If you don't want the overlay, use the following launch args:
LD_PRELOAD= %command%
1[forums.playdeadlock.com] 2[forums.playdeadlock.com] 3[forums.playdeadlock.com]
Closing notes
This guide is not final, as more knowledge is learned it will be updated.
Credits
Everyone who was active, and the whole Linux community, from the official discord, if anyone feels like they are left out please reach out to use so we can credit you.
70 Comments
index  [author] 3 Feb @ 2:24pm 
normal, sandbox is a very small map compared to the larger map
Schlawg 3 Feb @ 1:42pm 
Hey does anyone also experience a very big difference in frame time beetween sandbox and actual match? I know my 960m is very weak as today but playing on 720p I can get around 90fps in sandbox (even when using a lot of abilities at once and fighting bots) but can't keep stable 20fps during match even in less crowded areas.
avc39076 21 Dec, 2024 @ 7:07am 
I see. When executing the game I didn't have to choose "force compatibility tools" so I thought that it had a native version now. My bad.
index  [author] 20 Dec, 2024 @ 11:23pm 
Linux depot size is still 0
https://steamdb.info/app/1422450/depots/
avc39076 20 Dec, 2024 @ 8:19pm 
I don't know when it happened, but the game has a native linux version now
index  [author] 25 Nov, 2024 @ 7:27am 
I am no longer on the deadlock discord, should any new things arise, please notify me, I will add them to the guide here
ppedro de la paska 17 Nov, 2024 @ 8:56am 
Thank you for this post, good sir.:rabbitTLD:
index  [author] 17 Nov, 2024 @ 4:46am 
Guide was updated, please check it out
Melody 26 Oct, 2024 @ 4:50am 
8) do, not, use, flatpak Steam, newbies always make this mistake. It's gonna use runtimes over runtimes, we do not want this
9) always use rolling/upstream distros, you want everything to be as updated as possible
10) make sure you're not blocking split locking. Use split_lock_detect=off and kernel.split_lock_mitigate=0, docs available at linux kernel github
Melody 26 Oct, 2024 @ 4:50am 
A few suggestions from my side:
1) you don't need to touch max_map_count in new linux kernels; extremely old pull request already fixed this for you
2) gamemoderun must be run without core pinning on processors with ecores or double ccx because source 2 already handles those heterogeneous processor on its own, documentation at github
3) GE Proton is better and I agree with that
4) you should manually compile VKD3D, DXVK, dxvk-nvapi and wine-nvml and embed it in your Proton, documentation at github
5) you don't need to hide NVIDIA GPU. I use PROTON_HIDE_NVIDIA_GPU=0 PROTON_DISABLE_NVAPI=0 DXVK_ENABLE_NVAPI=1. DXVK may hide your NVIDIA GPU nonetheless, make sure it isn't, documentation available at dxvk github
6) vulkan should perform better than dxvk. If you're using dxvk, do not enforce prerendered frames to 1, source 2 doesn't like that
7) tkg's file descriptors tweak might improve performance furthermore