Vendor agnostic latency reduction middleware. An alternative to NVIDIA Reflex.
To get an idea why queuing happens in video games and why it causes increased latency, watch this video.
To learn more about LatencyFleX's internals, check out the blog post.
- LatencyFleX current does not provide any benefits when VSync is enabled.
This is blocked on presentation timing support. - LatencyFleX introduces jitter in frame time as a part of its algorithm, which results in microstutters.
Though, most games tend to have a larger frame time fluctuation already, so this is likely unperceivable.
- Minor stutters might happen during gaming session. The algorithm is still being tuned, but open an issue if the stutter is severe.
- GPU utilization will be lower when running with LatencyFleX. Overall LatencyFleX should be able to achieve ~95% utilization (assuming GPU bound). Open an issue if utilization is significantly low.
See docs/BUILDING.md
For now, LatencyFleX can be used on Linux through one of the following injection method. Game engine integration is planned.
Warning: Be careful when using LatencyFleX with games having anti-cheat:
- Direct hooking (UE4 hook) can trip the game's integrity check and directly get you banned.
- Proton NVAPI integration is relatively safe, but I am not responsible for any bans issued due to LatencyFleX.
Please do it at your own risk.
Tested games:
Game | Support | Method |
---|---|---|
Splitgate | ✅ | Linux UE4 Hook |
Ghostrunner | ✅ | Proton NVAPI |
Overwatch 1 | ✅ | Proton NVAPI |
Titanfall 2 w/ Northstar | ✅ | Proton (Native) |
Game supported but not in list? File a PR to update the table.
-
Install the Vulkan layer, wine extension and the modified branch of DXVK-NVAPI.
-
Put the following in
dxvk.conf
2. If you haven't created one, create it next to the game executable. If there are multiple executables, try copying and puttingdxvk.conf
next to every executable.dxgi.nvapiHack = False dxgi.customVendorId = 10de # If running on non-NVIDIA GPU
-
Launch with the following environment variables:
PROTON_ENABLE_NVAPI=1 DXVK_NVAPI_DRIVER_VERSION=49729 DXVK_NVAPI_ALLOW_OTHER_DRIVERS=1 LFX=1 %command%
-
Don't forget to enable Reflex Low-Latency in-game.
Supported platforms: Linux (see note)
Note: for now, the UE4 hook only supports Linux UE4 builds with PIE disabled.
-
Install the Vulkan layer.
-
Obtain an offset to
FEngineLoop::Tick
. If the game ships with debug symbols, the offset can be obtained with the command:readelf -Ws PortalWars/Binaries/Linux/PortalWars-Linux-Shipping.debug | c++filt | grep FEngineLoop::Tick
Find the line corresponding to the actual function (other entries are for types used in the function and unrelated):
268: 00000000026698e0 9876 FUNC LOCAL HIDDEN 15 FEngineLoop::Tick()
Here
26698e0
is the offset we need. We will call it<OFFSET>
below. -
Modify the launch command-line as follows.
LFX=1 LFX_UE4_HOOK=0x<OFFSET> %command%
Supported platforms: Proton, Linux
- Install the Vulkan layer. Also install the Wine extension if the game runs on Wine/Proton.
- Install BepInEx Bleeding Edge to the game directory.
- Run the game once to generate BepInEx directory structure, config files and startup log.
Obtain the Unity version from the first line of
BepInEx/LogOutput.log
. - Drop
unity/<RUNTIME>-<VERSION>/LatencyFleX.dll
(from release artifacts) intoBepInEx/plugins
.<RUNTIME>
ismono
oril2cpp
.<VERSION>
is:2018.1
for any version higher or equal to 2018.1 (This is currently unsupported for IL2CPP)2019.3
for any version higher or equal to 2019.3- Older versions (5.x, 4.x) are unsupported.
- Use the following launch command-line.
LFX=1 %command% -force-vulkan # for native WINEDLLOVERRIDES="winhttp=n,b" LFX=1 %command% # for Proton
For Debian-like distros, copy the following files from release artifacts to your root filesystem.
/usr/lib/x86_64-linux-gnu/liblatencyflex_layer.so
/usr/share/vulkan/implicit_layer.d/latencyflex.json
For Arch-like distros, you need to copy /usr/lib/x86_64-linux-gnu/liblatencyflex_layer.so -> /usr/lib/liblatencyflex_layer.so
and additionally update the path specified in /usr/share/vulkan/implicit_layer.d/latencyflex.json
.
Copy the following files from release artifacts to your Wine installation location.
For Wine 7.x (including Proton-GE-Custom): change /usr/lib/wine
to wherever Wine/Proton is installed.
For Proton and certain distros, you also need to change lib
to lib64
. Copy the following files.
/usr/lib/wine/x86_64-unix/latencyflex_wine.dll.so
/usr/lib/wine/x86_64-windows/latencyflex_wine.dll
For Wine <= 6.x and current Proton versions: copy the files as follows:
/usr/lib/wine/x86_64-unix/latencyflex_wine.dll.so -> lib64/wine/latencyflex_wine.dll.so
/usr/lib/wine/x86_64-windows/latencyflex_wine.dll -> lib64/wine/fakedlls/latencyflex_wine.dll
Obtain binaries from GitHub Actions.
For Proton, copy nvapi64.dll
into dist/lib64/wine/nvapi
.
For other Wine installations, see DXVK-NVAPI documentation.
Obtain binaries from GitHub Actions and install it to your system.
Put the following line in MangoHud.conf
to have real-time latency metrics:
graphs=custom_Latency