Repository navigation
Description
Actual behavior
On Windows 11 with an RTX 4060 Ti (driver 610.88, nvgpucomp64.dll 32.0.16.1088), creating the
GPU path tracer's main compute pipeline (path::Executor::new) never succeeds:
- unchanged shader (main a1b9ca1): ~25 min single-threaded in
nvgpucomp64.dllat ~1.5 GB, then the
process dies with EXCEPTION_ACCESS_VIOLATION at nvgpucomp64.dll+0x2D564B1 (same offset in
every run, from the Event Viewer; a larger thread stack doesn't help).
render_workspace::tests::progressive_image_controls_route_to_the_registered_hostdies this way. - with the crash worked around (below), the same compiler phase instead allocates ~1 GB/s
(>12 GB within seconds, still growing when stopped).
The Render workspace runs the same compile when it opens, so this probably also explains
#6583/#6596 (crash in nvgpucomp64.dll between commands) and #6561 (memory flood while
"compiling shaders" on Linux NVIDIA). I haven't verified that in the app.
Reproduction (seconds, not minutes)
The shader's own test entry points boundary_reference, lens_reference and
refracted_corner_reference crash the compiler in 4–5 s. Compile one of them from the concatenated
SHADER with create_compute_pipeline(entry_point: Some("boundary_reference")) on a Vulkan device
(a 40-line program with wgpu + pollster is enough). Reduced trigger, appended to the same shader:
@compute @workgroup_size(1)
fn mini() {
let a = trace(u.eye.xyz, u.back.xyz, false);
if a.triangle == 0xffffffffu { accumulation[0] = vec4<f32>(0.0); return; }
let p = surface_point(triangle(0u), a.bary);
accumulation[0] = vec4<f32>(p, 1.0);
}It compiles in <1 s without the early return, with bary from the uniform instead of the hit, or with
surface_point's let b=(a+1u)%3u; let c=(a+2u)%3u; written as
let b=select(a+1u,0u,a==2u); let c=select(a+2u,a-1u,a>0u); (also in surface_point_precise and
surface_ray_depth). With that rewrite all three entry points compile in <1 s.
Memory flood: what it depends on
With the select rewrite, the late compile phase still floods memory, depending on how much
traversal code is inlined into main:
main variant (with select rewrite) |
result |
|---|---|
no shadow rays, sample_path called once |
compiles: 91 s, 2.6 GB peak |
no shadow rays, three sample_path calls (as today) |
>7 GB at 67 s |
| with shadow rays, called once | >12 GB at ~160 s |
| full shader | >12 GB after ~30 min |
Not the cause: the shadow loop's 64-step bound (4 steps, or a runtime bound, also flood), the
32-entry traversal stack (8 also floods), the precise traversal for shadow rays.
main inlines sample_path three times (one per branch). Computing it once before the branches is an
easy saving, but it isn't enough alone.
Expected behavior
The path pipeline compiles in bounded time and memory on NVIDIA. If the driver can't compile it,
GPU raytracing reports itself unavailable and the app doesn't crash.
Suggestions
- Avoid the
%3uindex pattern after traversal (driver crash). - Keep
mainunder the driver's limit: onesample_pathcall site, fewer inlined traversal copies
(one traversal call per bounce shared by camera/bounce and shadow rays, or separate passes). - Since a driver crash can't be caught in-process, consider a compile time/memory budget or compiling
the path pipeline in a child process before advertising GPU raytrace.
Environment
Windows 11 Pro 26300, NVIDIA GeForce RTX 4060 Ti, driver 610.88 (32.0.16.1088), Vulkan 1.4.341,
wgpu 30, Rust 1.99.1 x86_64-pc-windows-msvc, main a1b9ca1. No RTSS/OBS Vulkan layers.
Activity
github-actions commentedon Oct 25, 2026
Claimed by @bluecmd through #6800. The claim lapses after 14 days without pushes.
claim: tangency-labs#6705
Bound NVIDIA Vulkan path shader compilation (tangency-labs#6705)
vdirienzo commentedon Oct 26, 2026
The same shader fails on a second driver here, with a different signature, and it changes what the fix in #6850 has to prove.
On Mesa 26.1.6 (ANV/BRW, Intel iGPU)
path::Executor::newnever returns. It is not a crash and not NVIDIA's ~1 GB/s flood: the compile sits in the driver's liveness analysis, holding one core at 100%, with a memory curve that plateaus and then resumes:@bluecmd measured "the linked
e5bedec9shader alone exceeded the 4 GiB probe budget after 33.1 s" on NVIDIA; the plateau here is at 33 s and 3.6 GB. It looks like the same pathology in two different compilers, which suggests the driver-side limit is a function of the inlined traversal code, exactly as the table in this issue concludes.One thing that does not work, in case it looks tempting: splitting the module per entry point. Reducing the shipped 21
@computeentry points to one (mainonly, all helper functions kept) leaves the compile unfinished and still needs more than 6 GB for that single 81 KB entry point. A trivial 169-byte control shader compiles in 16 ms on the same device, so the driver is healthy and the module is the input. The lever is the size ofmain, not the number of entry points.That means #6850's reduction from 33 to 5 inlined BVH walks is the right direction, but it needs the same measurement on this driver before it can be called fixed. A probe that reproduces it in seconds is attached to #7291; the full probe is a single-file example that opens a device with the app's own limits, builds the app's seven-binding layout, creates the same pipeline and stops itself at a memory cap.
Two follow-ups:
create_compute_pipelinehas no timeout, no cancellation and no memory bound, the setup worker is detached and cannot be interrupted, and the setup starts when the Render tab becomes active rather than when a GPU image is requested, so it runs invisibly in the background. On this driver that took the machine down (12.4 GB RSS peak, 11.7 GB swap peak).GPU path tracer: the path shader compiles on NVIDIA's Vulkan driver (t…
GPU path tracer: the path shader compiles on NVIDIA's Vulkan driver (t…