Skip to content

Commit 5c30141

Browse files
committed
Add CUDA to aarch64
1 parent 647b4ab commit 5c30141

File tree

2 files changed

+48
-16
lines changed

2 files changed

+48
-16
lines changed

.github/workflows/_build_linux.yml

Lines changed: 42 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ on:
1313
arch:
1414
required: true
1515
type: string
16+
cuda-version:
17+
required: true
18+
type: string
19+
use-nvdec:
20+
default: "nvdec"
21+
type: string
22+
description: 'Whether build NVDEC extension. Valid value is "nvdec" or not.'
1623
os:
1724
required: true
1825
type: string
@@ -26,7 +33,9 @@ on:
2633
type: string
2734

2835
env:
29-
ARTIFACT: wheel-linux-py${{ inputs.python-version }}${{ inputs.free-threaded }}-${{ inputs.arch }}
36+
ARTIFACT: wheel-linux-py${{ inputs.python-version }}${{ inputs.free-threaded }}-${{ inputs.arch }}-cuda${{ inputs.cuda-version }}${{ inputs.use-nvdec }}
37+
SPDL_USE_CUDA: 1
38+
SPDL_USE_NVCODEC: "${{ inputs.use-nvdec == 'nvdec' }}"
3039

3140
jobs:
3241
build:
@@ -41,26 +50,43 @@ jobs:
4150
env:
4251
SPDL_USE_TRACING: 1
4352
run: |
44-
set -ex
53+
# Figure out versions
54+
py_ver="${{ inputs.python-version }}"
55+
if [[ "${{ inputs.free-threaded }}" == 'ft' ]]; then
56+
py_ver="${py_ver}t"
57+
fi
58+
cuda_ver="${{ inputs.cuda-version }}"
4559
60+
# Setup Python
61+
# wget -qO- https://astral.sh/uv/install.sh | sh
4662
uv --version
47-
uv python list --only-installed
4863
49-
# note: 3.14t is in cp314-cp314t directory, others are in cp314-cp314 directory
50-
v=${{ inputs.python-version }}
51-
dir="cp${v//[.t]/}-cp${v//[.]/}"
52-
if [[ "${{ inputs.free-threaded }}" == 'ft' ]]; then
53-
dir="${dir}t"
54-
fi
55-
python_exe="/opt/python/${dir}/bin/python"
56-
"${python_exe}" --version
57-
uv venv --python "${python_exe}"
58-
if [[ "${{ inputs.free-threaded }}" == 'ft' ]]; then
59-
source .venv/bin/activate
64+
uv python pin "${py_ver}"
65+
uv python list --only-installed
66+
uv venv
67+
source .venv/bin/activate
68+
69+
which python
70+
python --version
71+
72+
# Install CUDA
73+
cuda_dir="/opt/cuda"
74+
.github/scripts/install_cuda_toolkit.py \
75+
--base-dir "${cuda_dir}" \
76+
--cuda-version "${cuda_ver}"
77+
if [ ! -d "${cuda_dir}/lib64" ]; then
78+
ln -s "${cuda_dir}/lib" "${cuda_dir}/lib64"
6079
fi
61-
uv build --no-python-downloads --all-packages --wheel
6280
63-
./packaging/repair_wheels.sh manylinux_2_28_${{ inputs.arch }} ./dist ~/package
81+
export PATH="${PATH}:${cuda_dir}/bin"
82+
export CUDA_PATH="${cuda_dir}"
83+
# Sanity check
84+
set -e
85+
nvcc --version
86+
87+
# Build package
88+
uv build --no-python-downloads --all-packages --wheel
89+
./packaging/repair_wheels.sh "manylinux_2_27_${{ inputs.arch }}" ./dist ~/package
6490
6591
- uses: actions/upload-artifact@v4
6692
name: Upload build artifact

.github/workflows/packaging.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,22 @@ jobs:
7272
fail-fast: false
7373
matrix:
7474
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
75+
cuda-version: ["12.8.1"]
7576
free-threaded: [""]
7677
include:
78+
- python-version: "3.13"
79+
free-threaded: "ft"
80+
cuda-version: "12.8.1"
7781
- python-version: "3.14"
7882
free-threaded: "ft"
83+
cuda-version: "12.8.1"
7984
uses: ./.github/workflows/_build_linux.yml
8085
with:
8186
os: ubuntu-24.04-arm
8287
arch: aarch64
8388
python-version: "${{ matrix.python-version }}"
8489
free-threaded: "${{ matrix.free-threaded }}"
90+
cuda-version: "${{ matrix.cuda-version }}"
8591
# Update to 3.14 once PyTorch is released
8692
run-test: "${{ (matrix.python-version == '3.13') && (matrix.free-threaded != 'ft') }}"
8793
test-concurrency: 3

0 commit comments

Comments
 (0)