-
Notifications
You must be signed in to change notification settings - Fork 1.5k
WIP Windows CUDA support #2972
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
WIP Windows CUDA support #2972
Conversation
|
@zcbenz just FYI @dhiltgen is part of the Ollama team they are hoping to add support for Windows with MLX Cuda back-end. If I understand correctly, there is one function that doesn't compile with MSVC / nvcc on windows still ( |
|
@dhiltgen Do you have recommendations for Windows laptops for CUDA development? I usually just do Windows dev in a virtual machine but I guess I have to get Apple buy me a gaming laptop now. |
This change partially addresses windows build issues in MLX. The remaining errors are related to `add_kernel_node` which may require a deeper change to keep MSVC+NVCC happy on windows.
This commit completes the Windows port by resolving all MSVC+NVCC compatibility issues with CUDA kernels. Key changes include: - Add MLX_EXPORT macros for DLL symbol visibility on Windows - Refactor kernel instantiation to work around NVCC template limitations - Add explicit kernel instantiations for all type combinations - Fix cuFFT integration for Windows builds - Update CMake configuration for Windows-specific build requirements - Add GPU test infrastructure for Windows validation
|
@zcbenz a PC might be a better choice so you can get a GPU with a bit more VRAM. I've also added a second commit that does a deeper pass at getting things working. With that commit, I'm now able to get the tests passing on CUDA, and mlx-lm successfully ran a model on the GPU. |
|
Thanks for the update, it is really exciting that you have got CUDA backend running on Windows! Can you separate some of the changes into independent PRs? Especially the For the changes on |
|
I'll tease out the non-cuda related changes and rebase on your CI PR changes. I was trying to find a simpler approach to get the kernels registering properly, but was struggling to keep MSVC happy. Hopefully you can find a more elegant solution. |
|
I'll rebase this PR on #3024 for consistency, however if you come up with a cleaner solution to the CUDA kernel registration we can ultimately close this PR. |
|
Many thanks maintaining a working branch 🙏 ! I'm in the progress of getting access to Windows hardware so it will take some time before I can look into this. |
Proposed changes
This change partially addresses windows build issues in MLX. The remaining errors are related to
add_kernel_nodewhich may require a deeper change to keep MSVC+NVCC happy on windows.To repro, on a windows system, install:
I've been building with:
Checklist
Put an
xin the boxes that apply.pre-commit run --all-filesto format my code / installed pre-commit prior to committing changes