Textures: VICTORY_TEXTURES_IN_PC=1 places streamed textures in system memory when the card is full #3070
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!3070
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3070"
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?
@Adriwin06 on GitHub · 2026-11-29 19:52 UTC · original
Adriwin06:textures-in-pc→main· +357 −60 · 4 files · 3 commits · closed without mergingWhat it changes
Off by default. When a streamed texture's host copy cannot be placed
on the card (the budget has no room for it), VICTORY_TEXTURES_IN_PC=1
places it in system memory instead of failing the upload: in a
non-local (L0) custom heap where the adapter supports one, cut from a
pool of 16 MiB system-memory blocks (PC_TEXTURES, reclaimed with the
staging pool), or as a committed allocation of just the texture's size
when a new block would not fit. Admission keeps headroom in the shared
budget (pc_texture_room), the local-VRAM admission still comes first,
and a transient allocation failure is retried. The first spill is
logged once.
Tests: resource::system_texture_admission_keeps_shared_budget_headroom,
resource::system_texture_uses_a_nonlocal_heap_when_the_adapter_supports_it.
Ported from readmet3xt-lab/foxhound@7c53527 (readmet3xt-lab), ba04392
and 5b6ebb4 (dilim), GPL-3.0-or-later.
How it was tested
cargo testpassed for the crates it touches:cargo test -p victory-gpu --lib -- resource:: pool::: 73 passed. host::uav_pool::tests::host_list_uav_pool_lifecycle_retire_trim_and_info_queue fails now and then when it runs beside the resource:: tests, on main as on this branch (1 run in 4 on each here): it reads the process-wide UAV spare poolcargo clippy --workspace --all-targets --locked: no finding that main does not already have (main has 34 of its own, which is why the Clippy step of CI is red on main itself).cargo xtask policy: no new finding (main fails it on crates/victory-loader/src/heap_sites/frame_users.rs).cargo clippyalso with--all-featuresadds no finding, andcargo test --workspace --lockedfails only tests main also fails on this machine: the five shader tests that fail on main here too (WARP's SM 6.2 and the validator) (barycentric_tests::first_half_values_render_on_hardware_and_warp, hw_tests::split_lds_wave32_read_after_read_barrier_coalescing_and_parity, intersect_tests::flat_global_stores_and_atomics_fence_uavs_at_group_barriers_across_waves, rect::tests::rectangles_are_drawn_whole, rect::tests::the_rectangle_stage_is_a_geometry_shader) and xtask's repository_passes_policy (frame_users.rs). 2208 passed, including five that fail on main (three BCPack oracle tests, the menu save race, the shader key test).Checked for overlap
None found for placing streamed textures in system memory (searched "system memory textures", "spill", "L0"). Touches the same alignment line as #3069 (small-alignment) (one line to merge).
🤖 Generated with Claude Code
@ -4441,1 +4452,4 @@}if pc_room.is_some() && texture.is_none() {tells.tell(index, write, Told::Held(frame + most));continue;@Copilot on GitHub · 2026-11-29 19:57 UTC · original
If system-memory allocation is temporarily refused for a differently formatted view of a host-written texture, the retry can lose its source contents.
seed_pendingremoves the seed before attempting allocation (texture.rs:869–880), so a later successful allocation has nothing to copy and title-memory uploads are skipped for this view. Preserve the seed until its copy is recorded, and keep the descriptor pending while seeding fails.@copilot-pull-request-reviewer[bot] on GitHub · 2026-11-29 19:57 UTC · original · reviewed
🟡 Changes recommended
Critical issues can lose host-written texture contents during allocation retries and let concurrent allocations exceed the shared-memory budget ceiling.
2 open issues
What changed in this PR
Adds an opt-in system-memory fallback for streamed textures when local video-memory admission rejects them, extending the GPU upload path without changing default behavior.
Changes:
VICTORY_TEXTURES_IN_PC=1with shared-budget checks and non-local texture allocations.crates/victory-gpu/src/resource.rscrates/victory-gpu/src/pool.rscrates/victory-gpu/src/draw.rsReview effort: Balanced
@ -1191,0 +1229,4 @@if pc.is_some() { Ripe::ALL } else { Ripe::now() }}, || {if pc.is_some_and(|(_, room)| room < block_size || crate::residency::critical_commit()) {return BlockGrowth::Deferred;@Copilot on GitHub · 2026-11-29 19:57 UTC · original
roomis a captured DXGI usage sample, buttake_from_with_growthreleases the pool lock before this check. Concurrent uploads can each allocate a 16 MiB block against the same 16 MiB allowance, crossing the 75% shared-budget ceiling; committed fallbacks inresource::host_texture_asshare this issue. Reserve pending bytes across both allocation paths, release reservations on failure, and reconcile successful allocations with usage samples before admitting further growth.@Adriwin06 on GitHub · 2026-11-30 01:10 UTC · original
Fixed in
a8bec768:seed_pendingnow leaves the seed inSEEDSuntil the copy is recorded. Transient failures (no host texture yet, no buffer) keep it for the next use, a shape mismatch still drops it, and releases already clear it. In the texture pass, a system-memory slot is held whileseed_waits(resource)is true, so title memory is not uploaded instead.@ -1191,0 +1229,4 @@if pc.is_some() { Ripe::ALL } else { Ripe::now() }}, || {if pc.is_some_and(|(_, room)| room < block_size || crate::residency::critical_commit()) {return BlockGrowth::Deferred;@Adriwin06 on GitHub · 2026-11-30 01:10 UTC · original
Fixed in
e5fc66e9: each system-memory block (in the pool's growth closure) and each committed fallback now takes aPcReservation. It adds its bytes toPC_ALLOCATINGfirst, takes a fresh DXGI sample, and goes ahead only if what is in use plus every allocation under way stays under 75% of the shared budget (fits_shared). The bytes are given back when the reservation drops, once the allocation is made (the next sample counts it) or refused. Regression test:allocations_under_way_share_one_allowance.Pull request closed