fix(gpu): enable >65,535-group indirect dispatches on NVIDIA (runs_wide) #1005
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!1005
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1005"
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?
@whoalin1 on GitHub · 2026-11-28 10:59 UTC · original
whoalin1:pr/wide-indirect-dispatches→main· +22 −7 · 1 files · 1 commits · merged 2026-11-29 08:16 UTCSummary
Allows indirect compute dispatches wider than 65,535 groups in X (up to
1 << 20, matching AMD) on NVIDIA hardware (0x10de) viaruns_wide, opt-out viaVICTORY_INDIRECT_WIDE=0.Why
NVIDIA's hardware/driver supports
2^31 - 1compute groups in X, yetindirect.rspreviously clamped every non-AMD adapter to65,535. On dense 1440p GI tile dispatches (e.g.CS_FinalGatherlists around ~67,440 groups), the tail ~1,905 groups were dropped, leaving the lower band of the frame unlit or smudged.Change (
crates/victory-gpu/src/indirect.rs)vendor(device)and addruns_wide(device)matching AMD (0x1002) or NVIDIA (0x10de), while preservingamd(device)for AMD-specific callers.widest(runs_wide(device))inmake_from.card_runs_wide_indirect_dispatchesonruns_wideadapters.Verification
Verified on Windows (
x86_64-pc-windows-msvc, RTX 4070 SUPER, driver 610.88):git diff --check origin/main..HEAD— cleancargo run --locked -p xtask -- policy—asset policy: 294 files okcargo clippy --workspace --all-targets --locked&--all-features— 0 warnings incrates/victory-gpu/src/indirect.rscargo test --release -p victory-gpu --locked --lib indirect:: -- --test-threads=1— 29 passed, 0 failed, 9 ignored (includingcard_runs_wide_indirect_dispatches)runs_wide) 6235b60c56@Dukestar69 on GitHub · 2026-11-28 11:48 UTC · original · approved these changes
Tested locally merged onto
main(63b902f).cargo xtask policypassed (294 files ok).cargo test -p victory-gpu --lib indirect::passed (29 passed; 0 failed; 9 ignored, including the newindirect::tests::card_runs_wide_indirect_dispatchesverified directly on RTX 5090 hardware) with 0 compiler warnings.Great NVIDIA wide indirect-dispatch (>65,535 groups) fix verified on hardware. LGTM.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
@Exopus-0x65f7ad0 on GitHub · 2026-11-28 13:39 UTC · original
Ran the card test natively on another architecture: RTX 5060 Ti 8 GB (Blackwell,
10de:2d04), Windows 11 26300, native D3D12.63b902f+ this PR, release.cargo test --release --locked -p victory-gpu --lib indirect::tests::card_runs_wide_indirect_dispatches -- --exact --nocapture→ passed, in 1.53 s.I added a local
eprintln!after the test's early returns, becauseWarpHarness::on(false)/runs_widereturning early would also show as "ok". It printedruns on the card, widest=1048576, so the 67,440 / 115,200 / 2^20 / 2^20+1 cases really did run on the NVIDIA card, batched and unbatched, and every group was counted once.One note for the description: D3D12 itself caps dispatches at
D3D12_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION= 65,535. The2^31 − 1figure is the Vulkan limit (maxComputeWorkGroupCount[0]) on NVIDIA. So this relies on NVIDIA's driver accepting more than the D3D12 spec allows, which it does on Blackwell here (and on Ada per your 4070 SUPER). TheVICTORY_INDIRECT_WIDE=0escape hatch seems worth keeping for that reason.@upipibi on GitHub · 2026-11-28 19:55 UTC · original
Tested on Ampere: RTX 3070 (
10de:2484), driver 616.56, Windows 11 Pro 10.0.26100, rustc 1.98.1. Debug test profile.6235b60c5. The base63b902fis 76 commits behind main32ecacfae, so I merged it onto32ecacfaelocally (--no-ff, clean, mergef1c4ec0).indirect.rsis the only file that changes.923e38cc8. See the re-check at the end.indirect::tests::card_runs_wide_indirect_dispatchesVICTORY_D3D12_WARP=1anddiagnostics, 3 runs: 1 passed, 0 failed, 0 ignored each.WarpHarness::on(false)always opens adapter 0, so these runs were also on the 3070, not on WARP.I added a temporary
eprintln!after the early returns, then removed it. It printedadapter 'NVIDIA GeForce RTX 3070' vendor 0x10de, runs_wide=true, widest(true)=1048576, and the body ran in both settings. Every case came back exact, batched and unbatched (count, max group, max thread):The per-group check (
every group once) passed for each case.With
VICTORY_INDIRECT_WIDE=0the test still shows as passed, but it returns early:widest(true)=65535, and no dispatch runs.Negative control
I reverted only the
make_fromline towidest(amd(device))and kept the test and theruns_wide/vendorhelpers it calls (git diff --statagainst the PR: 1 line inindirect.rs). Over 3 runs on hardware it failed every time, at the same place:So on Ampere the clamp at 65,535 drops the last 1,905 groups, and the PR runs all of them.
cargo test -p victory-gpu --lib --locked(PR merged onto32ecacfae, hardware)32ecacfaeon this card.watch::tests::what_the_kernel_writes_through_is_not_guarded_for_another_view(watch.rs:4650,left: Some([26361745]) right: Some([])). That is a CPU page-guard test, not in this diff. Run alone it passed 5 of 5 on this tree and 5 of 5 on main, so it looks intermittent.--features diagnosticsandVICTORY_D3D12_WARP=1: 529/1/37 twice, and 528/2/37 once.pipeline::host::tests::depth_bounds_pipeline_loads_and_filters_draws, which also fails on main under WARP.timeline::report::tests::real_waits_are_recorded_with_who_ended_them, a timing test. It passed 3 of 3 on rerun.Re-checked on the current
main923e38cc8(188 commits later;indirect.rschanged there with #851): this head merges cleanly onto it. The test then passes in 2 of 2 runs on the 3070. With only thewidest(runs_wide(device))line set back towidest(amd(device)), it fails the same way:asked for 67440, batched false, left[65535, 65534, 65534], right[67440, 67439, 67439].Not tested
CS_FinalGathercapture.923e38cc8(only this test and its control were re-run there).Upstream Marvisak/VIctory#2312 takes on the same 65,535 limit another way (it spreads dispatches across z).
AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this report.