Skip to content

Commit aacc75f

Browse files
committed
Add CUDA build
1 parent 70977ad commit aacc75f

2 files changed

Lines changed: 46 additions & 5 deletions

File tree

.github/workflows/_build_windows.yml

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ on:
1010
description: 'Whether FT Python or not. Valid value is "ft" or not.'
1111
default: ''
1212
type: string
13+
cuda-version:
14+
required: true
15+
type: string
16+
use-nvdec:
17+
default: "nvdec"
18+
type: string
19+
description: 'Whether build NVDEC extension. Valid value is "nvdec" or not.'
1320
run-test:
1421
required: false
1522
default: 'false'
@@ -20,6 +27,9 @@ on:
2027

2128
env:
2229
ARTIFACT: wheel-win-py${{ inputs.python-version }}${{ inputs.free-threaded }}
30+
SPDL_USE_TRACING: 0
31+
SPDL_USE_CUDA: 1
32+
SPDL_USE_NVDEC: "${{ inputs.use-nvdec == 'nvdec' }}"
2333

2434
jobs:
2535
build:
@@ -29,10 +39,39 @@ jobs:
2939
with:
3040
persist-credentials: false
3141

42+
- name: Install Cuda Toolkit 12.4 on Windows
43+
run: |
44+
mkdir -p "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4"
45+
choco install unzip -y
46+
curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_cudart/windows-x86_64/cuda_cudart-windows-x86_64-12.4.127-archive.zip"
47+
curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvcc/windows-x86_64/cuda_nvcc-windows-x86_64-12.4.131-archive.zip"
48+
curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvrtc/windows-x86_64/cuda_nvrtc-windows-x86_64-12.4.127-archive.zip"
49+
# curl -O "https://developer.download.nvidia.com/compute/cuda/redist/libcublas/windows-x86_64/libcublas-windows-x86_64-12.4.5.8-archive.zip"
50+
# curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvtx/windows-x86_64/cuda_nvtx-windows-x86_64-12.4.127-archive.zip"
51+
# curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_profiler_api/windows-x86_64/cuda_profiler_api-windows-x86_64-12.4.127-archive.zip"
52+
curl -O "https://developer.download.nvidia.com/compute/cuda/redist/visual_studio_integration/windows-x86_64/visual_studio_integration-windows-x86_64-12.4.127-archive.zip"
53+
# curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvprof/windows-x86_64/cuda_nvprof-windows-x86_64-12.4.127-archive.zip"
54+
# curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_cccl/windows-x86_64/cuda_cccl-windows-x86_64-12.4.127-archive.zip"
55+
unzip '*.zip' -d "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4"
56+
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\cuda_cudart-windows-x86_64-12.4.127-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
57+
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\cuda_nvcc-windows-x86_64-12.4.131-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
58+
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\cuda_nvrtc-windows-x86_64-12.4.127-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
59+
# xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\libcublas-windows-x86_64-12.4.5.8-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
60+
# xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\cuda_nvtx-windows-x86_64-12.4.127-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
61+
# xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\cuda_profiler_api-windows-x86_64-12.4.127-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
62+
xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\visual_studio_integration-windows-x86_64-12.4.127-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
63+
# xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\cuda_nvprof-windows-x86_64-12.4.127-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
64+
# xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\cuda_cccl-windows-x86_64-12.4.127-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
65+
66+
# Default installation path for CUDA Toolkit is C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4
67+
- name: Add Path
68+
run: |
69+
echo "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.4\\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
70+
echo "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\libnvvp" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
71+
echo "CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
72+
echo "CUDA_PATH_V12_4=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
73+
3274
- name: Build
33-
env:
34-
SPDL_USE_TRACING: 0
35-
SPDL_BUILD_STUB: 0
3675
shell: cmd
3776
run: |
3877
packaging/vc_env_helper.bat ^
@@ -57,9 +96,9 @@ jobs:
5796
bash ^
5897
.github/scripts/check_package.sh
5998
60-
unit-test:
99+
test-cpu:
61100
if: "${{ inputs.run-test == 'true' }}"
62-
name: "test ffmpeg"
101+
name: "test-cpu ffmpeg ${{ matrix.ffmpeg-version }}"
63102
needs: ["build"]
64103
strategy:
65104
fail-fast: false

.github/workflows/packaging.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
fail-fast: false
4444
matrix:
4545
python-version: ["3.10", "3.11", "3.12", "3.13"]
46+
cuda-version: ["12.4"]
4647
free-threaded: [""]
4748
include:
4849
- python-version: "3.13"
@@ -51,6 +52,7 @@ jobs:
5152
with:
5253
python-version: "${{ matrix.python-version }}"
5354
free-threaded: "${{ matrix.free-threaded }}"
55+
cuda-version: "${{ matrix.cuda-version }}"
5456
run-test: "${{ matrix.python-version == '3.11'}}"
5557

5658
#############################################################################

0 commit comments

Comments
 (0)