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
2633 type : string
2734
2835env :
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
3138jobs :
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
0 commit comments