mirror of
https://github.com/ml-explore/mlx.git
synced 2025-12-07 19:59:01 +08:00
Some checks failed
Build and Test / check_lint (push) Has been cancelled
Build and Test / linux_build_and_test (ubuntu-22.04) (push) Has been cancelled
Build and Test / linux_build_and_test (ubuntu-22.04-arm) (push) Has been cancelled
Build and Test / mac_build_and_test (14.0) (push) Has been cancelled
Build and Test / mac_build_and_test (15.0) (push) Has been cancelled
Build and Test / cuda_build_and_test (cuda-12.6) (push) Has been cancelled
Build and Test / cuda_build_and_test (cuda-12.9) (push) Has been cancelled
Build and Test / build_documentation (push) Has been cancelled
Build and Test / Linux Fedora CPP Build (aarch64) (push) Has been cancelled
Build and Test / Linux Fedora CPP Build (x86_64) (push) Has been cancelled
Nightly Build / build_linux_release (3.10) (push) Has been cancelled
Nightly Build / build_linux_release (3.14) (push) Has been cancelled
Nightly Build / build_linux_with_tests (3.11, ubuntu-22.04) (push) Has been cancelled
Nightly Build / build_linux_with_tests (3.11, ubuntu-22.04-arm) (push) Has been cancelled
Nightly Build / build_linux_with_tests (3.12, ubuntu-22.04) (push) Has been cancelled
Nightly Build / build_linux_with_tests (3.12, ubuntu-22.04-arm) (push) Has been cancelled
Nightly Build / build_linux_with_tests (3.13, ubuntu-22.04) (push) Has been cancelled
Nightly Build / build_linux_with_tests (3.13, ubuntu-22.04-arm) (push) Has been cancelled
Nightly Build / build_linux_with_tests (3.14, ubuntu-22.04) (push) Has been cancelled
Nightly Build / build_linux_with_tests (3.14, ubuntu-22.04-arm) (push) Has been cancelled
Nightly Build / build_mac_release (3.10) (push) Has been cancelled
Nightly Build / build_mac_release (3.13) (push) Has been cancelled
Nightly Build / build_cuda_release (push) Has been cancelled
86 lines
3.0 KiB
YAML
86 lines
3.0 KiB
YAML
name: 'Setup Linux Environment'
|
|
description: 'Install dependencies for Linux builds'
|
|
|
|
inputs:
|
|
toolkit:
|
|
description: 'Which toolkit to install'
|
|
required: false
|
|
default: 'cpu'
|
|
python-version:
|
|
description: 'Version of python to set up'
|
|
required: false
|
|
default: '3.10'
|
|
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- name: Use ccache
|
|
uses: hendrikmuhs/ccache-action@v1.2
|
|
with:
|
|
key: ccache-${{ runner.os }}-${{ runner.arch }}-${{ inputs.toolkit }}-py${{ inputs.python-version }}
|
|
max-size: 1GB
|
|
|
|
- name: Install common dependencies
|
|
shell: bash
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libblas-dev liblapack-dev liblapacke-dev zip
|
|
|
|
- uses: actions/setup-python@v6
|
|
with:
|
|
python-version: ${{ inputs.python-version }}
|
|
|
|
- name: Setup Python venv
|
|
shell: bash
|
|
run: |
|
|
python -m venv .venv
|
|
source .venv/bin/activate
|
|
pip install setuptools cmake nanobind==2.4.0
|
|
echo PATH=$PATH >> $GITHUB_ENV
|
|
# Make cmake search .venv for nanobind
|
|
echo PYTHONPATH=`python -c 'import sys; print(sys.path[-1])'` >> $GITHUB_ENV
|
|
|
|
- name: Install MPI
|
|
shell: bash
|
|
run: sudo apt-get install -y openmpi-bin openmpi-common libopenmpi-dev
|
|
|
|
- name: Install CUDA toolkit
|
|
if: ${{ startsWith(inputs.toolkit, 'cuda') }}
|
|
shell: bash
|
|
env:
|
|
# Note: the CI machine does not meet CUDA 13's driver requirement.
|
|
# Compatibility matrix:
|
|
# https://docs.nvidia.com/deeplearning/cudnn/backend/latest/reference/support-matrix.html
|
|
# The `nvcc` is installed into `/usr/local/cuda-VERSION/bin/nvcc` - but
|
|
# it's *not* on the default toolkit path.
|
|
PACKAGES: |
|
|
{
|
|
"cuda-12.6": "libcudnn9-dev-cuda-12 cuda-toolkit-12-6",
|
|
"cuda-12.9": "libcudnn9-dev-cuda-12 cuda-toolkit-12-9",
|
|
"cuda-13.0": "libcudnn9-dev-cuda-13 cuda-toolkit-13-0"
|
|
}
|
|
run: |
|
|
export ARCH=${{ runner.arch == 'arm64' && 'arm64' || 'x86_64' }}
|
|
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/$ARCH/cuda-keyring_1.1-1_all.deb
|
|
sudo dpkg -i cuda-keyring_1.1-1_all.deb
|
|
sudo apt-get update
|
|
sudo apt-get install -y \
|
|
libnccl2 libnccl-dev \
|
|
${{ fromJson(env.PACKAGES)[inputs.toolkit] }}
|
|
|
|
- name: CUDA packages and driver report
|
|
if: ${{ startsWith(inputs.toolkit, 'cuda') }}
|
|
shell: bash
|
|
run: |
|
|
sudo apt-get install -y ubuntu-drivers-common dkms
|
|
echo "NVIDIA Driver Packages Available:"
|
|
sudo ubuntu-drivers list --gpgpu
|
|
echo "NVIDIA Driver Version:"
|
|
cat /proc/driver/nvidia/version || echo "nvidia driver not found"
|
|
echo "Installed NVIDIA and CUDA packages:"
|
|
dpkg -l | egrep "cuda|nvidia" -i
|
|
echo "DKMS Status:"
|
|
dkms status || echo "dkms not found"
|
|
echo "NVIDIA-SMI Status:"
|
|
nvidia-smi || echo "nvidia-smi not found"
|