NVIDIA RTX 3060: device hung/removed entering the world: view heap cap at 1M, wave64-only compute shaders #3330

Open
opened 2026-11-26 18:24:17 +00:00 by eda9777cz-gif · 2 comments
eda9777cz-gif commented 2026-11-26 18:24:17 +00:00 (Migrated from github.com)
Contributor

Imported from Marvisak/VIctory. Originally posted by eda9777cz-gif on 2026-11-26T18:24:17Z.


Setup

  • GPU: NVIDIA GeForce RTX 3060 12 GB, driver 32.0.16.2140 (2026-11-21)
  • CPU: Intel Core i5-11400F, Windows 10.0.26200
  • VIctory at 63bcca4 ("update readme"), Series 1.0.2.1, diag build, VICTORY_D3D12_DRED=1

Stock build

Menus, the intro video and loading run fine at 30 fps. Shortly after the world starts, the device is removed with DXGI_ERROR_DEVICE_HUNG (0x887A0006). I found two NVIDIA-specific causes:

  1. View heap cap. host view heap capped at 1000000 ... count=1245184. After that there are ~40,000 title slot past the host heap warnings (index up to ~975k). HEAP_VIEWS is 1 << 21, so translated shaders clamp indices to 2,097,151. That is past NVIDIA's 1,000,000-descriptor shader-visible heap, so on NVIDIA the clamp doesn't prevent the fault (the code's own shortcut comment says as much).
  2. Wave size. The debug layer reports Shader wants wave lane count of 64 but maximum wave lane count for device is 32 for ~90 compute shaders, and their pipelines are refused (0x80070057). These include tiled_lighting, deferred_lighting/deferred_tiled, cascadeshadows_*, InstanceCulling, depth_pyramid, TAA, DepthOfField, GPU particles, hair_resolve and sr_tracing.

Experiments (patch below)

  • HEAP_VIEWS = 1_000_000, with 4 slots reserved at the end of the capped heap so the null buffer views at HEAP_VIEWS - 2/-1 fit. The game then gets through loading into the intro cutscene: the credits are drawn, there is audio, and it doesn't crash.
  • One hang left: DRED points at WindNew: CS_CopyLatestWindFieldForRenderingWithSmooth (00167d58cc5a78d7, 4x4x4 threads, dispatch 16x16x16). It never completes within the TDR timeout on the 3060. With VICTORY_SKIP_PIPELINES=00167d58cc5a78d7 the game runs on.
  • wave64 programs as wave32 (wave = 32 in lower.rs): most refused pipelines are now created. This variant also split the XboxBvhBuilder.dll programs 28918b7150a7aad5 and caa78b8ca62bc3d6 (64 threads, LDS shared without barriers), and those hang the GPU. Keeping single-wave LDS programs (threads <= 64 with LDS) at wave64 avoids the hang. Those 64 programs stay refused, though. They include tiled_lighting: CS_MaterialTiles* / CS_ShadowRevealTiles*, deferred_tiled: CS_DepthProcessingHBO, shader_binning_utils, shadowmask, sr_tracing, indirect_light_probes, lens_flares and subsurfacescatter. The result: 2,000–3,000 draws/frame and no crash, but a black image (presumably no tiled lighting), with about 5 s/frame on the GPU.

So on NVIDIA (and anything without wave64) the main gap seems to be running wave64 programs on 32-lane hosts, especially single-wave programs that share LDS without barriers. The heap-cap change looks like a cheap fix on its own.

Full patch: attached victory-nvidia.patch.

I can run test builds or collect logs on this machine if that helps.

(Investigated and written up with help from Claude.)

issue.md

<!-- greyfinch-sync:Marvisak/VIctory:issue:6632803032 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/3330). Originally posted by [eda9777cz-gif](https://github.com/eda9777cz-gif) on 2026-11-26T18:24:17Z. --- ## Setup - GPU: NVIDIA GeForce RTX 3060 12 GB, driver 32.0.16.2140 (2026-11-21) - CPU: Intel Core i5-11400F, Windows 10.0.26200 - VIctory at `63bcca4` ("update readme"), Series 1.0.2.1, `diag` build, `VICTORY_D3D12_DRED=1` ## Stock build Menus, the intro video and loading run fine at 30 fps. Shortly after the world starts, the device is removed with `DXGI_ERROR_DEVICE_HUNG` (0x887A0006). I found two NVIDIA-specific causes: 1. **View heap cap.** `host view heap capped at 1000000 ... count=1245184`. After that there are ~40,000 `title slot past the host heap` warnings (index up to ~975k). `HEAP_VIEWS` is `1 << 21`, so translated shaders clamp indices to 2,097,151. That is past NVIDIA's 1,000,000-descriptor shader-visible heap, so on NVIDIA the clamp doesn't prevent the fault (the code's own shortcut comment says as much). 2. **Wave size.** The debug layer reports `Shader wants wave lane count of 64 but maximum wave lane count for device is 32` for ~90 compute shaders, and their pipelines are refused (0x80070057). These include tiled_lighting, deferred_lighting/deferred_tiled, cascadeshadows_*, InstanceCulling, depth_pyramid, TAA, DepthOfField, GPU particles, hair_resolve and sr_tracing. ## Experiments (patch below) - **`HEAP_VIEWS = 1_000_000`**, with 4 slots reserved at the end of the capped heap so the null buffer views at `HEAP_VIEWS - 2/-1` fit. The game then gets through loading into the intro cutscene: the credits are drawn, there is audio, and it doesn't crash. - **One hang left:** DRED points at `WindNew: CS_CopyLatestWindFieldForRenderingWithSmooth` (`00167d58cc5a78d7`, 4x4x4 threads, dispatch 16x16x16). It never completes within the TDR timeout on the 3060. With `VICTORY_SKIP_PIPELINES=00167d58cc5a78d7` the game runs on. - **wave64 programs as wave32** (`wave = 32` in `lower.rs`): most refused pipelines are now created. This variant also split the XboxBvhBuilder.dll programs `28918b7150a7aad5` and `caa78b8ca62bc3d6` (64 threads, LDS shared without barriers), and those hang the GPU. Keeping single-wave LDS programs (threads <= 64 with LDS) at wave64 avoids the hang. Those 64 programs stay refused, though. They include `tiled_lighting: CS_MaterialTiles*` / `CS_ShadowRevealTiles*`, `deferred_tiled: CS_DepthProcessingHBO`, `shader_binning_utils`, `shadowmask`, `sr_tracing`, `indirect_light_probes`, `lens_flares` and `subsurfacescatter`. The result: 2,000–3,000 draws/frame and no crash, but a black image (presumably no tiled lighting), with about 5 s/frame on the GPU. So on NVIDIA (and anything without wave64) the main gap seems to be running wave64 programs on 32-lane hosts, especially single-wave programs that share LDS without barriers. The heap-cap change looks like a cheap fix on its own. Full patch: attached `victory-nvidia.patch`. I can run test builds or collect logs on this machine if that helps. *(Investigated and written up with help from Claude.)* [issue.md](https://github.com/user-attachments/files/35477735/issue.md)
omarsaifuddin commented 2026-11-28 14:12:30 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by omarsaifuddin on 2026-11-28T14:12:30Z.


Same two causes as this issue on an RTX 3070 Ti (Windows 11, Ampere, wave size 32..32), and with the PRs below stacked it gets through the world load and renders the prologue instead of being removed. One card, one scene, so treat this as a data point, not proof.

What happens on plain main (63bcca4): about 2 minutes after launch, as the world loads, DXGI_ERROR_DEVICE_HUNG (0x887A0006) in a 16x16x16 dispatch of compute 00167d58cc5a78d7, in a submission that had already run 6.3 s (the 26-list submission in the report). The host view heap is capped (1245184 requested, 1,000,000 granted) and ~310k title slots are dropped.

What changed it, step by step

  1. #3476 (on #3226 + #2323 + #2885): no hang, but the same 310k "title slot past the host heap" warnings, and a title-side breakpoint at ~6.5 min (+0x5149aec, the pool crash in #698/#1232). It conflicts with #2683 (competing capped-heap fixes), so they cannot be stacked.
  2. #3518 instead: 0 dropped slots, no device removal, ran 15 to 38 minutes in my runs (with my other edits below) without that crash. It needs two follow-ups, posted on that PR: its fresh-table size uses the shader register as a count (~24x too many dynamic slots, which dropped most mesh draws), and its capped dynamic pool (64,512) is far too small.
  3. 173 of 1,568 pipelines (172 compute, 1 mesh) are refused by the driver with E_INVALIDARG. With the debug layer (Graphics Tools installed) the reason is Shader wants wave lane count of 64 but maximum wave lane count for device is 32 (185 messages): the translator declares WaveSize(64) for wave64 programs that use lane ops, and NVIDIA's maximum is 32.
  4. #2176 (wave32 translation) removes all pipeline refusals (0 of 1,578) but the translator then refuses 168 shaders (LDS shared within a wave, 64-bit wave masks, cross-half ops). #189 (wave64 Emulate, picked automatically here) gets that to 117 refused, 0 of 1,637 host pipelines refused, and is what makes the picture look right: lighting and volumetrics work, and the prologue prison yard shows up with the figures behind the fence. #3200 stacked on it changed little.

Stack used: main + #3226 + #2323 + #2885 + #3518 (hand-merged with #2885 in descriptor/host.rs, emit/lower.rs, emit/mod.rs) + #3016 + #2348 + #3670 + #3496 + #3587 + #3588 + #189 + #3200, plus my local edits: table size + 1 and span 0 in State::tables, 2^18 dynamic slots with 410,176 direct and 327,680 overflow on the capped path, and ROOT_VIEW_RUN 16 (I did not isolate that last one; it did not visibly change the held-slot count). #2091 and #3115 conflict with #189 and were left out. victory-gpu passes 236/0; #189's wave64 tests pass 40/0 on the 3070 Ti. One of #3200's tests (gpu_128_threads_ds_swizzle_and_dpp_row_mask) fails on WARP (4-lane waves) in Emulate mode while passing on the NVIDIA and AMD adapters.

Still wrong: 117 shaders refused (51 LDS without a uniform fence in split wave64, 49 divergent 64-lane ballots, 10 divergent reductions, 4 divergent cross-lane reads, 2 LDS over 32 KiB), ~800 dropped draws and dispatches after 16 minutes (mostly "root view's offset: no root view, or outside title buffers" and the refused shaders), and some ghosted panels at the edges of the frame.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7240498162 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/3330#issuecomment-7240498162). Originally posted by [omarsaifuddin](https://github.com/omarsaifuddin) on 2026-11-28T14:12:30Z. --- Same two causes as this issue on an RTX 3070 Ti (Windows 11, Ampere, wave size 32..32), and with the PRs below stacked it gets through the world load and renders the prologue instead of being removed. One card, one scene, so treat this as a data point, not proof. **What happens on plain main (`63bcca4`):** about 2 minutes after launch, as the world loads, `DXGI_ERROR_DEVICE_HUNG` (`0x887A0006`) in a 16x16x16 dispatch of compute `00167d58cc5a78d7`, in a submission that had already run 6.3 s (the 26-list submission in the report). The host view heap is capped (`1245184` requested, 1,000,000 granted) and ~310k title slots are dropped. **What changed it, step by step** 1. #3476 (on #3226 + #2323 + #2885): no hang, but the same 310k "title slot past the host heap" warnings, and a title-side breakpoint at ~6.5 min (`+0x5149aec`, the pool crash in #698/#1232). It conflicts with #2683 (competing capped-heap fixes), so they cannot be stacked. 2. #3518 instead: 0 dropped slots, no device removal, ran 15 to 38 minutes in my runs (with my other edits below) without that crash. It needs two follow-ups, posted on that PR: its fresh-table size uses the shader register as a count (~24x too many dynamic slots, which dropped most mesh draws), and its capped dynamic pool (64,512) is far too small. 3. 173 of 1,568 pipelines (172 compute, 1 mesh) are refused by the driver with `E_INVALIDARG`. With the debug layer (Graphics Tools installed) the reason is `Shader wants wave lane count of 64 but maximum wave lane count for device is 32` (185 messages): the translator declares `WaveSize(64)` for wave64 programs that use lane ops, and NVIDIA's maximum is 32. 4. #2176 (wave32 translation) removes all pipeline refusals (0 of 1,578) but the translator then refuses 168 shaders (LDS shared within a wave, 64-bit wave masks, cross-half ops). #189 (wave64 `Emulate`, picked automatically here) gets that to 117 refused, 0 of 1,637 host pipelines refused, and is what makes the picture look right: lighting and volumetrics work, and the prologue prison yard shows up with the figures behind the fence. #3200 stacked on it changed little. **Stack used:** main + #3226 + #2323 + #2885 + #3518 (hand-merged with #2885 in `descriptor/host.rs`, `emit/lower.rs`, `emit/mod.rs`) + #3016 + #2348 + #3670 + #3496 + #3587 + #3588 + #189 + #3200, plus my local edits: table size `+ 1` and span 0 in `State::tables`, 2^18 dynamic slots with 410,176 direct and 327,680 overflow on the capped path, and `ROOT_VIEW_RUN` 16 (I did not isolate that last one; it did not visibly change the held-slot count). #2091 and #3115 conflict with #189 and were left out. `victory-gpu` passes 236/0; #189's wave64 tests pass 40/0 on the 3070 Ti. One of #3200's tests (`gpu_128_threads_ds_swizzle_and_dpp_row_mask`) fails on WARP (4-lane waves) in Emulate mode while passing on the NVIDIA and AMD adapters. **Still wrong:** 117 shaders refused (51 LDS without a uniform fence in split wave64, 49 divergent 64-lane ballots, 10 divergent reductions, 4 divergent cross-lane reads, 2 LDS over 32 KiB), ~800 dropped draws and dispatches after 16 minutes (mostly "root view's offset: no root view, or outside title buffers" and the refused shaders), and some ghosted panels at the edges of the frame.
omarsaifuddin commented 2026-11-30 07:37:39 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by omarsaifuddin on 2026-11-30T07:37:39Z.


An updated run on the RTX 3070 Ti (Windows 11, driver 32.0.16.2140, 1440p) with the stack from this thread plus #3822:

main 63bcca4 + #189 + #3200 + #2703 + #2118 + #3016 + #2348 + #3670 + #3496 + #3587 + #3588 + #3226 + #2323 + #2885 + #3518 + #3822, plus the local capped-heap edits.

  • No device removal in a 20-minute run; it reaches the prologue (frames 2400-3200) at about 1 fps.
  • 95 distinct shaders refused at runtime: 51 LDS without a uniform fence, 22 divergent 64-lane ballots, 15 divergent reductions, 4 cross-lane reads, 2 LDS >32 KiB, 1 descriptor read only as data. That is down from 117 before #3822.
  • The host view heap overflow pool still exhausts (327,680 slots) during world load; the title's live views exceed the host's 737,856 title slots. It did not remove the device here.
  • The prologue shot is layered/ghosted at the same frame with and without #3822, so that is not the atomic change.

The 51 LDS-fence programs are now the largest remaining class on this host.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7271942976 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/3330#issuecomment-7271942976). Originally posted by [omarsaifuddin](https://github.com/omarsaifuddin) on 2026-11-30T07:37:39Z. --- An updated run on the RTX 3070 Ti (Windows 11, driver 32.0.16.2140, 1440p) with the stack from this thread plus #3822: `main` `63bcca4` + #189 + #3200 + #2703 + #2118 + #3016 + #2348 + #3670 + #3496 + #3587 + #3588 + #3226 + #2323 + #2885 + #3518 + #3822, plus the local capped-heap edits. - **No device removal** in a 20-minute run; it reaches the prologue (frames 2400-3200) at about 1 fps. - **95** distinct shaders refused at runtime: 51 LDS without a uniform fence, 22 divergent 64-lane ballots, 15 divergent reductions, 4 cross-lane reads, 2 LDS >32 KiB, 1 descriptor read only as data. That is down from 117 before #3822. - The host view heap overflow pool still exhausts (327,680 slots) during world load; the title's live views exceed the host's 737,856 title slots. It did not remove the device here. - The prologue shot is layered/ghosted at the same frame with and without #3822, so that is not the atomic change. The 51 LDS-fence programs are now the largest remaining class on this host.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory#3330
No description provided.