Run FSR 4 on Linux through a Vulkan FSR 4 library #857

Closed
N3oTraX wants to merge 5 commits from linux/fsr4-native into main
N3oTraX commented 2026-11-08 23:19:01 +00:00 (Migrated from github.com)

Makes the FSR 4.1 path of #828 work on native Linux.

Stacked on #828 (which contains #818). Only the last two commits are new here; GitHub also shows the commits of those PRs until they land. I will rebase then.

What changed

  • Loading: there is no AMD loader for Linux, so the upscaler library itself (amd_fidelityfx_upscaler_vk.so) is loaded with dlopen, from RX_FSR4_DIR or beside the game.
  • Backend description: the library reads the SDK's older backend type, so ffxCreateBackendVKDesc_DEPRECATED is chained next to the current one. Without it, creation returned FFX_API_RETURN_ERROR_PARAMETER.
  • VK_EXT_descriptor_buffer: the library records with it. It is requested only when the library is present.
  • Provider choice: the first of equal versions is kept instead of the last. The library lists Auto, INT8, FP8, so the last one forced FP8 on hardware without it.
  • Exposure: the library rejects a dispatch without an exposure, and the colour is already tonemapped, so it gets a 1x1 R32_SFLOAT of 1.
  • BITMAPFILEHEADER joins the POSIX windows.h shim: the menu dump from #818 did not build on Linux.

No AMD binary is added or downloaded. Without a library, the game's upscale stays.

How it was tested

GPU, driver RX 7900 XTX (RDNA3), RADV Mesa 26.2.6
System Linux 7.3.1, Hyprland
Game v131072, build e0f3ccfa, Kokiri Forest
Library third-party fsr4-vk b0125ea, built locally from AMD's SDK DLL. Not affiliated with AMD; whether to use it is the user's call
Result FSR 4.1.1 Vulkan INT8, 3416x1440 to 3416x1440, FSR draws the upscale from frame 835, no crash or device lost in the log
Checks tests/run_all.py fsr menu upscale resolution: 5 passed. The full suite was not run

fps before and after: not measured.

The test had to run with RX_VK_NO_WARM=1, RX_VK_NO_PREDICT=1 and RX_VK_PRECOMPILE=0, because v2.0.5 crashes in the driver on this Mesa (#803, precompile_run). It also set RX_VK_ANISO=16.

Not tested

  • 3840x2160 output, and upscaling from 75% or lower.
  • RDNA2, RDNA4, and FP8.
  • Windows: not compiled or run here. The Linux code is behind _WIN32 guards; only the provider choice above is shared.

🤖 Generated with Claude Code

Makes the FSR 4.1 path of #828 work on native Linux. > **Stacked on #828** (which contains #818). Only the last two commits are new here; GitHub also shows the commits of those PRs until they land. I will rebase then. ## What changed - **Loading:** there is no AMD loader for Linux, so the upscaler library itself (`amd_fidelityfx_upscaler_vk.so`) is loaded with `dlopen`, from `RX_FSR4_DIR` or beside the game. - **Backend description:** the library reads the SDK's older backend type, so `ffxCreateBackendVKDesc_DEPRECATED` is chained next to the current one. Without it, creation returned `FFX_API_RETURN_ERROR_PARAMETER`. - **`VK_EXT_descriptor_buffer`:** the library records with it. It is requested only when the library is present. - **Provider choice:** the first of equal versions is kept instead of the last. The library lists `Auto`, `INT8`, `FP8`, so the last one forced FP8 on hardware without it. - **Exposure:** the library rejects a dispatch without an exposure, and the colour is already tonemapped, so it gets a 1x1 `R32_SFLOAT` of 1. - `BITMAPFILEHEADER` joins the POSIX `windows.h` shim: the menu dump from #818 did not build on Linux. No AMD binary is added or downloaded. Without a library, the game's upscale stays. ## How it was tested | | | |---|---| | GPU, driver | RX 7900 XTX (RDNA3), RADV Mesa 26.2.6 | | System | Linux 7.3.1, Hyprland | | Game | v131072, build `e0f3ccfa`, Kokiri Forest | | Library | third-party [fsr4-vk](https://github.com/Astyyyyy/fsr4-vk) `b0125ea`, built locally from AMD's SDK DLL. Not affiliated with AMD; whether to use it is the user's call | | Result | `FSR 4.1.1 Vulkan INT8`, 3416x1440 to 3416x1440, FSR draws the upscale from frame 835, no crash or device lost in the log | | Checks | `tests/run_all.py fsr menu upscale resolution`: 5 passed. The full suite was not run | **fps before and after: not measured.** The test had to run with `RX_VK_NO_WARM=1`, `RX_VK_NO_PREDICT=1` and `RX_VK_PRECOMPILE=0`, because v2.0.5 crashes in the driver on this Mesa (#803, `precompile_run`). It also set `RX_VK_ANISO=16`. ## Not tested - 3840x2160 output, and upscaling from 75% or lower. - RDNA2, RDNA4, and FP8. - Windows: not compiled or run here. The Linux code is behind `_WIN32` guards; only the provider choice above is shared. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
madebyjordan commented 2026-11-08 23:27:38 +00:00 (Migrated from github.com)

Thanks for this. Linux support is great, and your provider fix helps Windows too (RDNA 2 has no FP8).

#828 is the shared branch for FSR 4.1, so contributions all land in one place. Could you open this as a PR against madebyjordan/hookshot-amd, branch amd/fsr4? It applies cleanly. One heads-up: since you branched, I made vk_fsr4.cpp Windows-only, which would hide your Linux code. I'll remove that when yours comes in.

If you'd rather not open another PR, I can copy your two commits over myself with your name kept and credit you in #828. Whichever you prefer.

Thanks for this. Linux support is great, and your provider fix helps Windows too (RDNA 2 has no FP8). #828 is the shared branch for FSR 4.1, so contributions all land in one place. Could you open this as a PR against `madebyjordan/hookshot-amd`, branch `amd/fsr4`? It applies cleanly. One heads-up: since you branched, I made `vk_fsr4.cpp` Windows-only, which would hide your Linux code. I'll remove that when yours comes in. If you'd rather not open another PR, I can copy your two commits over myself with your name kept and credit you in #828. Whichever you prefer.
N3oTraX commented 2026-11-08 23:54:46 +00:00 (Migrated from github.com)

Thanks! Opened against amd/fsr4: https://github.com/madebyjordan/hookshot-amd/pull/2. It also removes the Windows-only guard, so you don't have to. I'll keep this one until that lands.

Thanks! Opened against `amd/fsr4`: https://github.com/madebyjordan/hookshot-amd/pull/2. It also removes the Windows-only guard, so you don't have to. I'll keep this one until that lands.
madebyjordan commented 2026-11-08 23:58:15 +00:00 (Migrated from github.com)

Merged into amd/fsr4 (madebyjordan/hookshot-amd#2), so it is part of #828 now, with you credited for Linux support. Thanks for rebasing it onto the new head. Feel free to close this one whenever suits you.

Merged into `amd/fsr4` (madebyjordan/hookshot-amd#2), so it is part of #828 now, with you credited for Linux support. Thanks for rebasing it onto the new head. Feel free to close this one whenever suits you.
N3oTraX commented 2026-11-09 01:07:30 +00:00 (Migrated from github.com)

Closing: this landed in amd/fsr4 through madebyjordan/hookshot-amd#2, which #828 carries. #871 builds on it.

Closing: this landed in `amd/fsr4` through madebyjordan/hookshot-amd#2, which #828 carries. #871 builds on it.
Commenting is not possible because the repository is archived.
No description provided.