Skip to content

cargo oxide doctor cannot diagnose missing CUDA headers because cuda-bindings panics first #87

Closed

Description

@yagna-1

Summary

On a machine without CUDA headers installed, cargo oxide doctor cannot reach the doctor checks. The cargo alias first builds cargo-oxide, which pulls cuda-bindings; that build script falls through to bindgen and panics when cuda.h is missing.

Repro

From a fresh clone on a host without /usr/local/cuda/include/cuda.h:

cargo oxide doctor

Observed failure:

warning: cuda-bindings@0.1.0: cuda-bindings: Could not read cuda.h at /usr/local/cuda/include/cuda.h: No such file or directory
wrapper.h:1:10: fatal error: 'cuda.h' file not found
thread 'main' panicked at crates/cuda-bindings/build.rs:70:10:
Unable to generate CUDA bindings: ClangDiagnostic(...)

Expected

The build script should report missing CUDA headers directly and avoid a bindgen panic. Related: CUDA redistributable/cross layouts may place headers under target-specific directories such as targets/x86_64-linux/include or targets/sbsa-linux/include; the build script should not hardcode a single target directory.

Notes

PR #88 updates the build script to:

  • discover cuda.h in both include/ and targets/*/include/
  • use the discovered header for version/cfg probing
  • pass all discovered include directories to bindgen
  • add matching target-layout library paths for discovered target roots
  • return a direct build-script error for missing/unreadable headers instead of panicking in bindgen

Activity

  1. added
    bugSomething isn't working
    cargo-oxideThe `cargo oxide` subcommand and build automation
    cuda-bindingsRaw FFI bindings to the CUDA driver/runtime
    on Jun 6, 2026
  2. nihalpasham commented on Jun 12, 2026

    @nihalpasham
    Collaborator

    Fixed in two halves:

    so cargo oxide doctor now builds and runs on a toolkit-less machine and diagnoses the missing headers itself. CI runs doctor on a toolkit-less runner to keep it that way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcargo-oxideThe `cargo oxide` subcommand and build automationcuda-bindingsRaw FFI bindings to the CUDA driver/runtime

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions