WIP: feat(builder): NVIDIA Streamline's runtime for an installation that takes it #2749
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
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!2749
Loading…
Reference in a new issue
No description provided.
Delete branch "Jiro113/Longshot:feat/builder-streamline-receipt"
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
Stacked on #2748: read its Summary first; this pull request's own commit is the last one.
With #2748 every Windows build with DLSS compiles DLSS Frame Generation through NVIDIA Streamline, but no build puts
Streamline's runtime beside the game, so no player gets it. This puts it there for a player who chose it and accepted
NVIDIA's licenses for it, and for no one else.
installation's choice,
launcher-instance.json's"streamline": true(beside"upscalers", format 1; missing isfalse), which managed play (
play --profile-id) reads; and the profile's receipt,profile.json'slicenses.streamlineat the builder's pin (the 2.14.16 release's commit), which the launcher writes once the playeraccepted NVIDIA's licenses for it. The builder never writes that receipt. The receipt is the consent alone; the choice
is per installation. Not on Linux (Streamline has no Linux runtime: a Linux installation that says it takes it
keeps its key), not with a developer's
LONGSHOT_SL_SDK.three licenses they are under taken out with the system's
tar(System32's), each checked against its SHA-256, keptin
<cache>/runtimes/, and the zip deleted. They go besidelongshot.exe, the licenses asLICENSE-NVIDIA-STREAMLINE.txt,LICENSE-NVIDIA-DLSS-FG.txtandLICENSE-NVIDIA-REFLEX.txt. Once there, the pinnedfiles are kept as they are by every later build, with no cache and no network (offline, or after the cache's prune),
and noted again as the builder's when the note lost them, so taking Streamline away still takes them out.
taris given the zip and the folder by their ASCII names from the cache's folder, whose path may not be ASCII.longshot_build.json'sstreamline:placed;kept(a file of it there is not thebuilder's, another release's: all of it left as it is, nothing downloaded);
skipped(it couldn't be had); absentwhen the build was not asked for it. The launcher reads it there to show what is in the game folder.
info'sbuild.streamlinesays it too, and the builder's capabilities gainstreamline.tar, a zip that can't be unpacked): onestreamline_skippedwarning, and thebuild goes on with DLSS as without Streamline. A play of the installation updates the game folder to try again (a new
RebuildReason::Streamline) when the cache's mark of the last try says it is time(
<cache>/runtimes/sl-runtime-<pin's first 12>.tried,runtimes::sl_retry_due): 10 minutes after a download that failed, so aplayer with no network is not held up at every play; never at a play after files that are not the pinned ones or a zip
that can't be unpacked (276 MB each time, and no different: any other build or update, and the next builder, try again). A
keptone is nottried again, or every play would update.
the pin, DLSS): every other profile keeps the key an earlier builder wrote, so it gets no update (a test pins the
formula). Choosing it or taking it back is an update of the same game folder.
builder's put there; a file the player or
scripts/fetch.py streamline --gameput there stays.downloaded at build time, this runtime from NVIDIA's release on each PC, after the player's consent), and the
launcher embeds the texts of the licenses the player accepts, as it does DLSS's (LongshotLauncher's side).
Read first:
runtimes.rs(takes_streamline,sl_runtime,sl_runtime_cached,unzip), thenplay.rsinbuild-driver(streamline_wanted,key,rebuild_reason),build.rs(the removal, the record), andlongshot-builder/src/play.rs(managed_play).Known limits, by design for now:
longshot-builder build --profileandupdate --profilehave no installation: they build without Streamline'sruntime, and the installation's next play updates again (the files come from the cache while it keeps them). The
launcher's Rebuild runs
build --profilefrom the installation's own builder, so after a Rebuild the next Playputs the runtime back. Having
buildreadlauncher-instance.jsonbeside it would avoid that; left for later.info --profilereads the profile alone: for an installation that takes Streamline it saysstalewhere play findsthe folder up to date. The launcher does not read
info'sup_to_datefor an installation (onlypresentand thecapabilities), and reads the record's
streamline.line and its message, "10 to 20 minutes", are an upscaler change's) where it is a download or a removal: a finer
message needs the stamp to say which part of the key changed.
turn itself off after a restart (not reproduced yet; a separate fix).
Testing
Tested: Windows 11, RTX 4090, NVIDIA 621.24, the game in fullscreen on a 2560x1440 120 Hz screen. An installation
as a launcher makes one (
Longshot.exe= this branch'slongshot-builder,launcher-instance.jsonwith"upscalers": ["dlss"], a profile built bybuild --profile ... --upscaler dlss --accept-licenses nvidia, thenlicenses.streamlineat the pin in itsprofile.json), each runLongshot.exe play --profile-idthrough the PC's jobqueue, to the title menu, then quit:
An installation with
"streamline": trueand the receipt, its first play (RX_VK_DLSS=1,RX_VK_DLSS_FG=1,RX_VK_FRAMEGEN_MULT=2): the fast check saidanother builder, the update downloaded the zip once (276 MB), therecord says
placedwith the ten files in itsfiles, and the game's log hasvk: Streamline started for DLSS Frame Generation,vk: Streamline: DLSS Frame Generation ready (up to 2x),Streamline Reflex: onandvk: NVIDIA DLSS: NGX started, at the title menu.The choice taken back (
"streamline": false): the fast check saidthe profile's game files, upscalers or Streamline choice changed, the update took the ten files out (streamlinegone from the record), and the game'slog has
vk: NVIDIA DLSS: NGX started, DLSS FG through NGX, and novk: Streamlineline.Another
sl.interposer.dllput by hand (a few bytes, not NVIDIA's), the choice back: the update sayssl.interposer.dll in the game folder is not the pinned one: left as it is (delete it to get the pinned one), therecord says
kept, nothing else is put there or downloaded, and the game's log saysvk: Streamline: sl.interposer.dll has no valid NVIDIA signature: not loaded, then DLSS and DLSS FG through NGX.Offline, simulated with the network left on (the ten files taken out of the game folder and the cache, and
HTTPS_PROXYto a port nothing listens on):streamline_skipped(... could not be downloaded (curl failed (exit code: 7))), the recordsays
skipped, the cache's mark saysdownload, and the game starts withvk: NVIDIA DLSS: NGX startedand DLSSFG through NGX;
NVIDIA Streamline's files were left out of the last build(the mark is recent;checkasks it before the shaders) butthe shaders are to be prepared again, and that update tries the download again and leaves it out again, as any update does;NVIDIA Streamline's files were left out of the last build, the update downloads the zip, the record saysplaced, the mark is gone, and the game hasvk: Streamline started for DLSS Frame Generation.Every play of this installation also asked for
the shaders are to be prepared againonce nothing else did,though each preparation ends
done shaders. It is not this pull request's: with #2748's builder alone (neithertouches
shaders.rsor the shader caches), the same installation's second play in a row also says it. Where ithappens, each play updates and so tries Streamline's download again, the 10 minutes notwithstanding (see Risks).
tests/run_all.py --changed origin/main: 812 passed, 23 failed, 53 skipped. 22 of them fail the same on an archiveof
origin/mainhere (--exact: this PC's toolchain);tests/test_sampler_admission.py(nothing this changetouches) fails 4 runs in 5 here and 5 in 5 on
main, the same assertion.tests/test_sl_sdk.py: 22 passed.cargo clippy --workspace --all-targets -- -D warningsandcargo fmt --all --checkpass;cargo test --workspace:the new tests pass, and the 14 that fail are among the 15 that fail on
main@22d0d2009here (llvm-mc, thelinker's and paths' tests of this PC).
2ab1debd1, is the same code: rebased on #2748's069c61a4d(a line ofdocs/dev/setup.md, which thispull request's commit already rewrote) and a line of
docs/dev/reference/build.md(info'sstalein its ownwords); the runs above are of
b11fe4536. At2ab1debd1,tests/run_all.py --changed origin/main: 811 passed, 23failed, 54 skipped, the same 23 as above.
2ab1debd1in the CI's checks image (scripts/linux/checks.Dockerfile, built locally, in WSL):cargo clippy --locked --workspace --all-targets -- -D warningspasses, andcargo test --locked -p build-driver -p longshot-builderpasses whole (188 tests inbuild-driver's library, the Streamline ones among them).The failures that also fail on
mainheretests/run_all.py:test_auto_handheld.py,test_bug_report.py,test_builder_channel.py,test_control_picture.py,test_coverage_run.py,test_crash_record.py,test_dev_ab.py,test_dev_build.py,test_dev_migrate.py,test_framegen_resources.py,test_game_menu_mouse_buttons.py,test_input_movie.py,test_job_queue.py,test_oot_menu_mouse.py,test_pads_after_menu.py,test_parity_gates.py,test_perf_send.py,test_present_source_crop.py,test_run_all_mingw.py,test_screensaver.py,test_switch_table.py,test_xinput_thread.py.cargo test --workspaceonmain@22d0d2009:a_lifted_unit_s_text_made_on_demand_compiles_to_its_file_s_object_and_is_kept_by_its_key,an_unchanged_rebuild_compiles_nothing_and_a_change_compiles_what_it_touches,doctor::tests::no_gpu_reads_as_the_game_s_header_does,from_source::cargo::tests::the_release_s_flags_name_no_path_of_this_pc,link::tests::the_linker_s_list_is_parted_from_its_output,matches_llvm_mc,nup::tests::a_package_reads_back,packages::tests::a_header_package_too_old_is_no_package,play::tests::a_first_run_writes_the_profile_from_the_copy_given_or_chosen,steam_cmd::tests::the_tile_plays_the_profile_given_with_play_first_when_the_program_needs_it,tests::a_build_for_a_profile_writes_profile_json_and_builds_its_folder_beside_the_program,tests::mod_calls_the_hook_with_a_context_and_its_status,tests::recomplauncher_s_build_step_is_a_command_line_it_takes,toolchain::tests::a_windows_link_of_the_same_inputs_makes_the_same_bytes,toolchain::tests::the_builder_s_llvm_comes_before_emsdk_and_the_path.Still to test:
vk: Streamline: ... DLSS Frame Generation does not go through it in this runand the game's own frame generation (@Beanstalk, not sent: a maintainer's call)vk: Streamline started for DLSS Frame Generation(@Beanstalk, not sent)"streamline": true, expecting no Streamline download and the game as onmain(byhand or
@Beanstalk, not sent)Measurements
Nothing to measure in this pull request: it puts files in the game folder; how DLSS FG runs through Streamline is the renderer's, measured where it was added (and no switch is added:
LONGSHOT_CACHEin the diff is a test's stand-in for the existing cache folder variable).Risks
update again at most every 10 minutes until it is had; behind a firewall that drops packets a try costs up to about 4
minutes (curl's 60 s connect time-out, 3 retries). A cache that can't be written keeps no mark, and each play tries.
A play that updates for another reason tries too: on this PC every play of an installation updated for its shaders
(
the shaders are to be prepared again, with or without this pull request), so there each offline play tries again;that check is a separate issue.
"streamline"and no receipt: nothing changes for its players.be shared (as with DLSS's).
RX_VK_DLSSG=0inlongshot_env.txt, or the installation's choice taken back. A revert stops newdownloads, but the files already put in a game folder stay there, and the game still uses them until they are
deleted.
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.it changes builds and passes its tests on Windows here and on Linux in the CI's checks image (Testing). CI's own run
of the head is still to come.
Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
Tested in game: Windows 11, RTX 4090, NVIDIA 621.24, fullscreen 2560x1440 at 120 Hz, an installation as a launcher makes one (this head b11fe4536's longshot-builder as Longshot.exe, play --profile-id, to the title menu): with the choice and the receipt the runtime is put there (record placed) and the game logs vk: Streamline started for DLSS Frame Generation and NGX started; the choice taken back takes the ten files out and DLSS FG goes through NGX; a player's own sl.interposer.dll is left as it is (kept) and not loaded; offline (simulated) the build is skipped with DLSS as today, and a play after 10 minutes online puts it there.
Possibly related, for context:
A correction to the "Tested in game" comment above: "a play after 10 minutes online" was a play with the cache's mark made 11 minutes old by hand, not 10 minutes waited, as Testing's run 4 says. That run also found every play of the installation updating for its shaders (
the shaders are to be prepared again), with this branch and with #2748's builder alone: not this pull request's, but it means the 10 minutes don't hold where that happens (Testing and Risks).b11fe453662ab1debd1aSuperseded by #2748, which now carries the runtime step.
Pull request closed