feat(vk): the FSR 4 model row on Linux, with fsr4up-vk's library #2506

Open
roblesleo wants to merge 1 commit from roblesleo/Longshot:fsr4-linux-model-row into main
Contributor

Summary

On Linux the FSR 4 model row kept a saved Lite value and always ran Auto: there is no AMD provider to hook, because the library beside the game is not AMD's. This makes the row work there with fsr4up-vk's library, which carries AMD's four FSR 4.1.2 networks and reads the one to run from FSR4UP_INT8 each time a context is made.

  • load recognises that library by the name it lists itself under, 4.1.2 (fsr4up-vk) (fsr4_models::names_fsr4up), and shows the row on any GPU it runs on.
  • make_context sets FSR4UP_INT8=lite for Lite and unsets it for Auto just before the create call, and again before the retry as Auto when Lite fails.
  • A FSR4UP_INT8 the player set themselves is left as it is: the row is hidden and the log says so.
  • Any other library is as before (fsr4-vk lists Auto, INT8 and FP8 and has no Lite). Windows is unchanged.

Why an environment variable: it is the only selector fsr4up-vk has, and it reads it at context creation, so the row stays live as on Windows. setenv in a threaded process is the part I would look at first: contexts are made one at a time, but tell me if you would rather set it once at load and ask for a restart.

Read first: make_context and the end of load in gpu/vk/vk_fsr4.cpp.

Testing

Tested: SteamOS, Legion Go (Ryzen Z1 Extreme, Radeon 780M, RADV Mesa 26.2.0-devel), nightly-801's builder with this branch's files, FSR 4 forced, Castle Town, 3 minutes each.

  • RX_VK_FSR4_MODEL=lite: the game logs model: Lite (INT8, forced), AMD's shaders; fsr4up-vk's own log (FSR4UP_LOG) says the INT8 FSR4L-i8 (... FSR4UP_INT8) network.

  • RX_VK_FSR4_MODEL=auto: model: Auto (AMD's), tuned; fsr4up-vk says the INT8 FSR4-i8 (... AMD's DLL offers no FSR 4.1.2 here: offered anyway) network.

  • tests/fsr4_models_test.cpp: new cases for the name check and the value written. Passes.

  • The whole suite on my Windows PC, python -I -B tests/run_all.py --jobs 6 (not --strict: this PC lacks the Vulkan and SPIR-V headers and spirv-val, so 137 checks are skipped): 817 passed, 26 failed. The 26 checks that fail are the same 26, by name, that fail on main @ 9046a8d7 here, none of them one this change touches: test_auto_handheld, test_bug_report, test_build_long_paths, test_cmpflags, test_crash_dialog, test_dev_ab, test_dev_build, test_dev_migrate, test_discover, test_fastfp_fma, test_fma_soft, test_fpx_sticky, test_fpxkeep, test_game_menu_mouse_buttons, test_input_movie, test_lift_lookups, test_linux_preflight, test_make_game_cache, test_pads_after_menu, test_perf_report, test_sdiv_overflow, test_spawn_emit, test_vbytes, test_vecfp, test_vfpx_elem, test_walk.

Still to test:

  • Linux, RDNA 4 (FP8 is Auto there): pick Lite in the menu, expecting FSR4L-i8 in fsr4up-vk's log and no error (by hand, or the Test Farm).
  • Linux, NVIDIA or Intel: the row is shown and Lite is asked for; expecting either Lite or the existing fallback to Auto (by hand).
  • Changing the row in the menu during play, not by the switch (by hand; I only used the switch).

Measurements

Verdict: Lite is about 5% faster than Auto on this GPU, as the row's help says it should be.

Setup: SteamOS, Radeon 780M, RADV Mesa 26.2.0-devel, performance profile, Castle Town, 1286x804 -> 1382x864, one run each, the last 5 readings.

Before, the row on Auto: this PR @ a4833e09 After, the row on Lite: this PR @ a4833e09
fps 32.7 34.5
GPU time a frame 22.2 ms 19.7 ms

Baseline: this PR's build with the row on Auto, which is what main @ 9046a8d7 runs with the same library (there the row does nothing on Linux); I did not build main itself for this.

One run each, so read it as a direction, not a number.

Risks

Linux only, and only with fsr4up-vk's library beside the game. setenv/unsetenv at context creation. Turn it off by leaving the row on Auto, or with RX_VK_FSR4_MODEL=auto. Nothing changes after updating for a player without that library.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named).
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A check under tests/ that reads changed source is updated, not weakened.
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths.
  • Docs updated.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
## Summary On Linux the **FSR 4 model** row kept a saved Lite value and always ran Auto: there is no AMD provider to hook, because the library beside the game is not AMD's. This makes the row work there with [fsr4up-vk](https://github.com/auz466/fsr4up-vk)'s library, which carries AMD's four FSR 4.1.2 networks and reads the one to run from `FSR4UP_INT8` each time a context is made. - `load` recognises that library by the name it lists itself under, `4.1.2 (fsr4up-vk)` (`fsr4_models::names_fsr4up`), and shows the row on any GPU it runs on. - `make_context` sets `FSR4UP_INT8=lite` for Lite and unsets it for Auto just before the create call, and again before the retry as Auto when Lite fails. - A `FSR4UP_INT8` the player set themselves is left as it is: the row is hidden and the log says so. - Any other library is as before (fsr4-vk lists Auto, INT8 and FP8 and has no Lite). Windows is unchanged. Why an environment variable: it is the only selector fsr4up-vk has, and it reads it at context creation, so the row stays live as on Windows. `setenv` in a threaded process is the part I would look at first: contexts are made one at a time, but tell me if you would rather set it once at load and ask for a restart. Read first: `make_context` and the end of `load` in `gpu/vk/vk_fsr4.cpp`. ## Testing **Tested:** SteamOS, Legion Go (Ryzen Z1 Extreme, Radeon 780M, RADV Mesa 26.2.0-devel), nightly-801's builder with this branch's files, FSR 4 forced, Castle Town, 3 minutes each. - `RX_VK_FSR4_MODEL=lite`: the game logs `model: Lite (INT8, forced), AMD's shaders`; fsr4up-vk's own log (`FSR4UP_LOG`) says `the INT8 FSR4L-i8 (... FSR4UP_INT8) network`. - `RX_VK_FSR4_MODEL=auto`: `model: Auto (AMD's), tuned`; fsr4up-vk says `the INT8 FSR4-i8 (... AMD's DLL offers no FSR 4.1.2 here: offered anyway) network`. - `tests/fsr4_models_test.cpp`: new cases for the name check and the value written. Passes. - The whole suite on my Windows PC, `python -I -B tests/run_all.py --jobs 6` (not `--strict`: this PC lacks the Vulkan and SPIR-V headers and spirv-val, so 137 checks are skipped): 817 passed, 26 failed. The 26 checks that fail are the same 26, by name, that fail on `main` @ 9046a8d7 here, none of them one this change touches: `test_auto_handheld`, `test_bug_report`, `test_build_long_paths`, `test_cmpflags`, `test_crash_dialog`, `test_dev_ab`, `test_dev_build`, `test_dev_migrate`, `test_discover`, `test_fastfp_fma`, `test_fma_soft`, `test_fpx_sticky`, `test_fpxkeep`, `test_game_menu_mouse_buttons`, `test_input_movie`, `test_lift_lookups`, `test_linux_preflight`, `test_make_game_cache`, `test_pads_after_menu`, `test_perf_report`, `test_sdiv_overflow`, `test_spawn_emit`, `test_vbytes`, `test_vecfp`, `test_vfpx_elem`, `test_walk`. **Still to test:** - Linux, RDNA 4 (FP8 is Auto there): pick Lite in the menu, expecting `FSR4L-i8` in fsr4up-vk's log and no error (by hand, or the Test Farm). - Linux, NVIDIA or Intel: the row is shown and Lite is asked for; expecting either Lite or the existing fallback to Auto (by hand). - Changing the row in the menu during play, not by the switch (by hand; I only used the switch). ## Measurements **Verdict:** Lite is about 5% faster than Auto on this GPU, as the row's help says it should be. Setup: SteamOS, Radeon 780M, RADV Mesa 26.2.0-devel, performance profile, Castle Town, 1286x804 -> 1382x864, one run each, the last 5 readings. | | Before, the row on Auto: this PR @ a4833e09 | After, the row on Lite: this PR @ a4833e09 | |---|---|---| | fps | 32.7 | 34.5 | | GPU time a frame | 22.2 ms | 19.7 ms | Baseline: this PR's build with the row on Auto, which is what `main` @ 9046a8d7 runs with the same library (there the row does nothing on Linux); I did not build `main` itself for this. One run each, so read it as a direction, not a number. ## Risks Linux only, and only with fsr4up-vk's library beside the game. `setenv`/`unsetenv` at context creation. Turn it off by leaving the row on Auto, or with `RX_VK_FSR4_MODEL=auto`. Nothing changes after updating for a player without that library. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [x] `mise run test` passes (any failure that also fails on `main` is named). - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A check under `tests/` that reads changed source is updated, not weakened. - [x] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. - [x] Docs updated. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers.
feat(vk): the FSR 4 model row on Linux, with fsr4up-vk's library
Some checks are pending
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website builds (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
Website / Website builds (pull_request) Blocked by required conditions
Website / Website preview, build (pull_request) Blocked by required conditions
Website / Website preview, upload (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 5s
a4833e098d
On Linux the FSR 4 model row kept a saved Lite value and always ran Auto:
there is no AMD provider to hook, the library beside the game is not
AMD's. fsr4up-vk's library (it lists itself as "4.1.2 (fsr4up-vk)")
carries AMD's four 4.1.2 networks and reads the one to run from
FSR4UP_INT8 each time a context is made. With that library the row is
shown, and make_context sets FSR4UP_INT8=lite for Lite and unsets it for
Auto just before the create call, and before the retry as Auto when Lite
fails. A FSR4UP_INT8 the player set is left as it is, with the row hidden.
Any other library (fsr4-vk has no Lite) is as before.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Member

Possibly related, for context:

  • PR #2488 feat(recomplauncher): AMD FSR 4 ticks for the setup step, on Windows and Linux — Launcher manifest can install a Linux FSR 4 .so beside the game
  • PR #2495 perf(vk): cut AMD FSR 4 INT8 Lite dispatch time 27-33% (+5-11% FPS, +32% 1% low at 33% scale) on AMD LLPC GPUs via direct unroll and selective Wave64 — Overlapping FSR 4 Lite behavior and vk_fsr4.cpp context changes
  • PR #2331 feat(vk): FSR 4 model selection for FSR SDK 2.4's upscaler library, named by its SHA-256 — Merged FSR 4 model selection groundwork; current PR adds a Linux library path
Possibly related, for context: - PR #2488 feat(recomplauncher): AMD FSR 4 ticks for the setup step, on Windows and Linux — Launcher manifest can install a Linux FSR 4 .so beside the game - PR #2495 perf(vk): cut AMD FSR 4 INT8 Lite dispatch time 27-33% (+5-11% FPS, +32% 1% low at 33% scale) on AMD LLPC GPUs via direct unroll and selective Wave64 — Overlapping FSR 4 Lite behavior and vk_fsr4.cpp context changes - PR #2331 feat(vk): FSR 4 model selection for FSR SDK 2.4's upscaler library, named by its SHA-256 — Merged FSR 4 model selection groundwork; current PR adds a Linux library path
Author
Contributor

Checks on my Windows PC: python -I -B tests/run_all.py --changed against current main: 22 passed, 0 failed, 5 skipped (the skipped ones need the Vulkan headers or spirv-val, which this PC lacks). Not the full mise run test, and not --strict, so I am leaving WIP in the title until CI has run.

On #2495: it changes the same lines of make_context (when a forced Lite context is tuned). No conflict of intent; whichever merges second rebases, and I will do it if that is this one.

Checks on my Windows PC: `python -I -B tests/run_all.py --changed` against current `main`: 22 passed, 0 failed, 5 skipped (the skipped ones need the Vulkan headers or spirv-val, which this PC lacks). Not the full `mise run test`, and not `--strict`, so I am leaving WIP in the title until CI has run. On #2495: it changes the same lines of `make_context` (when a forced Lite context is tuned). No conflict of intent; whichever merges second rebases, and I will do it if that is this one.
roblesleo changed title from WIP: feat(vk): the FSR 4 model row on Linux, with fsr4up-vk's library to feat(vk): the FSR 4 model row on Linux, with fsr4up-vk's library 2026-11-25 12:08:41 +00:00
roblesleo changed title from feat(vk): the FSR 4 model row on Linux, with fsr4up-vk's library to WIP: feat(vk): the FSR 4 model row on Linux, with fsr4up-vk's library 2026-11-25 12:10:30 +00:00
roblesleo changed title from WIP: feat(vk): the FSR 4 model row on Linux, with fsr4up-vk's library to feat(vk): the FSR 4 model row on Linux, with fsr4up-vk's library 2026-11-25 13:12:48 +00:00
Some checks are pending
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website builds (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
Website / Website builds (pull_request) Blocked by required conditions
Website / Website preview, build (pull_request) Blocked by required conditions
Website / Website preview, upload (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 5s
This pull request has changes conflicting with the target branch.
  • docs/user/advanced.md
Some workflows are waiting to be reviewed.
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fsr4-linux-model-row:roblesleo-fsr4-linux-model-row'
git switch 'roblesleo-fsr4-linux-model-row'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!2506
No description provided.