Skip to content

Configuring lsfg‐vk

Pancake edited this page Jul 22, 2025 · 17 revisions

Configuring lsfg-vk

Note

Sorry in advance! An easy-to-use GUI is in the works but will take a while to complete. If you want to mostly replicate the old behavior, read the LSFG_PROCESS section carefully.

lsfg-vk is configured via ~/.config/lsfg-vk/conf.toml. Open it up in your favorite text editor. The configuration should look something like this:

version = 1
[global]
# override the location of Lossless Scaling
# dll = "/games/Lossless Scaling/Lossless.dll"

# [[game]] # example entry
# exe = "Game.exe"
#
# multiplier = 3
# flow_scale = 0.7
# performance_mode = true
# hdr_mode = false
#
# experimental_present_mode = fifo
[[game]] # default vkcube entry
exe = "vkcube"

multiplier = 4
performance_mode = true

[[game]] # default benchmark entry
exe = "benchmark"

multiplier = 4
performance_mode = false

[[game]] # override Genshin Impact
exe = "Genshin"

multiplier = 3

You can override the path to the configuration with the environment variable LSFG_CONFIG.

The configuration is split into sections. You have a [global] section at the top, followed by as many [[game]] sections as you wish (note the double brackets).

The global section is used for setting up the layer as a whole. These are the properties you can set there:

Property Recommended Value Description
dll Path to Lossless.dll or empty If you didn't install Lossless Scaling into traditional directories, you can override the path to the Lossless.dll file within the game files using this property

The game section is where stuff gets interesting:

Property Recommended Value Description
multiplier (1, )2, 3, 4 Double, triple or quadruple your FPS. You can go as high as you want.
flow_scale 0.25 to 1.0 Lowers the resolution of the internal image used for motion estimation. This can improve performance, although performance_mode is preferred.
performance_mode true or false Switches the frame generation model to much lighter one. This can massively improve performance (between 2x to 8x as fast, depending on the resolution). Loses a slight bit of quality
hdr_mode 1 when using HDR Switches the shaders to HDR mode (scRGB not supported). Do NOT set this flag when not using HDR
experimental_present_mode vsync/fifo or mailbox or immediate Overrides the present mode without altering synchronization logic. Very experimental.

In addition to the above properties, each [[game]] section additionaly has the exe property, which might be a little bit confusing to newcomers. The exe property is matched against the end of the running program's path, or the command name. If you run vkcube, then the path will likely be /usr/bin/vkcube and the command name vkcube. You can now decide to set exe to vkcube (exact match with the command name) or something like bin/vkcube (matches the end of the path).

Why is this necessary? When you launch an app through wine/proton, the path will be /usr/bin/something/wine and NOT the actual game. This is why you need the game's command name. Open up your game in the background. Then open a terminal and paste this command into it. To the right of the colon will be the command name, you should see your game in here.

for pid in /proc/[0-9]*; do
    owner=$(stat -c %U "$pid" 2>/dev/null)
    if [[ "$owner" == "$USER" ]]; then
        if grep -qi 'vulkan' "$pid/maps" 2>/dev/null; then
            procname=$(cat "$pid/comm" 2>/dev/null)
            if [[ -n "$procname" ]]; then
                printf "PID %s: %s\n" "$(basename "$pid")" "$procname"
            fi
        fi
    fi
done

If this is too complicated for you, set exe to whatever you like and launch the game with LSFG_PROCESS=<the name you gave it> (...). Note that this solution is much less convenient as it requires editing the launch arguments.

Almost every flag can be hot-reloaded, meaning you can edit the file while the game is running and it will apply instantly. As long as you have an entry in the configuration at the time of launching the game, it will work just fine.

Setting multiplier to 1 temporarily disables lsfg-vk.

You should now know everything you need to use lsfg-vk. Check out these two pages if you want to know more:

If you're encountering issues with lsfg-vk in certain games, take a look at these pages:

Legacy environment variables

If you're still getting used to the config system, or prefer the old system for some reason, you can still use it! These are all "legacy" environment variables:

Variable Recommended Value Description
LSFG_LEGACY 1 Set this to one to disable the config system and use environment variables instead.
LSFG_DLL_PATH Path to Lossless.dll or unset If you didn't install Lossless Scaling into traditional directories, you can override the path to the Lossless.dll file within the game files using this property
LSFG_MULTIPLIER 2, 3, 4 Double, triple or quadruple your FPS. You can go as high as you want.
LSFG_FLOW_SCALE 1.0 Lowers the resolution of the internal image used for motion estimation. This can improve performance, although performance_mode is preferred.
LSFG_PERFORMANCE_MODE true or false Switches the frame generation model to much lighter one. This can massively improve performance (between 2x to 8x as fast, depending on the resolution). Loses a slight bit of quality
LSFG_HDR_MODE 1 when using HDR Switches the shaders to HDR mode (scRGB not supported). Do NOT set this flag when not using HDR
LSFG_EXPERIMENTAL_PRESENT_MODE vsync/fifo or mailbox or immediate Overrides the present mode without altering synchronization logic. Very experimental.

If you've used the mesa flag to override the present mode, you must now use LSFG_EXPERIMENTAL_PRESENT_MODE=fifo/vsync/immediate/mailbox instead.

Clone this wiki locally