NVIDIA: never-dispatched compute pipelines with very large local arrays lose the device (ray walks since 18189694) #509

Closed
opened 2026-11-29 17:56:33 +00:00 by NickStallman · 9 comments
NickStallman commented 2026-11-29 17:56:33 +00:00 (Migrated from github.com)
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-29T17:56:33Z.


On an RTX 5090, compute pipelines with very large local arrays make the device unusable for other pipelines, even if they are never dispatched. In ProjectScarlett, since 18189694 (which makes the ray-walk programs' pipelines creatable), the device is lost 16 to 54 s after the story starts loading, while the loading art is still up. Leaving out two of those programs stops it. I believe it is a driver bug, so I'd treat this as a workaround to make, not a defect of that commit.

Measured

RTX 5090, Linux, NVIDIA 620.70.10, GE-Proton11-14, vkd3d-proton. Build: main at 090cf6ce plus our diagnostics, #441, #390 and #468; warm caches; ProjectScarlett with breadcrumbs.

Build Runs Result
as it is 5 (66b, 66c, 68b, 71a, 72b) all lost, 16 to 54 s after the story starts loading
placed textures all committed (TUXBOX_LAZY_TEXTURES=0) 1 (69b) lost
minus #478 / minus #475 / minus #474 / minus all three 1 each (68a, 70a, 70b, 70c) lost
a compute pipeline with 32 KiB of local array created and dispatched before the story 1 (72a) lost
one program (the compressor it dies on) left out 1 (66d) lost, on another command
minus 18189694 1 (70d) not lost: ran to its 8-minute end, about 325 s after the story starts loading
with only two of its programs left out (TUXBOX_SKIP_SHADERS=d29efb84,31499244) 1 (73d) not lost: ran to its 8-minute end, about 340 s after the story starts loading

(An earlier version of this issue called that time "world". It isn't: in the surviving runs the loading art is up until about 240 s of the run, and the scene is on screen from about 300 s, at seconds a frame. One of them, 73d, was back at a loading screen by 420 s.) Repeats and tests of the mechanism are in the comments. The same signature occurs in other traced runs of older builds (18 faults in a 574 MiB range just above 4 GiB that vkd3d has nothing bound in), and I don't claim they are the same thing.

  • The GPU reports, where it does, WriteInvalid in that range, at a place no buffer, image or memory that the driver reports ever covered, on one unfinished dispatch of a program with a 512-int local array. With a 32 KiB pre-grow the address moved to 9.6 GiB, as an address inside shader-local memory would.
  • The two programs have 21,408 bytes of local array per lane, the most of the 31 that became creatable (in the whole recorded set four programs do, and four more have 10,752; all of them are console walks). The arrays are many inlined copies of the arrays in one node test in bvh_node.rs (a 32-word node and several vectors indexed at run time, 296 bytes a copy; one program holds 72 copies). None of the 31 newly creatable programs is logged as dispatched before the loss; their pipelines are created over 100 s earlier.

It matches a known driver bug

NVIDIA forum, "unused compute pipeline causes device loss": a compute pipeline with a large private array, created and never dispatched, makes another pipeline with a 512-uint private array lose the device. NVIDIA reproduced it, filed bug 6822663 and submitted a fix on 28 September 2026; no driver version is named. On their 4090 the limit was a heap of 4 GiB (bytes a thread × 196,608 threads); it did not hold on a 4070 SUPER. For a 5090 with an assumed 261,120 threads the same arithmetic gives about 16 KiB a thread, between our programs' 10,752 and 21,408. I haven't queried the driver's own numbers, or tested another driver version.

What would help

  • A translation that doesn't copy the 32-word node into a local array at each inlined use (load the words directly). I'm starting on that, so please say if you are.
  • Runs on another NVIDIA card or driver, with and without TUXBOX_SKIP_SHADERS=d29efb84,31499244.
<!-- greyfinch-sync:brcly/TuxBox:issue:6682131971 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/509). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-29T17:56:33Z. --- **On an RTX 5090, compute pipelines with very large local arrays make the device unusable for other pipelines, even if they are never dispatched.** In ProjectScarlett, since `18189694` (which makes the ray-walk programs' pipelines creatable), the device is lost 16 to 54 s after the story starts loading, while the loading art is still up. Leaving out two of those programs stops it. I believe it is a driver bug, so I'd treat this as a workaround to make, not a defect of that commit. ## Measured RTX 5090, Linux, NVIDIA 620.70.10, GE-Proton11-14, vkd3d-proton. Build: `main` at 090cf6ce plus our diagnostics, #441, #390 and #468; warm caches; ProjectScarlett with breadcrumbs. | Build | Runs | Result | |---|---|---| | as it is | 5 (66b, 66c, 68b, 71a, 72b) | all lost, 16 to 54 s after the story starts loading | | placed textures all committed (`TUXBOX_LAZY_TEXTURES=0`) | 1 (69b) | lost | | minus #478 / minus #475 / minus #474 / minus all three | 1 each (68a, 70a, 70b, 70c) | lost | | a compute pipeline with 32 KiB of local array created and dispatched before the story | 1 (72a) | lost | | one program (the compressor it dies on) left out | 1 (66d) | lost, on another command | | **minus `18189694`** | 1 (70d) | **not lost**: ran to its 8-minute end, about 325 s after the story starts loading | | **with only two of its programs left out** (`TUXBOX_SKIP_SHADERS=d29efb84,31499244`) | 1 (73d) | **not lost**: ran to its 8-minute end, about 340 s after the story starts loading | (An earlier version of this issue called that time "world". It isn't: in the surviving runs the loading art is up until about 240 s of the run, and the scene is on screen from about 300 s, at seconds a frame. One of them, 73d, was back at a loading screen by 420 s.) Repeats and tests of the mechanism are in the comments. The same signature occurs in other traced runs of older builds (18 faults in a 574 MiB range just above 4 GiB that vkd3d has nothing bound in), and I don't claim they are the same thing. - The GPU reports, where it does, `WriteInvalid` in that range, at a place no buffer, image or memory that the driver reports ever covered, on one unfinished dispatch of a program with a 512-int local array. With a 32 KiB pre-grow the address moved to 9.6 GiB, as an address inside shader-local memory would. - The two programs have 21,408 bytes of local array per lane, the most of the 31 that became creatable (in the whole recorded set four programs do, and four more have 10,752; all of them are console walks). The arrays are many inlined copies of the arrays in one node test in `bvh_node.rs` (a 32-word node and several vectors indexed at run time, 296 bytes a copy; one program holds 72 copies). None of the 31 newly creatable programs is logged as dispatched before the loss; their pipelines are created over 100 s earlier. ## It matches a known driver bug [NVIDIA forum, "unused compute pipeline causes device loss"](https://forums.developer.nvidia.com/t/383848): a compute pipeline with a large private array, created and never dispatched, makes another pipeline with a **512-uint** private array lose the device. NVIDIA reproduced it, filed bug 6822663 and submitted a fix on 28 September 2026; no driver version is named. On their 4090 the limit was a heap of 4 GiB (bytes a thread × 196,608 threads); it did not hold on a 4070 SUPER. For a 5090 with an assumed 261,120 threads the same arithmetic gives about 16 KiB a thread, between our programs' 10,752 and 21,408. I haven't queried the driver's own numbers, or tested another driver version. ## What would help - A translation that doesn't copy the 32-word node into a local array at each inlined use (load the words directly). I'm starting on that, so please say if you are. - Runs on another NVIDIA card or driver, with and without `TUXBOX_SKIP_SHADERS=d29efb84,31499244`.
NickStallman commented 2026-11-29 18:11:06 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-29T18:11:06Z.


Controls for the size, all with the 31 ray programs left out (so nothing of 18189694 is running), and one throwaway compute dispatch at the start that makes the driver reserve scratch memory for a given array size:

Pre-grown scratch per thread Result
8 KiB not lost: ran to its 8-minute end
32 KiB lost 50 s after the story starts loading (Xid 31, memory page fault)

So a large local array alone makes it happen, without the ray walks, and the size decides. That is one run each, and the 32 KiB loss was a different signature (Xid 31 rather than 13 and 109), so it shows the effect, not that it is the same mechanism in detail. On this card 16,448 bytes a thread would be 4 GiB (assuming 261,120 threads); the two programs left out in 73d are above it on their arrays alone, 8 KiB is below.

<!-- greyfinch-sync:brcly/TuxBox:comment:7260279629 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/509#issuecomment-7260279629). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-29T18:11:06Z. --- Controls for the size, all with the 31 ray programs left out (so nothing of `18189694` is running), and one throwaway compute dispatch at the start that makes the driver reserve scratch memory for a given array size: | Pre-grown scratch per thread | Result | |---|---| | 8 KiB | not lost: ran to its 8-minute end | | 32 KiB | lost 50 s after the story starts loading (Xid 31, memory page fault) | So a large local array alone makes it happen, without the ray walks, and the size decides. That is one run each, and the 32 KiB loss was a different signature (Xid 31 rather than 13 and 109), so it shows the effect, not that it is the same mechanism in detail. On this card 16,448 bytes a thread would be 4 GiB (assuming 261,120 threads); the two programs left out in 73d are above it on their arrays alone, 8 KiB is below.
brcly commented 2026-11-29 18:17:37 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-29T18:17:37Z.


Yeah I'm aware of this and after checking the current PRs, compilation is where I'm gonna focus next.

<!-- greyfinch-sync:brcly/TuxBox:comment:7260366631 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/509#issuecomment-7260366631). Originally posted by [brcly](https://github.com/brcly) on 2026-11-29T18:17:37Z. --- Yeah I'm aware of this and after checking the current PRs, compilation is where I'm gonna focus next.
NickStallman commented 2026-11-29 18:19:20 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-29T18:19:20Z.


Thanks. To avoid both of us doing it: I have a branch under way that stops the ray walk's node test from keeping local arrays in each inlined copy (the two programs above are nearly all that, 72 copies in one). It touches bvh_node.rs, tools/reference/bvh-node/node.hlsl and tests. If you'd rather take it, say so and I'll drop mine; otherwise I'll post it as a draft when its checks are through.

After the compile-speed merge I'm rerunning the mesh population test on an RTX 5090 (the one behind #473), since it changes the control flow of nearly every program.

<!-- greyfinch-sync:brcly/TuxBox:comment:7260389572 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/509#issuecomment-7260389572). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-29T18:19:20Z. --- Thanks. To avoid both of us doing it: I have a branch under way that stops the ray walk's node test from keeping local arrays in each inlined copy (the two programs above are nearly all that, 72 copies in one). It touches `bvh_node.rs`, `tools/reference/bvh-node/node.hlsl` and tests. If you'd rather take it, say so and I'll drop mine; otherwise I'll post it as a draft when its checks are through. After the `compile-speed` merge I'm rerunning the mesh population test on an RTX 5090 (the one behind #473), since it changes the control flow of nearly every program.
NickStallman commented 2026-11-29 18:30:45 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-29T18:30:45Z.


Two more runs, so the comparison isn't one against one: with 18189694 reverted, a second run (70e) and, with all 31 programs left out, a third (73a): none lost, 8 minutes each. Together with the two above, 4 of 4 runs without the two big programs survived (70d, 70e, 73d, 73a), and 12 of 12 with them were lost. The 8 KiB control (74b) survived, the 32 KiB one (74a) was lost.

<!-- greyfinch-sync:brcly/TuxBox:comment:7260541141 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/509#issuecomment-7260541141). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-29T18:30:45Z. --- Two more runs, so the comparison isn't one against one: with `18189694` reverted, a second run (70e) and, with all 31 programs left out, a third (73a): none lost, 8 minutes each. Together with the two above, 4 of 4 runs without the two big programs survived (70d, 70e, 73d, 73a), and 12 of 12 with them were lost. The 8 KiB control (74b) survived, the 32 KiB one (74a) was lost.
brcly commented 2026-11-29 19:06:09 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-29T19:06:09Z.


Thanks, please keep going with yours rather than dropping it. I'm focusing on compile time and checked what reaches the driver: across all 254 programs that declare arrays, only the BVH walks keep arrays in the compiled DXIL. 8 programs have 21,408 B per thread (72 inlined node copies, including d29efb84 and 31499244), 8 have 10,752, 23 about 7,200, and the rest are under 4 KB. The paired wave64 tbx_exec_lo arrays are all promoted to registers. Those BVH programs are also the slowest to compile (10–39 s of DXC each, 1–1.8 MB of DXIL), so your change should help compile time too. Could you push the branch as a draft PR now, even before its checks finish? I'll pull it locally and measure DXC time, DXIL size and private memory on those programs.

<!-- greyfinch-sync:brcly/TuxBox:comment:7261008756 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/509#issuecomment-7261008756). Originally posted by [brcly](https://github.com/brcly) on 2026-11-29T19:06:09Z. --- Thanks, please keep going with yours rather than dropping it. I'm focusing on compile time and checked what reaches the driver: across all 254 programs that declare arrays, only the BVH walks keep arrays in the compiled DXIL. 8 programs have 21,408 B per thread (72 inlined node copies, including d29efb84 and 31499244), 8 have 10,752, 23 about 7,200, and the rest are under 4 KB. The paired wave64 `tbx_exec_lo` arrays are all promoted to registers. Those BVH programs are also the slowest to compile (10–39 s of DXC each, 1–1.8 MB of DXIL), so your change should help compile time too. Could you push the branch as a draft PR now, even before its checks finish? I'll pull it locally and measure DXC time, DXIL size and private memory on those programs.
NickStallman commented 2026-11-29 19:15:03 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-29T19:15:03Z.


The driver bug reproduces on this card without the game. Own small Vulkan program (no vkd3d, Wine or D3D12), RTX 5090, Linux, 620.70.10, as in the forum thread: pipeline A has a 512-uint private array and is dispatched (1,095 groups of 64); pipeline B is the same shader with a larger array, created and never bound. A fresh process per size.

B's private array A's 70,080 results
none created; 4,096; 8,192; 10,752; 12,288; 14,336; 16,128; 16,384 bytes all right
16,448 bytes VK_ERROR_DEVICE_LOST, Xid 13, SM MMU fault

The card reports 170 SMs × 48 warps × 32 = 261,120 threads, and 4 GiB / 261,120 = 16,448, which was written down before the run. One pass, stopped at the first loss. So 620.70.10 has the bug, and the two ray-walk programs (21,408 bytes) are over the limit, and the others created in those runs are under it on arrays alone (spills aren't visible; two more programs of that size are in the recorded set). That the game's loss is the same bug is still inferred, but it fits at every point I could test.

<!-- greyfinch-sync:brcly/TuxBox:comment:7261129582 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/509#issuecomment-7261129582). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-29T19:15:03Z. --- **The driver bug reproduces on this card without the game.** Own small Vulkan program (no vkd3d, Wine or D3D12), RTX 5090, Linux, 620.70.10, as in the forum thread: pipeline A has a 512-uint private array and is dispatched (1,095 groups of 64); pipeline B is the same shader with a larger array, created and never bound. A fresh process per size. | B's private array | A's 70,080 results | |---|---| | none created; 4,096; 8,192; 10,752; 12,288; 14,336; 16,128; 16,384 bytes | all right | | **16,448 bytes** | **`VK_ERROR_DEVICE_LOST`**, Xid 13, SM MMU fault | The card reports 170 SMs × 48 warps × 32 = 261,120 threads, and 4 GiB / 261,120 = 16,448, which was written down before the run. One pass, stopped at the first loss. So 620.70.10 has the bug, and the two ray-walk programs (21,408 bytes) are over the limit, and the others created in those runs are under it on arrays alone (spills aren't visible; two more programs of that size are in the recorded set). That the game's loss is the same bug is still inferred, but it fits at every point I could test.
NickStallman commented 2026-11-29 19:20:57 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-29T19:20:57Z.


It's up as draft #520 (4564db59, on 2d6dc338). Full checks on both cards and game runs with it are pending; a first game run has started.

On compile time, my one measurement says the opposite of a gain: the 104 distinct translations that had such arrays took 901 s of DXC instead of 851 s (+6%; an earlier pass said +12%; loaded machine, so noisy), the slowest 108 s instead of 97 s, with 5% less DXIL. I'd trust yours over it. I haven't timed the driver's side.

Your count and mine differ: I have 4 distinct translations over 16 KiB a lane and 8 over 8 KiB. I haven't reconciled them; counting requests rather than distinct translations may be part of it.

<!-- greyfinch-sync:brcly/TuxBox:comment:7261208139 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/509#issuecomment-7261208139). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-29T19:20:57Z. --- It's up as draft #520 (4564db59, on `2d6dc338`). Full checks on both cards and game runs with it are pending; a first game run has started. On compile time, my one measurement says the opposite of a gain: the 104 distinct translations that had such arrays took 901 s of DXC instead of 851 s (+6%; an earlier pass said +12%; loaded machine, so noisy), the slowest 108 s instead of 97 s, with 5% less DXIL. I'd trust yours over it. I haven't timed the driver's side. Your count and mine differ: I have 4 distinct translations over 16 KiB a lane and 8 over 8 KiB. I haven't reconciled them; counting requests rather than distinct translations may be part of it.
NickStallman commented 2026-11-29 20:46:10 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-29T20:46:10Z.


A game run with #520 (RTX 5090, 620.70.10, 090cf6ce plus diagnostics and that change; both suspect programs requested and neither in the failure report) did not hit this: 501 s of presents after the story starts loading, against a loss within 54 s in all 12 earlier runs on that base. It was lost later, in mesh draws, by what looks like a different, older fault (see #520). One run.

<!-- greyfinch-sync:brcly/TuxBox:comment:7262342988 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/509#issuecomment-7262342988). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-29T20:46:10Z. --- A game run with #520 (RTX 5090, 620.70.10, 090cf6ce plus diagnostics and that change; both suspect programs requested and neither in the failure report) did not hit this: 501 s of presents after the story starts loading, against a loss within 54 s in all 12 earlier runs on that base. It was lost later, in mesh draws, by what looks like a different, older fault (see #520). One run.
brcly commented 2026-11-29 21:58:09 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-29T21:58:09Z.


Fixed by #520, now on main: the node test keeps no local arrays, so the largest private array in any recorded translation is 96 bytes a lane instead of 21,408. Your game run with it went 501 s past the point where all 12 earlier runs were lost, and the loss it did hit later looks like the older mesh fault. Thanks for tracking this down to the driver bug. Closing; reopen if it comes back.

<!-- greyfinch-sync:brcly/TuxBox:comment:7263297812 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/509#issuecomment-7263297812). Originally posted by [brcly](https://github.com/brcly) on 2026-11-29T21:58:09Z. --- Fixed by #520, now on `main`: the node test keeps no local arrays, so the largest private array in any recorded translation is 96 bytes a lane instead of 21,408. Your game run with it went 501 s past the point where all 12 earlier runs were lost, and the loss it did hit later looks like the older mesh fault. Thanks for tracking this down to the driver bug. Closing; reopen if it comes back.
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
brcly/TuxBox#509
No description provided.