Cap the host view heap on every GPU: AMD page-faulted at view slot 2^23 #98
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!98
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-98"
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?
@sillynocodecat on GitHub · 2026-11-24 21:28 UTC · original
sillynocodecat:amd-view-heap→main· +29 −1 · 4 files · 1 commits · openOn AMD the card is removed early in the opening cutscene, every run, at the same frame. NVIDIA's driver caps the shader-visible view heap at 1,000,000 views, so there
set_view_heap_limitclamps every view index to the heap's null slot. AMD's driver takes the title's whole heap, the clamp never turns on, and an index far past the heap's end goes through.This caps the heap on every GPU, as on NVIDIA.
VICTORY_PORTABLE_HEAP=0gives the whole heap back.DRED on the failing run (RX 7800 XT,
main+ nothing else):Slot 2^23 is about 8x past the end of a heap of ~1.5M views.
VICTORY_RELAY=2Tested on Windows 11, RX 7800 XT 16 GB (driver 26.11.2), Ryzen 5 5600, 32 GB RAM, Series X profile. Same picture as the README describes on the RTX 4070: textures, sky, sunlit exterior, shadowed areas black.
Changes
emit/shader.rs:portable_heap(), on unlessVICTORY_PORTABLE_HEAP=0.descriptor/host.rs:probe_view_limitsets the limit at once when it is on, andHostHeap::newtakes the capped branch instead of asking the driver for the whole heap.shader_cache.rs: the switch changes translations, so the cache keys on it.On NVIDIA nothing changes: the heap was capped there already.
cargo clippy -p victory-shader -p victory-gpu --all-targets -- -D warnings: clean.@ThomasHFWright on GitHub · 2026-11-24 21:45 UTC · original
Linux/NVIDIA validation: this PR changes behavior under Proton too. The capacity probe and the actual title heap have different outcomes here.
Setup: RTX 5090, Linux NVIDIA 620.73.4, GE-Proton11-14 / bundled vkd3d-proton
cae8353ed7959c4+, base4e17478b+ #20 (14a1f07) + this PR (e8cad1e). Local diagnostics add a 10-second fence timeout and per-command timestamp readback; per-list timing enabled. Runs offline, normal shaders (no debug pixel replacement or shader skips), loop limit 256.Heap behavior: with
VICTORY_PORTABLE_HEAP=0, the 1,000,001-view probe succeeds, but the actual 1,245,184 + 262,144-view allocation fails withE_INVALIDARG. The old fallback then clamps the heap. It therefore misses the early-clamp decision before the first pipeline translations. A separate synthetic Wine/vkd3d device test also accepts the probe-sized heap and verifies that this PR'sHostHeapis capped to 1,000,000 with the final slot reserved.Same-binary comparison:
c9dee8dc4ad07dd4/a2a7199b20d1ae04); next marker is untouched. All 862 dumped SPIR-V modules validate for Vulkan 1.3 with scalar block layout.022926508d7aa8ba/c3f65a5eb6b8cbb3). The late heap fallback is explicitly logged.This supports retaining the early clamp on Proton/NVIDIA, but does not establish normal world visuals or solve the remaining GPU fault: the latest capped capture is blank. This is one on/off pair with retained prefix/data and separate shader-cache keys, not a deterministic replay. Progress timestamps localize an interval, not necessarily the original source of corruption.
Checks: diagnostic build, all-target/all-feature Clippy with
-D warnings, and native asset policy pass. Full workspace: 501 passed, 6 existing Wine/vkd3d compatibility failures, 9 ignored (including two local diagnostic tests). The two local marker/heap tests pass when explicitly enabled. Existing failures are nested git/cargo under Wine, missingWSAConnectByList, two pipeline-library checks, and rejection of an intentionally bad container digest. Four console-compiler differential checks remain unavailable. No game data or raw crash logs attached.@zGLados on GitHub · 2026-11-24 22:17 UTC · original
Same fault on an RX 7700 XT (RDNA3), Windows 11 26300, driver 32.0.32015.7029, on unmodified
4e17478(diag build, Series X profile). It came about 9 minutes in, in the prologue (frame ~3027):Before that it ran stable and lit at up to 3.1 fps. Three other 8-minute runs on the same build did not reach the fault. #134 makes the same fix in a different way. I can run either PR here if that helps decide.
AI use: Claude Code (Claude Opus 5.5) ran the builds and runs and drafted this comment.
@ericomeehan on GitHub · 2026-11-25 00:25 UTC · original
Reusing the existing capped path and null-slot clamp keeps this small, and the RX 7800 XT / 7700 XT / 7900 XT reports line up well with the slot numbers.
One small log point: with the cap on,
HostHeap::newtakes the fallback arm through a syntheticE_OUTOFMEMORY, so every run logs thewarn"host view heap capped at 1000000 ... error=E_OUTOFMEMORY" even though no allocation failed. People triaging memory problems often search logs forE_OUTOFMEMORY, so a separateinfoline for the forced path (or skipping theerrorfield whenforced) would keep real failures distinguishable.Written with an AI assistant (Claude).
@zGLados on GitHub · 2026-11-25 08:02 UTC · original
Tested
e8cad1e(this PR on4e17478) on the RX 7700 XT from my comment above: the fault is gone here.4e17478unmodified, warm cache): device removed at ~545 s, frame ~3027, view-heap page fault past the heap's end.view heap capped at 1000000 on every GPU. ~2.5 fps in the scene, Series X profile, diag build.TdrDelay= 10).@zGLados on GitHub · 2026-11-25 09:13 UTC · original
Follow-up with this PR's build (
e8cad1e) on the same RX 7700 XT: the opt-in speed switches, one 15-minute run each, warm cache, Series X profile. fps = frames 2600→3200 in the window scene of the prologue, from capture times.VICTORY_LATE_WAIT=3 VICTORY_WIDE_BACK=1 VICTORY_CARD_BUFFERS_MIN_MB=1 VICTORY_CARD_BUFFERS_MB=1024VICTORY_RELAY=2+ the set aboveVICTORY_RELAY=2All four runs: no device removal, clean lit picture. On RDNA3 the relay alone gives much more here than the 3.4 → 3.7 measured on the RX 7800 XT above; the two together are not faster than the relay alone. One run per row, so roughly ±5 %.
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.