Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 86 additions & 1 deletion .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,85 @@ jobs:
path: wheelhouse/*py3-none-any.whl
if-no-files-found: error

build_wheels_linux_arm64:
name: Build Linux ARM64 wheels
runs-on: ubuntu-22.04-arm

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"

# Build CUDA wheel using cibuildwheel with manylinux container for ARM64
- name: Build CUDA wheel (manylinux ARM64)
uses: pypa/cibuildwheel@v2.22.0
env:
# Use manylinux_2_28 for ARM64
CIBW_MANYLINUX_AARCH64_IMAGE: quay.io/pypa/manylinux_2_28_aarch64

# Build for Python 3.10, 3.11, and 3.12 on ARM64
CIBW_BUILD: "cp310-manylinux_aarch64 cp311-manylinux_aarch64 cp312-manylinux_aarch64"
CIBW_SKIP: "*-musllinux_*"

# Native ARM64 runner - no emulation needed
CIBW_ARCHS_LINUX: aarch64

# Install CUDA 13.0 toolkit inside the container (using sbsa repo for ARM64)
CIBW_BEFORE_ALL_LINUX: |
# Install dnf plugins for config-manager command
dnf install -y dnf-plugins-core
# Add NVIDIA CUDA repository for RHEL 8 ARM64 (sbsa = server-based system architecture)
dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel8/sbsa/cuda-rhel8.repo
dnf clean all
# Install ONLY the minimal CUDA packages needed for compilation (not the full toolkit)
dnf install -y cuda-nvcc-13-0 cuda-cudart-devel-13-0 libcublas-devel-13-0 libnvjitlink-devel-13-0
# Install Python development headers (fallback for CMake FindPython)
dnf install -y python3-devel
# Verify CUDA installation
/usr/local/cuda-13.0/bin/nvcc --version

# Set CUDA environment and install build dependencies
CIBW_ENVIRONMENT_LINUX: >
CUDA_HOME=/usr/local/cuda-13.0
PATH=/usr/local/cuda-13.0/bin:$PATH
LD_LIBRARY_PATH=/usr/local/cuda-13.0/lib64:$LD_LIBRARY_PATH
LIBRARY_PATH=/usr/local/cuda-13.0/lib64/stubs:$LIBRARY_PATH

# Install Python build dependencies
CIBW_BEFORE_BUILD: "pip install nanobind cmake setuptools wheel"

# Repair wheel for manylinux compliance, excluding CUDA runtime libs
# Users must have CUDA installed on their system
CIBW_REPAIR_WHEEL_COMMAND_LINUX: >
auditwheel repair -w {dest_dir} {wheel}
--exclude libcuda.so.1
--exclude libcudart.so.13
--exclude libnvrtc.so.13
--exclude libcublas.so.13
--exclude libcublasLt.so.13
--exclude libnvJitLink.so.13

with:
output-dir: wheelhouse

- name: List built wheels
shell: bash
run: |
ls -lh wheelhouse/
echo "Built wheels:"
ls -1 wheelhouse/*.whl

- name: Upload Linux ARM64 CUDA wheel
uses: actions/upload-artifact@v4
with:
name: wheels-linux-arm64-cuda
path: wheelhouse/*manylinux*.whl
if-no-files-found: error

build_wheels_windows:
name: Build Windows wheel (Python ${{ matrix.python-version }})
runs-on: windows-2022
Expand Down Expand Up @@ -372,7 +451,7 @@ jobs:

publish:
name: Publish to PyPI
needs: [build_wheels_linux, build_wheels_windows, test_linux, test_windows]
needs: [build_wheels_linux, build_wheels_linux_arm64, build_wheels_windows, test_linux, test_windows]
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
environment: pypi
Expand All @@ -384,6 +463,12 @@ jobs:
name: wheels-linux-cuda
path: dist/

- name: Download Linux ARM64 CUDA wheel
uses: actions/download-artifact@v4
with:
name: wheels-linux-arm64-cuda
path: dist/

- name: Download Windows CUDA wheel (3.10)
uses: actions/download-artifact@v4
with:
Expand Down