fix(vk): GPUs on the compute fallback load programs when the game makes them, not all 32,645 pipelines before the title #975
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!975
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:fix/fallback-load-create"
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?
Type: fix · Risk: medium · Tested on: not yet in the game · Needs: Windows, AMD without native mesh shaders (RX 6600 / Navi 23), any compute-fallback GPU
Why
Since rc.4, the RX 6600 (and the other Navi 23 cards) on Windows drops to 1-15 fps in Hyrule Field, Lake Hylia and elsewhere, where rc.3 ran at 30-60. The logs show the PC at its commit limit before play has started.
Two merges between rc.3 and rc.4 add up to that:
gpu/vk/load_default.h) isRX_VK_LOAD=starton any GPU without native mesh, so the RX 6600 went from loading programs when the game makes them (create) to keeping every listed program and pipeline ready before the title.From the reporters' rc.4 logs (source b784a40c):
memory: working set 8328 MB (peak 11393), private 19227 MB, thencommit limit near: 279 MB of commit left (reserve 2560 MB); the textures' budget down to 0 MB of their 72 MB (RX_VK_COMMIT_RESERVE_MB). The texture budget is 0 because of the commit rule, not VRAM: the same title showsVRAM: 5237 MB used of 6564 MB allowed (1304 MB of it free in the blocks).private 29379 MB,VRAM: 6826 MB used of 6826 MB allowed,render target images: ... 138690 made new ... VRAM short: given back, and the game's threads waiting on the render thread (timelines 513.73ms a frame summed across threads) at 1.9 fps.#805 had already measured
RX_VK_LOAD=createon two other fallback cards. On the RX 5600 XT and the GTX 1060 it gave the same fps or better, 4-5 GB less private memory and nocommit limit nearlines. That issue also suspected #563 of the growth.This PR keeps #219's fallback, which reporters say stopped the device losses, and removes the start-mode memory it brought. What it doesn't remove:
createtoo: a follow-up.its jobs 168.64 ms a frame), and some of that may be the fallback's recording.Fixes #869. See #933, #805, #563, #219.
How to reproduce
Seen on: Windows 11, RX 6600 8 GB (Adrenalin 26.8.1 and 26.10.1), Ryzen 5 3600 / 4650G, 16-32 GB (#869, #933)
Settings and switches: defaults (Auto: task + mesh compute fallback, threaded rendering)
Steps: start rc.4 and look at the
vk: precompile:andvk: memory heaps:lines at the title, then play in Hyrule Field for a whileExpected: VRAM left for textures and render targets; fps as on rc.3
Actual:
programs are loaded before the title (start): this GPU draws mesh programs through the compute fallback, 32,645 pipelines kept, the texture budget at 0, the commit limit near, and fps falling to 1-15What changed
Auto now loads programs when the game makes them (
create) on the compute fallback too, as it already does on GPUs with mesh shaders. The safety net stays as it is: an install whose loads at create wait too long getslongshot_load_start.txt, and from then on loads before the title. That covers the one fallback PC wherecreatewaited seconds (an RX 580 with 16 GB).RX_VK_LOAD=startstill gives the old behaviour.load_default::chooseingpu/vk/load_default.hno longer returns start for!native_mesh.native_meshnow only picks the reason the log gives. The comment says why, with the numbers.programs_load_decideingpu/vk/vk_programs.cpp.tests/load_default_test.cppexpects create on the fallback without the marker (its own commit, which fails onmainatCHECK(choose(nullptr, false, false).create));tests/test_load_default.py's docstring.RX_VK_LOADandRX_VK_DROP_MODULESindocs/development.md.Measurements
Verdict: not measured yet. A run on an AMD compute-fallback PC is coming: main against this PR, Hyrule Field over a long session, fps, VRAM at the title and in play, private memory,
commit limit nearlines.Hardware: -
Scene: -
Method: -
How to reproduce: -
dbad7d123aff78a2commit limit nearlinesFlags and settings
No new switch. The default of
RX_VK_LOADchanges on compute-fallback GPUs.RX_VK_LOAD(unset) on a compute-fallback GPUstartcreate(startonce the safety net's marker is there)createfor everyone, as shipped hereTesting
Tested: nothing in the game yet; runs on an RX 580 (Linux, RADV, 16 GB) are under way, with the renderer built from this change before its comments were reworded (same code). I read the code: create mode already handles the compute fallback's programs (
precompile_at_createmakes the fallback programs' compute pipelines,tests/test_fallback_loaded.py), and players have runRX_VK_LOAD=createon fallback cards (#805: RX 5600 XT, GTX 1060). The game-free checks were not run on this PC.Not tested: any GPU in the game with this build; Linux fallback GPUs (Steam Deck, which has run
RX_VK_LOAD=createin docs/tested runs); Intel GPUs before Arc.Must be tested:
programs are loaded when the game makes them (create): the default, on the compute fallback too, VRAM used at the title well under the allowance, nocommit limit nearlines on a 32 GB PC, Hyrule Field fps as on rc.3 (by hand: the AMD lab PC)python -I -B tests/run_all.py, expectingtests/test_load_default.pyto fail onmainat the first commit's check and pass here (the author's PC can't run the checks)Risks
What could break: on a fallback PC where loads at create are slow (the RX 580 case), the first visits to areas wait on loads until the safety net puts that install back on
start(one session over 2 s of long waits, or two over 500 ms). Draws whose pipelines aren't loaded yet are left out for a frame, as they already are on GPUs with mesh shaders.Turning it off:
RX_VK_LOAD=startinlongshot_env.txt, or revert the commit.Compatibility: nothing to rebuild: the shader and pipeline caches stay as they are. The first start after updating loads at create; an install whose folder already has
longshot_load_start.txtkeeps loading at start.Issues
Fixes #869
See #933
See #805
Checklist
Everyone
type(scope): description) of the status line's type.main.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named). (not run on this PC)third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.mainand passing here. (not run here: see Must be tested)tests/that reads changed source updated in this PR, not weakened.🤖 Generated with Claude Code
@Beanstalk
Beanstalk test farm
Commit
3aff78a· tier untrusted · approved by nobody yet · dashboardA member of
BigBeanscan review this commit and comment@Beanstalkto test it.3632ac007b3aff78a24dReworded, no change to the code: the description, the comment in load_default.h, the docs row and the fix commit's message now say the texture budget reached 0 by the commit rule (system RAM and page file), not by VRAM, and that #219 is what put the RX 6600 on the compute fallback and so on start-mode loading; #563 made that start costlier. The description also names what this PR doesn't remove (the compute programs #563 keeps ready, the fallback's per-draw cost). Force-pushed as
3aff78a2. No tests were run on this PC.WIP: fix(vk): GPUs on the compute fallback load programs when the game makes them, not all 32,645 pipelines before the titleto fix(vk): GPUs on the compute fallback load programs when the game makes them, not all 32,645 pipelines before the titleMeasured after the merge, on an RX 580 8 GB (RADV POLARIS10, Mesa 26.2.6, 8 logical processors, 16 GB, CachyOS, KDE Wayland, fullscreen). This is the one card where loads at create were known to be slow. The Windows RX 6600 case this PR is for is still unmeasured.
Verdict: no fps cost. On this card create made first uses wait 0.5-2.2 s a session, so the safety net put the install back on start after its second session, as designed.
Method: one
dev_packs.pybase of maindbad7d12, with main's runtime and this PR'slongshot_vk.so(same code as3aff78a2; the build predates the comment rewording), both prepared. The route: the pristine Kokiri save, Kokiri Forest, then teleports to Hyrule Field, the Market and Hyrule Field again, 40 s standing and 30 s turning in each. Cap 240, default options. Arms: M = main (start on this fallback GPU), P = this PR, C = main +RX_VK_LOAD=create. Order: warm-ups M, P, then M P C P M C M P C. fps is 1000 / the median frame time (RX_VK_FRAME_LOG), and each value is the median of the arm's runs.dbad7d12commit limit nearlinesRX_VK_DROP_MODULES); not checked. #805's Windows numbers go the other way.Still to run: a Windows RX 6600, on the same save and spot, with each of the default,
RX_VK_LOAD=createandRX_VK_TASK_MESH_FALLBACK=0. Read thecommit limit nearlines, thememory: working set ... privatelines, the GPU time against draws, and fps. No tests were run on the author's PC.bibiburl referenced this pull request2026-11-16 05:15:24 +00:00