Prioritize on-screen sampled textures and fix slot_evict on 8 GB GPUs #1763
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!1763
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1763"
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?
@EduardoMFOliveira on GitHub · 2026-11-28 23:58 UTC · original
EduardoMFOliveira:fix/8gb-sampled-streaming→main· +105 −29 · 5 files · 1 commits · merged 2026-11-29 08:16 UTCSummary
Follow-up fix for 8 GB GPUs on top of
d4b5d51(tested on an NVIDIA GeForce RTX 5060 Laptop 8 GB, Series S + DLSS + FrameGen 2x).Problems Observed
slot_evictreceivedidle_ms = 600_000(10 min) whileRINGonly stores 120 seconds, causingframe_atto returnNoneafter 2 minutes of play and disabling slot eviction.slot_evictran, holdingTEXTURESacrossevictable_slots()/evict_slots()caused an AB-BA deadlock withHostHeap::mirror(madelock ->TEXTURES), triggering the title's 30s watchdog.View::Shaderfirst uploads over the room line chargedreserve = 1byte instead of the texture's footprint, allowing VRAM to reach 7,937 MB on a ~7,054 MB budget (causing 1,600+ DLSSout of VRAM (39)failures and permanently black interior textures).Changes
VICTORY_SAMPLED_MARKS=1+VICTORY_SAMPLED_EVICT=1(apps/victory/src/play.rs,crates/victory-gpu/src/sampled.rs,crates/victory-gpu/src/descriptor/host.rs,crates/victory-gpu/src/draw.rs):sampled::sampled_lately()soTextureQueue::collect_due_and_census()wakesheldslots andDue::ordered()prioritizes textures shaders are actively sampling on screen.first_uploadindraw.rsonsampled_lately(index, 120)and usedresource::object_texture_bytes()forView::Shader.slot_evict&HostHeap::slots_showing(crates/victory-gpu/src/resource.rs,crates/victory-gpu/src/descriptor/host.rs):evict_idle_msinside the 120s ring window, alignedhigh/lowwatermarks withroom_line(budget) - face_headroom_bytes(), and droppedTEXTURESbefore callingevictable_slots()/evict_slots().tabled_out() && self.tabled_stamp(i) != 0inHostHeap::slots_showing.Results & Testing
cargo test --release -p victory-gpu: 550 passed; 0 failed (and 25 passed; 0 failed on-- slotafter the final deadlock fix).cargo build --release --locked -p victory: clean release build.github-bot referenced this pull request2026-11-29 03:44:35 +00:00
@joeypercia on GitHub · 2026-11-29 04:52 UTC · original
A data point for one part of this PR, the
drop(all)beforeevict_slotsinslot_evict. On currentmainthat lock order is a real deadlock, not only a cost.On an RTX 4070 Ti (12 GB),
main568c5e5, release, Series X, the run stalled 150 s in and ended with the title's watchdog (+0x23cf683). Thread stacks taken withcdb21 s into the stall show a ring of three locks:victory-submit:sweep→let_go_idle→slot_evict→evict_slots→texture_slot_evicted(Made::lock)TEXTURES(held byslot_evictto the end)Madelockvictory-views-*,victory-aside:HostHeap::mirror_inner→begun_before→placed_texture→texture_atMadelockPLACED_TEXTUREStexture_at→create_at_address→hand_out_resource(textures().insert)PLACED_TEXTURESTEXTURESLetting
TEXTURESgo beforeevict_slots, as this PR does, breaks the ring. It doesn't depend on the card being 8 GB: it showed on a 12 GB card, and it can show wherever slot eviction runs.I had opened #1969 with only that change, before I saw it here; I'm closing it as a duplicate of this part. Since this PR conflicts with
mainnow, it might be worth landing the lock-order part on its own. #1969's branch has it as one small commit (pins the candidates withadd_ref_alive/Heldinstead of re-taking the table per texture), if that helps.(Written with Claude Code, Claude Opus 5.5.)