Skip to content

Commit b3c3853

Browse files
committed
test build wheels
1 parent 5981d50 commit b3c3853

3 files changed

Lines changed: 93 additions & 0 deletions

File tree

.github/workflows/wheels.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Build
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build_wheels:
7+
name: Build wheels on ${{ matrix.os }}
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
matrix:
11+
os: [ubuntu-latest, ubuntu-24.04-arm]
12+
13+
steps:
14+
- uses: actions/checkout@v5
15+
16+
- uses: actions/setup-python@v5
17+
with:
18+
python-version: "3.12"
19+
20+
- name: Install cibuildwheel
21+
run: python -m pip install cibuildwheel==3.1.4
22+
23+
- name: Build wheels (compile-only, CUDA 12.9)
24+
env:
25+
# Which Python/ABI wheels to build
26+
CIBW_BUILD: "cp3{9,10,11,12}-manylinux_{x86_64,aarch64}"
27+
CIBW_SKIP: "pp* *-musllinux* *-win* *-macosx*"
28+
29+
# Point cibuildwheel to custom manylinux images with CUDA 12.9
30+
CIBW_MANYLINUX_X86_64_IMAGE: "ghcr.io/OWNER/REPO:manylinux_2_28_x86_64_cuda12.9"
31+
CIBW_MANYLINUX_AARCH64_IMAGE: "ghcr.io/OWNER/REPO:manylinux_2_28_aarch64_cuda12.9"
32+
33+
# Make CUDA visible in the container
34+
CIBW_ENVIRONMENT: >
35+
CUDA_HOME=/usr/local/cuda
36+
LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
37+
PATH=/usr/local/cuda/bin:$PATH
38+
39+
# Ensure build tooling for nanobind extension is present
40+
CIBW_BEFORE_BUILD: >
41+
python -m pip install -U pip
42+
scikit-build-core cmake ninja nanobind
43+
44+
# Compile-only: don’t run runtime tests (needs GPU)
45+
CIBW_TEST_SKIP: "*"
46+
CIBW_TEST_COMMAND: ""
47+
48+
# Let auditwheel check manylinux tags and bundle CUDA libs
49+
# (set to "" to go faster if you only want compile proof)
50+
CIBW_REPAIR_WHEEL_COMMAND: "auditwheel repair -w {dest_dir} {wheel}"
51+
52+
# Show compiler/linker commands
53+
CIBW_BUILD_VERBOSITY: "1"
54+
run: python -m cibuildwheel --output-dir wheelhouse
55+
56+
- uses: actions/upload-artifact@v4
57+
with:
58+
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
59+
path: ./wheelhouse/*.whl
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM quay.io/pypa/manylinux_2_28_aarch64
2+
3+
RUN yum -y install dnf-plugins-core && \
4+
dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel8/aarch64/cuda-rhel8.repo && \
5+
yum -y clean all && yum -y makecache && \
6+
yum -y install \
7+
cuda-cudart-12-9 \
8+
cuda-cudart-devel-12-9 \
9+
libcublas-12-9 \
10+
libcublas-devel-12-9 \
11+
libcusparse-12-9 \
12+
libcusparse-devel-12-9 && \
13+
yum clean all
14+
15+
ENV CUDA_HOME=/usr/local/cuda
16+
ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64:${LD_LIBRARY_PATH}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM quay.io/pypa/manylinux_2_28_x86_64
2+
3+
# Add NVIDIA CUDA repo (RHEL8/Alma8 base in manylinux_2_28)
4+
RUN yum -y install dnf-plugins-core && \
5+
dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo && \
6+
yum -y clean all && yum -y makecache && \
7+
# Install only what you actually link against
8+
yum -y install \
9+
cuda-cudart-12-9 \
10+
cuda-cudart-devel-12-9 \
11+
libcublas-12-9 \
12+
libcublas-devel-12-9 \
13+
libcusparse-12-9 \
14+
libcusparse-devel-12-9 && \
15+
yum clean all
16+
17+
ENV CUDA_HOME=/usr/local/cuda
18+
ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64:${LD_LIBRARY_PATH}

0 commit comments

Comments
 (0)