Skip to content

new[CMake, CI]: add CUDA GPU backend to Linux CMake Swift build option.#320

Merged
davidkoski merged 4 commits intoml-explore:mainfrom
incertum:new/enable-linux-cuda-cmake-build
Dec 18, 2025
Merged

new[CMake, CI]: add CUDA GPU backend to Linux CMake Swift build option.#320
davidkoski merged 4 commits intoml-explore:mainfrom
incertum:new/enable-linux-cuda-cmake-build

Conversation

@incertum
Copy link
Contributor

Proposed changes

  • Add CUDA GPU backend to Linux CMake Swift build option.
  • New CI "Linux CUDA CMake Swift Build (cuda-12.9, swift-6.2.3-RELEASE, ubuntu-24.04, x86_64)"
  • Update docs
  • Fixes linux related tasks #294 (I believe this is the last outstanding item in that issue).

@davidkoski kindly asking for a review, thanks a bunch in advance!

CC @madrob @Joannis

Checklist

Put an x in the boxes that apply.

  • 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 (if needed)

Signed-off-by: Melissa Kilby <mkilby@apple.com>
Signed-off-by: Melissa Kilby <mkilby@apple.com>
Signed-off-by: Melissa Kilby <mkilby@apple.com>
mkdir -p build
pushd build
cmake -DMLX_BUILD_METAL=OFF -DMLX_BUILD_CUDA=ON -DMLX_C_BUILD_EXAMPLES=OFF .. -G Ninja
ninja
Copy link
Collaborator

Choose a reason for hiding this comment

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

can this run the swift tests? there might be one or two metal specific ones that we have to exclude

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think only MLXFastKernelTests.swift won't run on CUDA. Maybe that should be renamed to have Metal in the name as it is Metal specific. There is additional API that we can build to do custom CUDA kernels along the same lines, but we can add that later.

@Joannis
Copy link
Contributor

Joannis commented Dec 18, 2025

Excellent! Thanks for the mention, looking very forward to this.

Copy link
Collaborator

@davidkoski davidkoski left a comment

Choose a reason for hiding this comment

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

Changes look good!

I think we should run the unit tests but that can be added as a follow-on.

@incertum
Copy link
Contributor Author

Changes look good!

I think we should run the unit tests but that can be added as a follow-on.

Great point re unit tests for the next PR. I can take a look shortly, but let's do it in a new PR.
Just added a small commit on top to split out the install script as we may need to reuse it once we support SwiftPM for CUDA.

Signed-off-by: Melissa Kilby <mkilby@apple.com>
@incertum incertum force-pushed the new/enable-linux-cuda-cmake-build branch from c3d984a to f173d56 Compare December 18, 2025 18:00
@davidkoski davidkoski merged commit 3abaa44 into ml-explore:main Dec 18, 2025
7 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.

linux related tasks

3 participants