Skip to content

Drop cub::ThreadReduce from the device sort (fixes 0.0.9 render crash) - #65

Merged
duburcqa merged 1 commit into
Genesis-Embodied-AI:mainfrom
duburcqa:fix-cccl-bundling
Jul 23, 2026
Merged

Drop cub::ThreadReduce from the device sort (fixes 0.0.9 render crash)#65
duburcqa merged 1 commit into
Genesis-Embodied-AI:mainfrom
duburcqa:fix-cccl-bundling

Conversation

@duburcqa

@duburcqa duburcqa commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Problem

0.0.9's batch renderer aborts at first render: nvrtc fails to compile the bundled device code with identifier "ThreadReduce" is undefined (NVRTC_ERROR_COMPILATION → SIGABRT), crashing all 37 batch-render tests.

Cause: sort_archetype.cpp reduces a per-part histogram with cub::ThreadReduce. That symbol lives at cub::internal:: in CUB ≤ 2.7 and at cub:: in 2.8+. #61 rewrote the call to the unqualified 2.8 form (ThreadReduce(...) via using namespace cub;), but the release wheel bundles CUDA 12.8's CUB (2.7.0), where the unqualified name doesn't resolve. (My #61 validation only used editable cluster builds against CUDA 12.9 → CUB 2.8.2, so the broken wheel went unnoticed until 0.0.9 was render-tested.)

Fix

The reduction just sums the NUM_PARTS partial histograms, and NUM_PARTS == 1 in practice (so the block is never even taken at runtime). Replace ThreadReduce with a plain unrolled loop — removing the CUB-version dependency entirely (no internal:: guessing, no CUDA-version bump; stays on 12.8).

Also, for build hygiene:

  • Pin /usr/local/cuda → the 12.8 toolkit in before-all (+ explicit cuda-cccl-12-8) so the build resolves one consistent CUDA version instead of a pre-existing symlink.
  • Print the bundled CUB version from CMake to surface any future header skew.

Validation

The device code is JIT-compiled at runtime, so the wheel-build CI only confirms the wheel compiles — it can't render. Validation is via a dev pre-release render-tested through genesis (Production job on the cluster) before cutting a real patch.

@duburcqa
duburcqa force-pushed the fix-cccl-bundling branch 2 times, most recently from 0d71006 to a5a3681 Compare July 23, 2026 06:35
@duburcqa duburcqa changed the title Bundle CUDA 12.8 CCCL/CUB matching the device code (fixes 0.0.9 render crash) Drop cub::ThreadReduce from the device sort (fixes 0.0.9 render crash) Jul 23, 2026
The batch renderer JIT-compiles its device code with nvrtc at first render.
sort_archetype.cpp summed a per-part histogram with cub::ThreadReduce, but that
symbol moved namespaces across CUB versions (cub::internal:: in <=2.7, cub:: in
2.8+), and Genesis-Embodied-AI#61 rewrote the call to the unqualified 2.8 form. The release wheel
bundles CUDA 12.8's CUB (2.7.0), so nvrtc failed with "identifier ThreadReduce
is undefined" (NVRTC_ERROR_COMPILATION) -> SIGABRT, breaking every batch-render
test in 0.0.9.

The reduction just sums the NUM_PARTS partial histograms (NUM_PARTS == 1 in
practice, so the branch is never taken at runtime). Replace ThreadReduce with a
plain loop, removing the CUB-version dependency entirely.

Also pin the wheel build to the 12.8 toolkit (/usr/local/cuda symlink + explicit
cuda-cccl-12-8) for a consistent CUDA version, and print the bundled CUB version
from CMake to surface future header skew.
@duburcqa
duburcqa force-pushed the fix-cccl-bundling branch from a5a3681 to 57f2ddb Compare July 23, 2026 06:53
@duburcqa
duburcqa merged commit 685806c into Genesis-Embodied-AI:main Jul 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant