Skip to content

Use CUDA runtime headers from local python package - #2906

Merged
zcbenz merged 1 commit into
ml-explore:mainfrom
zcbenz:cuda-headers-local
Dec 15, 2025
Merged

zcbenz merged 1 commit into
ml-explore:mainfrom
zcbenz:cuda-headers-local

Conversation

@zcbenz

@zcbenz zcbenz commented Dec 13, 2025

Copy link
Copy Markdown
Member

Close #2842.

Search ../../nvidia/cuda_runtime/include for CUDA runtime headers, which is available when the cuda-toolkit python package is installed together with mlx. This follows the behavior of where CUDA libraries are searched:

base="\$ORIGIN/../../nvidia"
rpath=$rpath:${base}/cublas/lib:${base}/cuda_nvrtc/lib:${base}/cudnn/lib:${base}/nccl/lib
patchelf --force-rpath --set-rpath "$rpath" "$mlx_so"

Also slightly reorganizes the cmake file — especially put the CCCL related configurations together.

@zcbenz
zcbenz force-pushed the cuda-headers-local branch from a5c95d6 to 0eafcc6 Compare December 13, 2025 06:41

@awni awni left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, thanks for fixing that!

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.

Search CUDA toolkit from python packages

2 participants