-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (65 loc) · 2.33 KB
/
linux-cuda.yml
File metadata and controls
74 lines (65 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Build Python Wheels (Linux CUDA)
on:
push:
branches:
- main
tags:
- '*'
pull_request:
branches:
- main
release:
types: [published]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
build-cuda-wheels:
name: Build CUDA Wheels (Linux)
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
show-progress: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build wheels
uses: pypa/cibuildwheel@v3.1.0
env:
# Only build manylinux wheels (skip musllinux since CUDA is only in manylinux images)
CIBW_BUILD: "cp311-*manylinux*"
# Skip musllinux builds (they don't have CUDA)
CIBW_SKIP: "cp311-*musllinux*"
# Use CUDA-enabled manylinux image from https://github.com/ameli/manylinux-cuda
# Available images: sameli/manylinux_2_34_x86_64_cuda_12.9, sameli/manylinux_2_28_x86_64_cuda_12.6, etc.
CIBW_MANYLINUX_X86_64_IMAGE: "sameli/manylinux_2_34_x86_64_cuda_12.9"
CIBW_BEFORE_BUILD: |
# Verify CUDA is available (should be pre-installed in the manylinux image)
echo "Verifying CUDA installation..."
if command -v nvcc &> /dev/null; then
echo "CUDA compiler version:"
nvcc --version
echo "CUDA_HOME: ${CUDA_HOME:-/usr/local/cuda}"
else
echo "Error: CUDA compiler (nvcc) not found!"
exit 1
fi
# Environment variables are already set in the manylinux-cuda image
# CUDA_HOME=/usr/local/cuda, PATH, and LD_LIBRARY_PATH are configured
CIBW_CONFIG_SETTINGS: "wheel.build-tag=${{ github.run_number }}"
with:
output-dir: wheelhouse
package-dir: linux-cuda
- name: List built wheels
shell: bash
run: |
echo "Built CUDA wheels:"
ls -lh wheelhouse/*.whl || echo "No wheels found"
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheelhouse-linux-cuda
path: wheelhouse/*.whl