Repository navigation
Runtime: support GPU-counted ExecuteIndirect DISPATCH without host readback - #3461
pmilewsskiedu-gif wants to merge 1 commit into
Conversation
|
Tried
Suggestion: return 77 instead of 1 when So I can't validate the GPU-count path on Turing with this test as written. If you'd like a check on a 32-wide NVIDIA GPU without a D3D12 host, a variant that compares the Vulkan path against expected counts (no WARP) would run here, and I'm happy to run it. AI-assisted. |
|
Code review and test of c262fb7 (AI-assisted), with probes added to this PR's test in a private copy, on RTX 3090 (Ampere, 32-wide), driver 616.56, Windows 11 23H2, under
Checked and found correct against WARP, with no new validation errors:
Checked by reading:
|
|
Tested
Code read of AI-assisted. |
|
Tested on Windows 11 (26200), NVIDIA GeForce RTX 5060 (Blackwell, 8 GB), driver 617.14, MSVC 14.44, Vulkan SDK 1.4.363.1: pass. Head c262fb7 (contains
This card has no Resizable BAR (the runtime reports upload heaps in system memory and a 256 MiB spill to host memory); the test still passes, so the path also holds on an 8 GB card. AI-assisted check (Claude Code). |
|
Tested
AI-assisted (Claude Code). No game files. |
|
Tested on Windows 11 with two GPUs on one machine (runtime built from this PR's head merged with main f847748, MSVC 14.51):
Only this test was built and run, not the full ctest. No concerns. |
|
Independent GPU test, RTX 3090 / driver 621.24 / Windows 11, subgroup 32. ctest -R d3d12_indirect_dispatch_count -V with LEONIDA_VK_VALIDATION=1: 1/1 passed. 8 native WARP vs Vulkan comparisons passed (count=0, 1, max, >max, nonzero offsets, GPU count overwrite); validation on, no errors. AI-assisted (OpenCode). |
|
Windows + GPU check: AMD Radeon RX 9070 (RDNA4), Windows 11, MSVC Release, Vulkan SDK 1.4.363. Tested head c262fb7 merged onto AI-assisted (Claude Code); runs on my machine. |
|
Addendum: full runtime CTest on the same branch build, RTX 3090 / 621.24: 125 passed, 8 skipped, 1 disabled, 0 failures; no regressions observed. Correction to my earlier wording: 133 executed, 8 skipped or disabled double-counted. Scope note: this PR uses MaxCommandCount = 3, so this run does not exercise the large-MaxCommandCount device-loss finding already reported here. AI-assisted (OpenCode). |
Claimed before coding: #3381 (comment)
Problem
For a single
D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCHcommand signature, D3D12 allowsExecuteIndirect(MaxCommandCount, ArgumentBuffer, ..., CountBuffer, ...)and runsmin(GPU_count, MaxCommandCount)records. The current Vulkan backend returnsReplayResult::unsupportedwheneverIndirectKind::dispatchhas a count buffer (runtime/src/vulkan_replay.h).vkCmdDispatchIndirecthas no count variant.Change
MaxCommandCount, chunk preprocessing to Vulkan workgroup limits, and issue ordinaryvkCmdDispatchIndirectagainst the compact scratch records.Validation (Windows 11, MSVC 19.44, Vulkan SDK 1.4.363, NVIDIA RTX 4060 Ti)
LEONIDA_VK_VALIDATION=1(core and sync validation):d3d12_indirect_dispatch_count_test8/8 bit-exact native WARP versus Vulkan GPU readbacks, with count=0, 1, 3 (maximum), 7 (>maximum), nonzero argument offset 32 and count offset 44, padded stride 20, and a GPU copy overwriting the count between two ExecuteIndirect calls on the same list; zero validation errors. Test explicitly enables and checksbufferDeviceAddress.scripts/build_runtime.ps1: 431/431 initial actions and 172/172 final incremental actions passed.Scope / limitations
This PR is for simple, single-DISPATCH-signature counted indirect calls only. It does not duplicate #2077 (D3D-283 multi-argument signatures via Vulkan device-generated commands), #1865 (ExecuteIndirect draw/graphics state), or #3270/#3318. Devices without enabled buffer-device-address support fail closed rather than pretending counted compute is supported. No genuine title boot is claimed;
game_scarlett_master.exeremains unavailable in the local package.AI-assisted development and review (GPT-6). No proprietary game assets, binaries, keys, disassembly or game shader data.