Try to build CUDA wheels #1156
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Wheels | |
on: | |
push: | |
branches: [main] | |
tags: ["*"] | |
pull_request: | |
# Check all PR | |
jobs: | |
build-wheels: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
arch: ["x86_64"] | |
python-version: ["3.12"] | |
cuda-version: ["12.1"] | |
env: | |
CIBW_SKIP: cp36-* cp37-* cp38-* cp39-* cp310-* cp311-* | |
name: "sphericart-wheel ${{matrix.os}} ${{matrix.arch}} python=${{matrix.python-version}}" | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Github Actions Envs Setup | |
run: | | |
CUVERSION="${{ matrix.cuda-version }}" | |
PYTHONVERSION="${{ matrix.python-version }}" | |
echo CUVERSION=${CUVERSION} >> $GITHUB_ENV | |
PYTHON_VER_NO_DOT=${PYTHONVERSION//./} | |
echo PYTHON_VER_NO_DOT=${PYTHON_VER_NO_DOT} >> $GITHUB_ENV | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: all | |
# Build the custom Manylinux Docker image | |
- name: Build Manylinux Docker Image | |
run: | | |
docker build --no-cache \ | |
-t sphericart_manylinux2014_"${{ matrix.arch }}" \ | |
--build-arg PYTHON_VER="${{ matrix.python-version }}" \ | |
--build-arg PYTHON_VER_NO_DOT="${{ env.PYTHON_VER_NO_DOT }}" \ | |
scripts/manylinux2014_"${{ matrix.arch }}" | |
- name: Install cibuildwheel | |
run: python -m pip install cibuildwheel==2.22.0 | |
- name: Build wheels | |
run: python -m cibuildwheel . | |
env: | |
SPHERICART_ARCH_NATIVE: OFF | |
CUDA_HOME: /usr/local/cuda | |
CIBW_BUILD_VERBOSITY: 3 | |
CIBW_BUILD: "cp${{ env.PYTHON_VER_NO_DOT }}-*" | |
CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation --check-build-dependencies" | |
CIBW_SKIP: "*-musllinux* *-win32 *-manylinux_i686" | |
CIBW_ARCHS: "${{ matrix.arch }}" | |
CIBW_MANYLINUX_X86_64_IMAGE: "sphericart_manylinux2014_x86_64" | |
CIBW_MANYLINUX_AARCH64_IMAGE: "sphericart_manylinux2014_aarch64" | |
CIBW_REPAIR_WHEEL_COMMAND_LINUX: | | |
auditwheel repair \ | |
-w {dest_dir} {wheel} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: sphericart-wheel-${{ matrix.arch }} | |
path: ./wheelhouse/*.whl |