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 }}
37+ SPDL_USE_CUDA : 1
38+ SPDL_USE_NVCODEC : " ${{ inputs.use-nvdec == 'nvdec' }}"
3039
3140jobs :
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
0 commit comments