Repository navigation
Cap the host view heap on every GPU: AMD page-faulted at view slot 2^23 - #98
sillynocodecat wants to merge 1 commit into
Conversation
NVIDIA's driver refuses a shader-visible view heap past 1,000,000 views, so there the heap is capped, its last slot kept null and every view index at or past it clamped to that slot (set_view_heap_limit). 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: on an RX 7800 XT (driver 26.11.2, Series X profile) the card was removed early in the opening cutscene, every run, at the same frame. DRED named the read: page fault at 0x112840000; view heap 0x102840000+0x2e00000: 0xd200000 past its end (slot 8388608) With the heap capped as on NVIDIA the same machine plays the opening cutscene through to the prologue and stays up (15 minutes in the prison, no device loss, ~3.4-4.3 fps), with textures, sky and sunlight as on the RTX 4070. The cap is now the default on every GPU; VICTORY_PORTABLE_HEAP=0 gives the whole heap back. It changes translations, so the shader cache keys on it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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 Heap behavior: with Same-binary comparison:
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 |
|
Same fault on an RX 7700 XT (RDNA3), Windows 11 26300, driver 32.0.32015.7029, on unmodified 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. |
|
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, Written with an AI assistant (Claude). |
|
Tested
|
|
Follow-up with this PR's build (
All 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 %. |
On 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.