Skip to content

Commit 36e3ed1

Browse files
committed
Add CUDA to aarch64
1 parent a7f83c4 commit 36e3ed1

File tree

2 files changed

+45
-16
lines changed

2 files changed

+45
-16
lines changed

.github/workflows/_build_linux.yml

Lines changed: 40 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,7 @@ 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 }}
3037

3138
jobs:
3239
build:
@@ -41,26 +48,43 @@ jobs:
4148
env:
4249
SPDL_USE_TRACING: 1
4350
run: |
44-
set -ex
51+
# Figure out versions
52+
py_ver="${{ inputs.python-version }}"
53+
if [[ "${{ inputs.free-threaded }}" == 'ft' ]]; then
54+
py_ver="${py_ver}t"
55+
fi
56+
cuda_ver="${{ inputs.cuda-version }}"
4557
58+
# Setup Python
59+
# wget -qO- https://astral.sh/uv/install.sh | sh
4660
uv --version
47-
uv python list --only-installed
4861
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
62+
uv python pin "${py_ver}"
63+
uv python list --only-installed
64+
uv venv
65+
source .venv/bin/activate
66+
67+
which python
68+
python --version
69+
70+
# Install CUDA
71+
cuda_dir="/opt/cuda"
72+
.github/scripts/install_cuda_toolkit.py \
73+
--base-dir "${cuda_dir}" \
74+
--cuda-version "${cuda_ver}"
75+
if [ ! -d "${cuda_dir}/lib64" ]; then
76+
ln -s "${cuda_dir}/lib" "${cuda_dir}/lib64"
6077
fi
61-
uv build --no-python-downloads --all-packages --wheel
6278
63-
./packaging/repair_wheels.sh manylinux_2_28_${{ inputs.arch }} ./dist ~/package
79+
export PATH="${PATH}:${cuda_dir}/bin"
80+
export CUDA_PATH="${cuda_dir}"
81+
# Sanity check
82+
set -e
83+
nvcc --version
84+
85+
# Build package
86+
uv build --no-python-downloads --all-packages --wheel
87+
./packaging/repair_wheels.sh "manylinux_2_27_${{ inputs.arch }}" ./dist ~/package
6488
6589
- uses: actions/upload-artifact@v4
6690
name: Upload build artifact

.github/workflows/packaging.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,15 @@ 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

0 commit comments

Comments
 (0)