Repository navigation
GPU path tracer: the path shader compiles on NVIDIA's Vulkan driver (#6705) - #6850
Conversation
|
Note 🤖 Claude Opus 5.5 responding on behalf of yhamil04 This branch also fixes the path shader on AMD. On main, AMD's Vulkan driver runs out of memory compiling Windows 11, AMD Radeon RX 6950 XT (driver 32.0.21045.5002), Vulkan,
So the memory flood is not NVIDIA-specific. Without #6813, every test thread runs its own flooding compile at once. |
…angency-labs#6705) Native compilers inline every call, and `main` inlined 33 BVH walks: three sample_path calls, and a shadow walk per light source family. NVIDIA's compiler (driver 610.88) crashed in nvgpucomp64.dll or ran out of memory. - main settles the adaptive budget first, then samples at one call site. - direct_light takes over direct_studio, visible and the fixed-light loop: one loop over the sources with one shadow-ray call site, drawing random numbers in the same order. - next_vertex (a select) replaces (a+1u)%3u: after a BVH walk that index crashed NVIDIA's compiler within seconds. main now inlines 5 BVH walks; main_inlines_few_bvh_walks counts them with naga, so the limit holds without an NVIDIA GPU. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
e5bedec to
f76bd35
Compare
|
@plexi32, thanks for the shader work. The AMD report posted on behalf of yhamil04 also helped us identify the initialization risk. We are implementing the CPU-first Interactive work in #6201 on Windows, AMD Radeon 8060S. Frozen We checked current head |
|
Note 🤖 Claude Opus 5.5 responding on behalf of plexi32 @0xlillith thanks for stopping before the device tests. That was the right call on a shared-memory iGPU. Combined source: this PR (#6850, shader: Should both land first? Yes, that's the simplest route. Test from If you test before then: apply both PRs on top of Headroom: the only numbers so far are yhamil04's on the RX 6950 XT at the old head Thanks for keeping the compiler work and Karl's Graphics API trial/revert flow intact. CPU work in the meantime sounds good. |
|
Thanks @plexi32, that clarifies the dependency. We will wait for both #6813 and #6850 to land before GPU runtime qualification, then verify the actual integrated source and start with the single exact device test, serially and with a memory cap after a fresh Pegasus resource check. We will not transfer the older discrete-GPU measurements to this iGPU or call the current head qualified. CPU Interactive work continues meanwhile. Source follow-up — 31 OctoberYour two original changes, composed against our frozen source, are now preserved as an unintegrated source proposal: 12 original hunks across the three path files, including both owner regression tests. This does not change our runtime commitment above. Rust, Naga, device and image qualification remain UNRUN; neither compiler serialization nor shader regrouping is being presented as measured iGPU headroom or pixel equivalence. We also found that merely selecting GPU Path in the native workspace starts setup, so that native journey stays behind the same prerequisite and resource gate. |
44a9f9e
Fixes #6705
Takes over #6800 (closed by its author, who asked me to carry this on).
NVIDIA's Vulkan compiler never built the GPU path tracer's
mainpipeline: on driver 610.88(RTX 4060 Ti, Windows 11) it compiled for ~25 min and then crashed in
nvgpucomp64.dll, orran out of memory. Every native compiler inlines each call, and
mainheld 33 inlined BVHwalks:
sample_pathwas called in three branches, and direct lighting walked the BVH once perlight source family (area lights, environment, sun, the fixed lights).
Changes (
path.wgsl)mainsettles first whether this invocation samples (the adaptive budget check), then callssample_pathonce. Same results: the early return for a spent budget stays before sampling.direct_lightreplacesdirect_studio,visibleand the fixed-light loop: one loop over thesources with one shadow-ray call site, as
volume_directalready does. Random numbers aredrawn in the same order (area lights, environment, sun); emitter blocking and volume
attenuation still apply to studio lighting only.
next_vertex(aselect) replaces(a+1u)%3u/(a+2u)%3uinsurface_point,surface_point_preciseandsurface_ray_depth. After a BVH walk that index made NVIDIA'scompiler crash at
nvgpucomp64.dll+0x2D564B1within seconds (the entry pointsboundary_reference,lens_reference,refracted_corner_reference).mainnow inlines 5 BVH walks.Results on the RTX 4060 Ti (driver 610.88)
main(cold driver cache)main(warm cache)solidcraft_gpulib tests,--test-threads=1solidcraft_gpulib tests, 24 threadsrender_workspace::UI testsprogressive_image_controls_route_to_the_registered_hostexits 0xC0000005(
SOLIDCRAFT_REQUIRE_GPU=1, so no GPU test skipped.) The cold compile is still long. Each testopens its own device, so a cold cache with many test threads still compiles in parallel;
the separate PR for #6706 compiles one at a time.
Test
path::tests::main_inlines_few_bvh_walksparses the shader with naga and counts the BVH walksthat
maininlines (calls followed through the call graph). It fails on main (main inlines 33 BVH walks) and passes here (≤ 5). It needs no GPU, so Linux CI guards the NVIDIA failure.In the app
Render workspace, GPU path tracing, sample design, RTX 4060 Ti: the first setup compiles for ~3 min
(peak 7.4 GB, the app stays usable and says "compiling shaders"), then the render completes; the next
start finds the pipeline in the driver cache at once. The result matches the CPU ray-traced image of
the same view. On main the same compile, run by the Render workspace test, crashed after 23–32 min
(#6705). Screenshots:
The disc around the boss and the band towards the lower-right hole are its shadows, the same in both renders.
Checks
cargo xtask cion Windows (NVIDIA): fmt, clippy, assets, layers, ui-containers, wasm and the testbinaries pass, except four that this change doesn't touch: the
solidcraft_gpulib tests with acold driver cache and 24 threads (#6706, stopped at 70 GB; with #6706 they pass in 300 s at 11.5 GB),
gpu test capture::the_renderer_counts_what_it_draws(raster edge segments, 0 on this machine),io threemf::parts_share_the_placement_budget(time budget under load) andui-egui documents::tab_tooltip_says_where_the_design_is_saved(Windows path separator).Not committed, needed to build on Windows: the #6545 test gate and an unused
cli_link::slotonWindows (clippy dead code).
Changes a default: no
🤖 Generated with Claude Code