NVIDIA: never-dispatched compute pipelines with very large local arrays lose the device (ray walks since 18189694) #509
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
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:
mainat090cf6ceplus our diagnostics, #441, #390 and #468; warm caches; ProjectScarlett with breadcrumbs.TUXBOX_LAZY_TEXTURES=0)18189694TUXBOX_SKIP_SHADERS=d29efb84,31499244)(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.
WriteInvalidin 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.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
TUXBOX_SKIP_SHADERS=d29efb84,31499244.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
18189694is running), and one throwaway compute dispatch at the start that makes the driver reserve scratch memory for a given array size: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.
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.
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.hlsland 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-speedmerge 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.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
18189694reverted, 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.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_loarrays 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.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.
VK_ERROR_DEVICE_LOST, Xid 13, SM MMU faultThe 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.
Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-29T19:20:57Z.
It's up as draft #520 (
4564db59, on2d6dc338). 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.
Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-29T20:46:10Z.
A game run with #520 (RTX 5090, 620.70.10,
090cf6ceplus 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.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.