cuda release on cpu-only machine

This commit is contained in:
Awni Hannun
2025-07-23 12:37:07 -07:00
parent 0d8a7d8248
commit 4f524e3003
3 changed files with 12 additions and 7 deletions

View File

@@ -204,7 +204,7 @@ jobs:
cuda_build_and_test: cuda_build_and_test:
machine: machine:
image: linux-cuda-12:2025.05.1 image: linux-cuda-12:2023.11.1
resource_class: gpu.nvidia.small.gen2 resource_class: gpu.nvidia.small.gen2
steps: steps:
- checkout - checkout
@@ -369,22 +369,27 @@ jobs:
type: string type: string
default: "" default: ""
machine: machine:
image: linux-cuda-12:2024.11.1 image: ubuntu-2204:current
resource_class: gpu.nvidia.small.gen2 resource_class: large
steps: steps:
- checkout - checkout
- run: - run:
name: Build wheel name: Build wheel
command: | command: |
export DEBIAN_FRONTEND=noninteractive
export NEEDRESTART_MODE=a
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt-get update sudo apt-get update
sudo apt install cuda-toolkit-12-9
sudo apt-get install libblas-dev liblapack-dev liblapacke-dev sudo apt-get install libblas-dev liblapack-dev liblapacke-dev
sudo apt-get install zip sudo apt-get install zip
python -m venv env
source env/bin/activate
pip install auditwheel pip install auditwheel
pip install patchelf pip install patchelf
pip install build pip install build
pip install twine pip install twine
export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
<< parameters.build_env >> MLX_BUILD_STAGE=2 \ << parameters.build_env >> MLX_BUILD_STAGE=2 \
CMAKE_ARGS="-DMLX_BUILD_CUDA=ON -DCMAKE_CUDA_COMPILER=`which nvcc`" \ CMAKE_ARGS="-DMLX_BUILD_CUDA=ON -DCMAKE_CUDA_COMPILER=`which nvcc`" \
python -m build -w python -m build -w
@@ -395,7 +400,6 @@ jobs:
- run: - run:
name: Upload package name: Upload package
command: | command: |
source env/bin/activate
twine upload wheelhouse/*.whl twine upload wheelhouse/*.whl
- store_artifacts: - store_artifacts:
path: wheelhouse/ path: wheelhouse/

View File

@@ -4,6 +4,7 @@ auditwheel repair dist/* \
--plat manylinux_2_35_x86_64 \ --plat manylinux_2_35_x86_64 \
--exclude libcublas* \ --exclude libcublas* \
--exclude libnvrtc* \ --exclude libnvrtc* \
--exclude libcuda* \
-w wheel_tmp -w wheel_tmp

View File

@@ -295,5 +295,5 @@ if __name__ == "__main__":
_setup( _setup(
name=name, name=name,
packages=["mlx"], packages=["mlx"],
install_requires=install_requries, install_requires=install_requires,
) )