Repository navigation
cuda-bindings: clean error for missing cuda.h, target-aware toolkit layout - #172
Merged
Merged
Conversation
A missing cuda.h previously fell through to bindgen, which panicked with raw clang diagnostics before cargo oxide doctor could diagnose the host (issue #87). Discovery now happens up front: probe {toolkit}/include/cuda.h and the build target's {toolkit}/targets/<dir>/include/cuda.h, and exit through the existing run()/main() error path with one message listing the probed paths, CUDA_TOOLKIT_PATH/CUDA_HOME, and the /usr/local/cuda default. The targets/ directory is chosen from cargo's TARGET env (x86_64 -> x86_64-linux, aarch64 -> sbsa-linux) rather than globbing targets/*: on multi-target installs a sorted glob puts sbsa-linux stubs ahead of x86_64-linux. The same single-target selection feeds the bindgen -I flag and the lib + lib/stubs link-search dirs. A present but unreadable cuda.h keeps the warn-and-continue probe behavior (bindgen reports the authoritative failure right after, now mapped through the clean error path instead of an expect panic); only a missing header is a hard discovery-time error. Idea credited to @yagna-1's diagnosis in #88; re-landed NVIDIA-authored because cuda-bindings cannot accept external contributions.
This was referenced Jun 12, 2026
meefs
pushed a commit
to meefs/cuda-oxide
that referenced
this pull request
Sep 30, 2026
…t arch (NVIDIA#185) Follow-ups to NVIDIA#183 (issue NVIDIA#172): - Extract redist archives with --skip-old-files --warning=existing-file: cross-archive path collisions become first-wins and visible in the build log instead of silently taking whichever archive extracted last. Reorder libnvvm ahead of cuda_nvcc so canonical nvvm/ files win under first-wins, and document that the list order now matters. - Assert bin/tileiras and nvvm/lib64/libnvvm.so exist after assembly so the exe-relative-lookup failure mode from NVIDIA#172 cannot silently regress on a future version bump. - Derive the Debian multiarch driver directory from uname -m instead of enumerating per-arch triplets: shorter, searches the host arch first, and covers future architectures without edits. - Point the hash bookkeeping at NVIDIA's redistrib_13.3.0.json manifest for future version bumps. Signed-off-by: Melih Elibol <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NVIDIA-authored re-land of the build-script hardening @yagna-1 diagnosed in #88. cuda-bindings cannot accept external contributions, so the fix lands here; #88 will be closed with
already-fixed. This addresses the panic half of #87.<root>/include/cuda.hand<root>/targets/<dir>/include/cuda.h), namesCUDA_TOOLKIT_PATH/CUDA_HOME, and states the/usr/local/cudadefault. No more bindgen panic with raw clang diagnostics.targets/directory matching cargo'sTARGET(x86_64 ->x86_64-linux, aarch64 ->sbsa-linux), never a sorted glob overtargets/*. On multi-target installssbsa-linuxsorts beforex86_64-linux, so a glob hands x86_64 builds the wrong arch's headers and stubs. The same selection feeds bindgen's-Iand thelib+lib/stubslink-search dirs.expect); only a missing header is a hard discovery-time error.CUDA_TOOLKIT_PATH=/nonexistentfails with the new message; a faketargets/{x86_64-linux,sbsa-linux}layout with a poisoned sbsa stub builds viax86_64-linuxonly.The doctor half of #87 (
cargo oxide doctorshould be reachable without cuda-bindings building first) stays open.