Allowing SPM to compile on Linux with CUDA#413
Conversation
|
To compile with CUDA on Mac, just create a docker with https://github.com/gmondada/cuda-toolkit-docker/blob/main/Dockerfile.ubuntu24 |
Let me see if we have Xcode 26.4 available in CI. |
|
See #414 -- it looks like we can use the latest or a particular version of Xcode: this should be done for all the steps that do xcodebuild or xcrun |
|
@gmondada FYI
We have the newer Xcode available in CI but it isn't the default, so we need this for it to run. |
looks like this might be a file exclusion issue on macOS (apple platforms probably). |
|
Oh, I didn't notice this compilation issue and wasn't aware of the Xcode project. Thanks for bringing this to my attention. Should work now. |
|
... and didn't update the CMake build system. Now done. |
|
Why have one build system when you could have 3? |
davidkoski
left a comment
There was a problem hiding this comment.
Build is clean in CI, thank you so much for your work on this!
Proposed changes
This PR introduces an SPM plug-in allowing CUDA to be compiled by SPM on Linux.
Example1 can be compiled on Linux with command:
SPM invokes
nvcc, therefore you need the CUDA toolkit to be installed.A few notes:
tools/update-mlx.sh.--jobs=2for limiting the memory required during compilation. Solutions to mitigate this will be proposed in further PRs.Checklist
pre-commit run --all-filesto format my code / installed pre-commit prior to committing changes