Skip to content

Add CUDA 13 runtime headers - #3930

Draft
jasp-nerd wants to merge 1 commit into
ml-explore:mainfrom
jasp-nerd:codex/cuda-runtime-headers-3859
Draft

Add CUDA 13 runtime headers#3930
jasp-nerd wants to merge 1 commit into
ml-explore:mainfrom
jasp-nerd:codex/cuda-runtime-headers-3859

Conversation

@jasp-nerd

Copy link
Copy Markdown

Proposed changes

Fixes #3859.

The CUDA 13 backend wheel does not depend on the package containing
cuda_runtime.h. After that package is installed, its CUDA 13 headers are
under nvidia/cu13/include, while MLX only checks the CUDA 12
nvidia/cuda_runtime/include layout.

This change:

  • adds the CUDA 13 runtime package dependency;
  • resolves both the CUDA 12 and CUDA 13 package layouts while preserving the
    existing toolkit fallback;
  • requires the runtime header pair before accepting an include directory; and
  • verifies the unconditional dependency in the built CUDA 13 wheel metadata.

The path tests use isolated package trees so a system CUDA installation cannot
mask a missing package lookup. CCCL is not added because MLX already bundles
the CCCL headers used by its JIT kernels.

Validation:

focused path tests: 1 test case, 5 assertions passed
CPU C++ suite: 245 test cases, 3,243 assertions passed
mocked CUDA 13 package metadata: passed
pre-commit hooks on changed files: passed

This machine does not have a CUDA toolkit or NVIDIA GPU, so the real CUDA 13
wheel build, JIT smoke test, and Windows coverage are left to repository CI.

I used an AI coding assistant to help research and prepare this change; I
remain responsible for the submitted patch.

Checklist

  • I have read the CONTRIBUTING document
  • I have run pre-commit run --all-files to format my code / installed pre-commit prior to committing changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the necessary documentation (not needed for this packaging fix)

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.

[PACKAGING] mlx[cuda13] missing CUDA runtime/CCCL headers — first GPU op fails; silent abort under pytest

1 participant