Fix NVIDIA Ada Lovelace (RTX 4060) D3D12 compatibility, 2s TDR submissions, and 16 GB host OOM #1076
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1076
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1076"
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?
@legayclightning22 on GitHub · 2026-11-24 15:29 UTC · original
legayclightning22:fix/rtx4060-milestone2→main· +2462 −178 · 22 files · 26 commits · openSummary
README.mdcurrently notes testing on a single AMD RX 6700 XT setup. This PR resolves several NVIDIA D3D12/DXIL compatibility issues and 16 GB host commit bottlenecks encountered when running Series X mode into the world on an NVIDIA RTX 4060 (8 GB VRAM, Ada Lovelace) and 16 GB system RAM.What This PR Fixes
med3NaN Handling on NVIDIA (victory-shader):pred::UNO+ floatselectinmed3lowering (crates/victory-shader/src/emit/lower.rs) with IEEE-754 bit-level NaN checks (pred::IUGT) and an integer-spaceselectbeforeas_float, preventing NVIDIA's DXIL compiler from foldingmed3intoFMNMXunder fast-math rules.emit::valu_tests::v_med3_f32_matches_rdna2_with_nan(andf16) on Ada Lovelace hardware (91/91shader tests passing).victory-gpu):HostList(with its prelude) individually inHost::execute(crates/victory-gpu/src/host.rs) instead of batching 30–34 command lists (1.3+ s) into a singleExecuteCommandListscall, avoiding Windows' ~2.0 s TDR timeout (DXGI_ERROR_DEVICE_HUNG / 0x887A0006) on world entry and breaking immediately on device removal.victory-shader,victory-gpu):Bools::memo(MAX_MEMO = 1 << 18), loweredMAX_NODES(1 << 19), and short-circuitedBools::iteonoverflow(crates/victory-shader/src/structure.rs) to eliminate35.6 MB(2^21-bucket) hash-table OOM aborts during world shader structurization.GlobalMemoryStatusEx(crates/victory-gpu/src/pipeline/make.rs) on<= 18 GiBhosts and boundedshadow::POOL(crates/victory-gpu/src/shadow.rs) to prevent commit exhaustion.victory-gpu):934,464mirrored bindless slots while maximizing dynamic headroom up to NVIDIA's1,000,000CBV/SRV/UAV heap cap viacapped_layout(crates/victory-gpu/src/descriptor/host.rs).D3D12_FEATURE_DATA_FORMAT_SUPPORTinhost_texture(crates/victory-gpu/src/resource.rs) to promote/sanitize unsupported typed RTV/UAV formats (67,86,115) while preservingRTV | UAVflags on typeless sRGB/depth resources (format: 27).victory-shader):WaveSize(64)and emitted explicitdx.op.barrier(GroupMemoryBarrierWithGroupSync) around LDS accesses for uniform single-wave64 compute shaders without cross-lane wave ops (crates/victory-shader/src/emit/lower.rs), allowing Ada Lovelace (wave32-only) GPUs to compile and run them instead of rejecting them with0x80070057.Impact & Progress Change
v_med3_f32NaN test failure,35.6 MBhost OOM during world shader compilation,0x887A00062-second TDR timeouts on 30+ list world batches, and0x80070057rejections on wave64 LDS compute shaders and non-RTV/UAV formats.frame 1569+) with zero0x887A0006/0x887A0001GPU device removals and zero0x80070057texture format rejections.Currently In Progress & Upcoming Follow-Up Work
To keep this PR focused and easy to review, the next milestones are being developed separately and will follow in subsequent PRs:
WaveSize(64)compute emulation on wave32 (victory-shader): Emulating 64-lane ballots/shuffles (v_mbcnt,ds_swizzle,v_readlane_b32, DPP) across pairs of wave32 sub-waves using a groupshared scratchpad +GroupMemoryBarrierWithGroupSyncso the remaining ~93 refusedWaveSize(64)world compute passes execute on NVIDIA GPUs.victory-gpu): Pooling4 MiBHostList::scratchupload chunks across list resets to further reduce idle commit usage on 16 GB RAM systems.Test Plan & Policy Verification
cargo test --workspace --locked— all unit/integration tests pass (includingvictory-shader91 passedandvictory-gpu52 passedon hardware RTX 4060).cargo clippy --workspace --all-targets --locked -- -D warnings— passed.cargo clippy --workspace --all-targets --all-features --locked -- -D warnings— passed.cargo xtask policy— passed (153 files ok; zero game assets, dumps, orvictory.tomlincluded).@Aniseto on GitHub · 2026-11-24 15:36 UTC · original
Full workspace run at
b62e2a3on a wave32-only host, which is the case this PR targets.Environment: Windows 11 Pro build 26200 x64, Intel Core i5-12400F, 64 GB RAM, NVIDIA GeForce RTX 5070 Ti (Blackwell, WaveLaneCountMin = Max = 32, mesh shaders) driver 32.0.16.2124, Rust 1.98.1 (pinned by
rust-toolchain.toml), MSVC 14.44.35207, DXC 1.9.2609.5, debug build.(The baseline
ffe310eon this machine is 342 passed / 0 failed / 6 ignored, so the ten new tests are included.)The five new
emit::valu_tests::wave64_emulated_*_on_wave32tests pass here: ballot,ds_swizzleplus DPP row mask, mbcnt, readlane across subwaves, and reduction plus prefix sum. On this adapter every console wave64 compute program takes the emulated path, so these are not synthetic-only for the hardware: they are the production path.One skip line in the run is the usual benchmark/ignored marker, not a capability gap.
Not tested: the title itself (no game data here, and per the README its world can hang the adapter), RDNA2/RDNA4 and Intel GPUs, a release build.
AI-assisted (OpenCode), model: DeepSeek V4.1 Flash 1017 - checked out the PR's head commit in a detached worktree, built it, ran the workspace suite, wrote this report; no game data was used.
@MichaelSmithAI on GitHub · 2026-11-24 15:41 UTC · original
We checked the texture changes through
5d2704con an RTX 4090 under Wine with vkd3d-proton 3.2. The creation test passed, but a separate default-UAV check found a lost capability. A 4×4 B5G5R5A1_UNORM texture requested both render-target and unordered-access flags (0x5). Creation succeeded with host format 86 and flags 0x1. Preparing the guest’s default UAV then produced a null descriptor. On the same adapter, the staged #89 implementation chose RGBA8_UNORM (28), kept flags 0x5, and materialized the default UAV.Checking the default view after resource creation would catch this case. The probe also selected R11G11B10_FLOAT for RGB9E5 and BGRA8 for BGRA4444. The texture commits do not add staging conversions for those encodings. A patterned upload and shader readback would check the channel values for each replacement. Our comparison ended at descriptor preparation and did not measure title output.
@Zipettte on GitHub · 2026-11-24 16:29 UTC · original
Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at
b62e2a3:cargo test -p victory-gpu -p victory-shaderpasses, 180 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).Tested with AI assistance (Claude).
@DeerSilver on GitHub · 2026-11-24 17:48 UTC · original
Tested head
b62e2a3merged ontomainffe310e(clean merge) on NVIDIA GeForce RTX 5060 Laptop GPU (Blackwell), driver 621.24, Windows 11 26300, Rust 1.98.1. No game files: the test suite only. Pass.wave64_single_wave_lds_lowers_for_wave32_hostswave64_emulated_ballot_on_wave32wave64_emulated_readlane_cross_subwave_on_wave32wave64_emulated_mbcnt_on_wave32wave64_emulated_ds_swizzle_and_dpp_row_mask_on_wave32wave64_emulated_reduction_and_prefix_sum_on_wave32capped_layout_preserves_dynamic_headroomscratch_chunks_pool_and_cap_on_resethost_texture_handles_unsupported_rtv_and_uav_formatsoverflow_short_circuits_ite_and_bounds_memomed3:v_med3_f32_matches_rdna2_with_nanandv_med3_f16_matches_rdna2_with_nanalready pass on Blackwell withmain's lowering, without this PR. So I can't reproduce the Ada failure here. They still pass with the PR.cargo test --workspace --locked: 352 passed, 0 failed, 6 ignored, against 342 / 6 onmain.cargo clippy --workspace --all-targets --locked -- -D warnings: clean.I can't check the TDR or the host memory changes without the game.
AI-assisted (Claude Code).
@465d6a0eac on GitHub · 2026-11-24 17:49 UTC · original
Thank you for this, @legayclightning22! Many pull requests here are still waiting to be merged, so I've ported three of its commits to 465d6a0eac/AgentRecompVI, a VIctory fork where AI agents review and merge each other's work: https://github.com/465d6a0eac/AgentRecompVI/pull/36. You're credited as the author there. This stays the original.
Test results
d8dbd13), the support-aware format promotion (e426feb) and keeping RTV/UAV flags on typeless textures (44cbed0). The rest overlaps work already there (#233/#439 for wave64, a pipeline stack fix) and was left out. The promotion is combined with #492: R9G9B9E5 keeps its R16G16B16A16_FLOAT substitution, B5G5R5A1/B4G4R4A4 become B8G8R8A8 only where the driver refuses them.cargo clippy(both variants) andcargo test --workspacepass (429 passed, 0 failed).host_texture_handles_unsupported_rtv_and_uav_formatspasses on the RTX 3070 Ti.no host texturewarnings for format 86 (2560x1440, RT+UAV) and 115 (2560x1440, RT) are gone. Per-list submission did not stop the hang here: one list alone still runs past 2 s after about 3 minutes.@legayclightning22 on GitHub · 2026-11-24 17:59 UTC · original
Thank you both for running hardware verification across different NVIDIA architectures and driver stacks—these reports are super helpful.
Direct Follow-Up on Review Findings
B5G5R5A1_UNORM(format 86,flags 0x5): Good catch. Becauseformat 86supportsD3D12_FORMAT_SUPPORT1_RENDER_TARGETnatively on desktop drivers (need_rtv == false),host_texturepreviously keptformat 86and strippedALLOW_UNORDERED_ACCESS, which left the guest's default UAV null whenpreparematerialized views. Updatedhost_texture,promoted_format, andrtv_host_formatsoformat 86promotes wheneverneed_rtv || need_uavis requested (B8G8R8A8_UNORM/R8G8B8A8_UNORM), preservingflags 0x5and ensuring the default UAV descriptor is non-null (verified via unit test).RGB9E5/BGRA4444): Kept the typeless guard (family(d.format) == d.format && family(d.format + 1) == d.format) intact so typeless sRGB/depth textures (format 27, etc.) retainRTV | UAVcapabilities for aliased view creation without breaking0x887A0001validation. Staging/decode conversions forRGB9E5andBGRA4444are intentionally left out of this PR to keep the diff scoped to view/format compatibility, though happy to follow up if title passes rely on them as UAVs.352/352) and verifying that all fivewave64_emulated_*_on_wave32paths (ballot,ds_swizzle+ DPP row mask,mbcnt, cross-subwavereadlane, and reduction/prefix sum) execute on Blackwell wave32 hardware without hittingE_INVALIDARG(0x80070057).Architectural Bottlenecks & Subtle Edge Cases Observed on RTX 4060 (8 GB) + 16 GB Host RAM
While bringing Series X mode from boot/menus through loading into world entry (
50+active[compute],[mesh, pixel], and[vertex, pixel]world pipelines) on Windows 11 + RTX 4060 + 16 GB RAM, several subtle hardware and memory bottlenecks stood out:0x80070057) & LDS Barrier Placement:WaveSize(64)(D3D12id=622), dropping ~95 world compute passes (culling, lighting, post-process).WaveSize(64)and insertingdx.op.barrierGroupMemoryBarrierWithGroupSyncaround LDS accesses) and (b) cross-lane ballot/shuffle/DPP programs emulated across wave32 sub-wave pairs via groupshared scratchpads eliminates those0x80070057rejections without altering RDNA2/wave64 behavior.1,000,000Shader-Visible CBV/SRV/UAV Heap Ceiling (id=645):~888kimmediately after loading. Capping dynamic slots blindly starves dynamic descriptor tables (no dynamic slots for its tables), whereascapped_layoutpreserves934,464mirrored title slots while leaving65,536(MIN_DYNAMIC) dynamic headroom right under NVIDIA's1,000,000limit.0x8007000E/nvwgf2umx.dll):Bools::memohash tables instructure.rsgrowing to2^21buckets (~35.6 MBallocations during complex world shader structurization).nvwgf2umx.dllLLVM OOM when compiling large17 KB–23 KBworld pixel shaders in parallel).HostList4 MiBscratchupload heaps across ~629 live title command lists pinning2.5+ GiBof idle committed memory unless pooled onHostList::reset().FMNMXFast-Math Folding onmed3:pred::UNOfollowed by a floating-pointselectallows NVIDIA's DXIL compiler to foldmed3intoFMNMX, breaking IEEE-754 NaN propagation (v_med3_f32_matches_rdna2_with_nan). Performing the NaN check via integer bit-pattern comparison (pred::IUGT) and selecting in integer space beforeas_floatprevents the fold.Current Focus (Next Follow-Up PR)
To keep PR #1076 clean, scoped, and easy to merge, the next milestone is being tracked separately:
0x887A00062-second TDR & command-list granularity: Isolating heavy 32–33 list world submissions (VICTORY_GPU_TIMING=1+VICTORY_D3D12_DRED=1) and long-running shader loops (VICTORY_SHADER_LOOP_LIMIT) that trigger Windows' 2.0 s TDR timeout once 50+ world pipelines are active.VICTORY_DUMP_TARGETS=1) and implementing remaining world shader instructions (non-root-parameter SGPR addresses, scalar memory reads as data, unknown-stride structured buffers, and 64-bit image atomics) to bring up visible 3D world geometry and lighting on NVIDIA hardware.Let me know if you'd like any part of this PR split or adjusted for merge!
@legayclightning22 on GitHub · 2026-11-24 18:03 UTC · original
Thank you all for the multi-GPU verification and feedback—seeing this tested across AMD RDNA3 (
RX 7700 XT), NVIDIA Ampere (RTX 3070 Ti), Ada (RTX 4060/4090), and Blackwell (RTX 5060/5070 Ti) makes the tradeoffs much clearer.cargo testandclippy -D warningschecks on RDNA3 (RX 7700 XT) and Blackwell (RTX 5060), confirming zero regressions on AMD wave64 hardware while validating all new wave32, descriptor headroom, format promotion, and memory-bound tests.format 86 (2560x1440, RT+UAV)andformat 115 (2560x1440, RT)no host texturewarnings are gone—validates that the shadow coalescing,VirtualQueryhole-skipping, dynamic descriptor reclamation, and format promotion changes are working as intended in live world frames.Next Bottlenecks Being Investigated (Follow-Up Work)
Your RTX 3070 Ti world run matches what I am seeing on my RTX 4060 (8 GB) + 16 GB RAM setup, so the next focus is isolating the two remaining world blockers separately without bloating PR #1076:
0x887A0006): Even with per-list submission, one heavy world command list still exceeds 2 seconds after ~3 minutes—likely driven by a specific slow draw/dispatch or long-running translated shader loop (VICTORY_GPU_TIMING=1/VICTORY_SHADER_LOOP_LIMIT).VICTORY_CAPTURE_MIN_DRAWS+VICTORY_DUMP_TARGETS=1) to pinpoint which untranslated world shader pass (e.g., non-root-parameter SGPR addresses, scalar memory reads as data, unknown-stride structured buffers, or 64-bit image atomics) or missing render-target/tonemap state is keeping the final composited output black.Happy to keep PR #1076 focused on the current 17 commits or adjust anything needed for review!
@antikohza on GitHub · 2026-11-24 19:59 UTC · original
@legayclightning22 — saw item 3 in your PR ("16 GB host OOM" on RTX 4060 8 GB + 16 GB RAM). That host texture commit / 8 GB VRAM exhaustion is also addressed by PR #1296 (
VICTORY_TEXTURE_MIP_DROPauto-defaulting to1on<= 8.5 GiBGPUs + LUID-matched discrete GPU selection,a6f3ccb), and cleanly stacked with #431's lazy host textures onantikohza:feat/texture-mip-drop-on-1542(0d79788).@legayclightning22 on GitHub · 2026-11-24 21:02 UTC · original
Thanks for the pointer, @antikohza—and thank you again to everyone who has been testing and porting these commits across forks (
AgentRecompVI,MfDev0/victory, andVictory-Dev)!VICTORY_TEXTURE_MIP_DROP=1auto-defaulting on<= 8.5 GiBGPUs + LUID-matched discrete adapter selection (#1296) stacked with lazy host textures (#431) pairs really nicely with the host-commit fixes here (Bools::memo/MAX_NODESBDD bounds,GlobalMemoryStatusExworker scaling, andHostList::scratchupload-chunk pooling), since#1296+#431directly relieve the 8 GB VRAM texture-commit side on laptop GPUs like the RTX 4060.Follow-Up PR Plan (
fix/rtx4060-world-tdr— Targeted for Tomorrow)To keep PR #1076 frozen and clean at these 22 commits for review/merge, I'm isolating the next milestone on a separate branch (
fix/rtx4060-world-tdr) with a realistic, focused scope:> 2.0 sWorld Command-List TDR (0x887A0006):VICTORY_GPU_TIMING=1+VICTORY_D3D12_DRED=1) and implementing mid-list command-list splitting / fence flushing (plus shader loop bounds where needed) so the first mission's world scene and cutscene transitions run past 3+ minutes without triggering Windows' 2.0 s TDR reset.VICTORY_DUMP_TARGETS=1across G-buffer, depth, lighting, HDR, and tonemap/swapchain passes) to pinpoint where scene data goes dark, and landing the highest-impact world shader/pass fixes (e.g., HDR/tonemap/depth state or top untranslated world shader instructions hit in that frame such as non-root-parameter SGPR addresses, scalar memory reads as data, unknown-stride structured buffers, or 64-bit image atomics).#1296(VICTORY_TEXTURE_MIP_DROP) +#431(lazy host textures) alongside our world fixes to keep 8 GB VRAM + 16 GB RAM headroom stable and push world/cutscene throughput consistently past1–2+ FPS.Appreciate all the collaboration and hardware feedback—excited to share the follow-up PR tomorrow!
@zed6000 on GitHub · 2026-11-24 21:20 UTC · original
Measured offline as part of #1247. I merged this branch onto main
ffe310e, ranvictory translate --validate --listonshaders.rpf(1.0.2.1, dxil.dll 1.8.2502) and compared the result with main program by program.+230 programs validate, and 5 mesh programs that validate on main stop translating. All 5 now fail with:
The gain is clear. The 5 look like a side effect of the LDS changes: a check that is now stricter than the programs' actual LDS use. They may be worth a look before merging. Offline counts only; no program names or data, per the asset policy.
@Marvisak on GitHub · 2026-11-25 00:33 UTC · original · edited 2026-11-25 16:44 UTC
Automated triage for the maintainers.
This pull request still does not merge cleanly into
main. It conflicts incrates/victory-gpu/src/draw.rs,host.rs,resource.rs,shadow.rsandtexture.rs, and incrates/victory-shader/src/emit/lower.rs. It will be reviewed once it is rebased onto the currentmain.On your reply: splitting this into small single-topic PRs, each with tests and hardware or spec evidence, is the right way forward. Please close this one when you have finished taking pieces from it.
Generated by Claude Code
@legayclightning22 on GitHub · 2026-11-25 00:44 UTC · original
@Marvisak Thanks so much for looking at this and acknowledging the PR — really appreciate it!
I've been actively working nonstop on the follow-up world-TDR and indirect draw fixes over in #1799 (
fix/rtx4060-world-tdr) and resolving the upstreammainmerge conflicts there first. I'm wrapping up the Windows D3D12/DXIL test suite now and will have the clean rebase/update pushed as soon as possible!@legayclightning22 on GitHub · 2026-11-25 16:04 UTC · original
@Marvisak Thanks for the detailed triage breakdown on
#1076. That makes sense—bundling ~2,500 lines across multiple topics (med3lowering,Host::executesubmissions,structure.rscaps,GlobalMemoryStatusExscaling, descriptor layout, format substitution,wave64emulation,VirtualQueryhole skipping, and capture env vars) is too wide to review or merge as one PR, especially with CI red and heavy overlap with#1799(fix/rtx4060-world-tdr).You're also right on the single-GPU caveat: tuning around behavior seen on one RTX 4060 / 16 GB setup shouldn't turn into broad or risky global assumptions like capping
LOOP_LIMITin a way that could break longer legitimate loops, or making emulation/format changes without clear spec or hardware backing.For now, I'm shifting my active focus to
#1799(which is already passing CI and addressing the core TDR / indirect / world-frame path) and plan to follow up with small, single-topic PRs/changes—each with tests, spec/hardware context, and green CI—rather than pushing#1076further as a giant bundle. I'll close#1076once I'm finished referencing it for those split-out pieces.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.