feat(build): --build-fsr-linux makes a native FSR 4 library on the player's PC from AMD's DLL, with fsr4up-vk #2507
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2507
Loading…
Reference in a new issue
No description provided.
Delete branch "roblesleo/Longshot:fsr4-linux-build"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
AMD publishes FSR 4's Vulkan runtime as a Windows DLL only, so a Linux game folder has FSR 4 only if the player finds an
amd_fidelityfx_upscaler_vk.soto put beside the game. With--fsr --build-fsr-linux --accept-amd-licensethe builder makes one on the player's PC (nx2/fsr4_linux.py), off unless asked:amd_fidelityfx_upscaler_vk.dlland license from AMD's repository, at the existingFSRpin: the file a Windows build already fetches.scripts/fetch.py,FSR4UP). It is an independent MIT implementation of FSR 4.1.2's API for Linux.tools/setup.py, which reads AMD's SPIR-V shaders and network data out of the DLL as data.A library the player put there is never replaced, and a stamped one is built again only when fsr4up-vk's commit, the DLL or the compiler changed.
Why built there and not shipped. The library carries AMD's shaders and data. Nothing made from AMD's file is in this repository, in a release or in a download: it exists only on the PC that built it.
Why I think it may be built at all, and what I would like you to check.
scripts/fetch.pydescribes AMD's license as binary-only with no reverse engineering. That is how the license file opens, "for all files except as noted below". But the list that follows, which ends "are subject to the following license" (MIT), includesKits\FidelityFX\signedbin\amd_fidelityfx_upscaler_vk.dll(line 658 ofLICENSE-AMD-FSR-SDK.md). On that reading the DLL is under the MIT terms. The list is headed "These source files" and still names DLLs, so AMD may not have meant it. I am not a lawyer: if you read it the other way, close this and I will not argue. The builder shows what it is about to do and stops without--accept-amd-licenseeither way.Third-party risk. fsr4up-vk is one person's project, published 2026-11-16. That is why every file is pinned by SHA-256 and only the 13 files the build reads are fetched.
The launcher's tick box for this is not here: that is LongshotLauncher's, after this one.
Read first:
nx2/fsr4_linux.py, thenbuild_fsr_linuxandplace_fsr_linuxinnx2/make_game.py.Testing
Tested: SteamOS, Legion Go (Ryzen Z1 Extreme, Radeon 780M, RADV Mesa 26.2.0-devel), nightly-801's builder unpacked with this branch's files, a new game folder with
--fsr --build-fsr-linux --accept-amd-license.The notice is printed, the 3 AMD files and 13 fsr4up-vk files are fetched, the asset step and the compile run with the builder's clang 23.1.5, and the folder gets
amd_fidelityfx_upscaler_vk.so(69 MB),.longshot_fsr4up,LICENSE-AMD-FSR-SDK.md,LICENSE-FSR4UP-VK.txtandTHIRD-PARTY-FSR4UP-VK.md. The library links only libc and libm.In the game:
upscalers 4.1.2 (fsr4up-vk); using 4.1.2,FSR 4.1.2 (fsr4up-vk) made for outputs of 1382x864,AMD FSR 4 draws OoT's upscale: 1286x804 -> 1382x864, 3 minutes in Castle Town, no error.tests/test_fsr4_linux.py(new, 9 cases, no compiler or network): the two commands, the pin table against them, what makes a rebuild, what is installed, the player's own library left alone. Passes.test_ffx_sdk.py,test_xess_sdk.py,test_ngx_sdk.py,test_make_game_ngx.py,test_appimage_scripts.pypass.The asset step also run on Windows with the pinned files: 1011 modules, 68.9 MB.
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, 27 failed. The 26 checks that fail are the same 26, by name, that fail onmain@9046a8d7here, 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. The 27th,test_stack_commit, failed once in that run withWindows is out of memoryand passes alone, three times in a row.On the same Legion Go, the test folder:
--update --build-fsr-linuxwithout--accept-amd-licensestops withneeds AMD's license accepted first, exit 1, nothing downloaded; with the license and nothing changed,not made againand the file is byte-identical;--updatewithout the option leaves the library and its license files as they are; a file of the player's own under that name isleft as it is.Still to test:
Measurements
Nothing to compare against
main: FSR 4 does not run on Linux there without a library. For scale, same scene on the 780M, performance profile, one run each: FSR 3.1 31 fps (GPU 24.9 ms a frame), FSR 4.1.2 from this library 32.7 fps (22.2 ms; nightly-801 for FSR 3.1, so not the same build).Risks
Off unless asked. It downloads and compiles third-party code on the player's PC: pinned by commit and SHA-256. A failed download or compile stops the build before the game is compiled, with a line saying to build again without the flag. After updating, a player who did not ask sees nothing new. To remove it: delete the
.soand.longshot_fsr4upfrom the game folder.Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
tests/that reads changed source is updated, not weakened.Assisted-by:/Co-Authored-By:trailers.Possibly related, for context:
Checks on my Windows PC:
python -I -B tests/run_all.py --changedagainst currentmain: 76 passed, 5 failed, 6 skipped.The 5 failures are the same on
mainwithout this branch, with the same messages:test_dev_build.py,test_build_long_paths.py,test_make_game_cache.py,test_linux_preflight.py,test_crash_dialog.py. They look like Windows-on-my-PC failures (POSIX paths, long paths), not this change. Not the fullmise run testand not--strict, so WIP stays in the title until CI has run.More of "Still to test", run on the same Legion Go (SteamOS), on the test folder:
--update --build-fsr-linuxwithout--accept-amd-license: stops withAMD FSR 4 for Linux needs AMD's license accepted first, exit 1, nothing downloaded.--update --build-fsr-linux --accept-amd-licensewith nothing changed:the library the last build made from the same files: not made again; the file in the folder is byte-identical.--updatewithout the option: no mention of it, the library and its three license files stay, same bytes.--updatewith the option:amd_fidelityfx_upscaler_vk.so in ... is not this builder's: left as it is; the player's file is untouched.On #2488: its Linux tick builds with
--fsrand lets the player pick a.sothey already have. This option is what would make that.so; wiring the tick to it (with AMD's license shown, as on Windows) could follow once both are in. Both leave a file already in the folder alone.WIP: feat(build): --build-fsr-linux makes a native FSR 4 library on the player's PC from AMD's DLL, with fsr4up-vkto feat(build): --build-fsr-linux makes a native FSR 4 library on the player's PC from AMD's DLL, with fsr4up-vkView 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.