gpu: make texture pool block size configurable #1968
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!1968
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1968"
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?
@tharun-37 on GitHub · 2026-11-29 04:38 UTC · original
tharun-37:fix/pool-block-size-config→main· +101 −45 · 1 files · 2 commits · openAddresses part of #1576 (pool block size configurability).
Adds \VICTORY_POOL_BLOCK_MB\ environment variable (16, 32, 64, 128, 256 MiB) to configure the texture pool block size. Default remains 64 MiB. The block size is read once at startup and cached.
The 64 MiB default works well for larger VRAM cards, but on 8 GB cards it causes internal fragmentation (hundreds of MiB to >2 GiB trapped in partially-filled 64 MiB heaps). Users can now set \VICTORY_POOL_BLOCK_MB=16\ or \32\ to reduce fragmentation on smaller VRAM cards.
Tests use \TEST_BLOCK\ constant (64 MiB) and \set_test_block_size()\ helper to ensure deterministic test behavior regardless of environment.
Validation: \cargo test -p victory-gpu --locked\ (589 tests pass); \cargo check --workspace --locked; \cargo xtask policy\ (pre-existing lower.rs size violation unrelated to this change).
AI-assisted (OpenCode).
@ANDREANIADS on GitHub · 2026-11-29 04:48 UTC · original
Test isolation at
1df1412dbdb5e946d428dc7dcd5859f14416556e:pieces_never_overlap_and_rest_before_they_are_used_againreachesblock_size()throughtake → take_ripe → cutwithout setting the override. If it initializes the cache first, the later setter in the census test cannot change the value.I compiled the getter and setter alone with
rustc --cfg testand ran two fresh processes withVICTORY_POOL_BLOCK_MB=32. Reading once, setting the 64 MiB override, and reading again returned 32 then 32 MiB. Setting the override before the first read returned 64 then 64 MiB. In the first order, the census test’s initial 32 MiB request exceeds its 16 MiB half-block cutoff.Could pool unit tests use a fixed getter under
cfg(test), with the production parser tested separately on explicit inputs? Passing the size into each test pool would also remove the ordering dependency. Only the configuration functions were executed in this reproduction.@kibagami-nc on GitHub · 2026-11-29 05:18 UTC · original
A heads-up on the
clippy.toml: clippy rejects it. With this file at the root, every clippy run stops at once:That's on
cargo clippy -p victory-core --locked, with the same file in a checkout of main.clippy.tomlonly sets lints' options (thresholds, lists), not whether a lint is allowed. Lint levels go in attributes or in[workspace.lints]inCargo.toml. So with it, CI's clippy step fails for every PR, instead of passing.The failures on main that CI shows already have fixes in open PRs, and together they make both clippy builds clean (1,306 tests passing on the set):
lower.rs, includingmanual_checked_ops;dropping_referencesinhost.rs. Thosedrop(&guard)calls left a mutex held, a real bug, so allowing that lint workspace-wide would hide exactly that kind of mistake;dead_codeonpool::let_goand others,too_many_arguments,manual_is_multiple_of, the test lints);lower.rscrosses.Dropping
clippy.tomland the two#[allow]s from this PR keeps it to the pool block size, and CI turns green once those four are in.@ANDREANIADS on GitHub · 2026-11-29 05:35 UTC · original
Small diagnostic fix at
51c281803db5b9648a21a2f1eb46335bf111085b:stats_on()checksVICTORY_POOL_STATS=1, but the texture stats header suggestsVICTORY_POOL_BLOCK_MB=1. The size parser rejects 1 and falls back to 64 MiB. Setting it alone leaves stats disabled. Could the header keepVICTORY_POOL_STATS=1and print the effectiveblock_size() >> 20in MiB alongside the count? A short scope note would also help: the same setting sizes texture blocks, staging blocks, and both CPU buffer heap pools (upload and shared).@ANDREANIADS on GitHub · 2026-11-29 06:32 UTC · original
At
53c0cbb, thereturninnv05d1_native_readlane_gpu_referenceexits the seven-case loop. In a control-flow simulation,Noneon the first readback reached IR/lowering for 1 of 7 cases.Noneon the fourth reached 4 of 7. The remaining cases also miss optional DXIL validation when the validator is installed.Could all seven CPU checks run independently of readback?
dispatched_wordsreturnsNoneboth when host initialization fails and when an existing device rejects pipeline creation. Distinct outcomes would let the test skip unavailable hardware and report a pipeline rejection with its wave/lane case. Alternatively, this reference-test change could go into a separate PR. Only the loop was simulated.53c0cbb817to83a8fa1d8f@tharun-37 on GitHub · 2026-11-29 07:08 UTC · original
Addressed the review. This PR is back to pool.rs only.
cargo test -p victory-gpu --locked: 590 passed, 0 failed.
AI-assisted (OpenCode).
@pickles976 on GitHub · 2026-11-29 07:18 UTC · original
Adapted the pool-size option from
83a8fa1d8fonto our older Wine performance branch, preserving its existing pool ownership, alignment, submission-age and retirement rules:github.com/pickles976/VIctory-NVIDIA@c2bc938a6c. This is an adaptation, not an exact-head test.Wine 11 / Linux 6.17 / RTX 4060 Laptop 8 GiB / NVIDIA 590.48.1 / 16 GiB RAM, with the stock assertion-enabled vkd3d 2576c0b4adfae4a pair supplied app-local. Fresh intended-tree test build: 18.57 s. Separate 16 and 64 MiB processes each passed 11/11 pool tests (0 ignored), 0.79/0.64 s. The added required-device fixture checks actual native heap and staging-buffer sizes, then checks all 16,384 output words from two neighboring textures across two CPU-upload/GPU-copy/readback rounds. Existing reuse, delayed retirement, allocation-failure backoff and submission-age cases also pass.
Unlike the current PR test getter, this adaptation tests the configured production size; model stimuli scale with that size rather than introducing a mutable override. The parser still rejects unsupported values and the default remains 64 MiB.
Motivation: our preceding 64 MiB title run rendered a cutscene but hit the unchanged global 6000 MiB GPU guard at 6009 MiB. Its last pool accounting had 385 MiB free in texture blocks; this is not proof all those bytes are reclaimable. No title VRAM saving or frame-time improvement from smaller blocks has been measured yet. Smaller blocks may increase heap-allocation overhead; no safety limits or shader work were changed.
Local evidence: verify-nvidia-configurable-pool-build-20261129T071504Z, verify-nvidia-pool-16-stock-20261129T071613Z, verify-nvidia-pool-64-stock-20261129T071615Z. No game assets or images published.
@pickles976 on GitHub · 2026-11-29 07:24 UTC · original
Guarded title follow-through on the disclosed older-lineage adaptation: 16 MiB blocks did not clear this laptop’s VRAM wall. The unchanged global 6000 MiB guard stopped at 6025 MiB after ~154 s; kernel interval empty, native telemetry calls all returned, no OOM. The preceding 64 MiB run stopped at 6009 MiB after ~195 s. Different title progress/cache/OS conditions mean neither stop-time nor FPS differences are a causal regression comparison.
Last 16 MiB census: 132 blocks / 2112 MiB, 1762 MiB held, 347 MiB free in 2101 ranges, 2 MiB resting, zero empty blocks. More importantly, 15724 textures potentially fit in 276 MiB at 4 KiB alignment but occupy 1052 MiB under the retained 64 KiB-alignment policy. That is allocation-info potential, not a safe/runtime-verified 776 MiB saving. We have not enabled the historically fault-prone small-placement path.
Nine high-draw reports had a 2.3 host-FPS median; the last actual window capture was the dimming flamingo artwork, not controllable gameplay. Scope peaked at 9 GiB with 154 max events and no OOM; native query maximum 1031.6 ms. I am retaining the 64 MiB default, not recommending 16 MiB as an established performance improvement. No guard or shader behavior was weakened. Local evidence: nvidia-fork-trial-20261129T072030Z/verified-summary.json and matching guarded console/resources; stopped exact-inode/unheld backing cleanup completed.
View 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.Merge
Merge the changes and update on Forgejo.