Skip to content

Commit 2438b7f

Browse files
vsort: upgrade to onnx runtime 1.23.0 and cudnn 9.12.0
1 parent 8732a52 commit 2438b7f

File tree

4 files changed

+47
-62
lines changed

4 files changed

+47
-62
lines changed

.github/workflows/windows-cuda-dependency.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929

3030
steps:
3131
- name: Download cuDNN inference library
32-
run: curl -LJ https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/windows-x86_64/cudnn-windows-x86_64-8.9.7.29_cuda12-archive.zip -o cudnn.zip
32+
run: curl -LJ https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/windows-x86_64/cudnn-windows-x86_64-9.12.0.46_cuda12-archive.zip -o cudnn.zip
3333

3434
- name: Extract cuDNN library
3535
run: unzip cudnn.zip
@@ -38,7 +38,7 @@ jobs:
3838
run: |
3939
mkdir -p vsmlrt-cuda
4040
mv cudnn-windows-*/bin/*.dll vsmlrt-cuda/ -v
41-
rm vsmlrt-cuda/cudnn_*_train*.dll -v
41+
# rm vsmlrt-cuda/cudnn_*_train*.dll -v
4242
4343
- name: Download TensorRT library
4444
run: |

.github/workflows/windows-ort.yml

Lines changed: 37 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ on:
2020

2121
jobs:
2222
build-windows:
23-
runs-on: windows-2022
23+
runs-on: windows-2025
2424

2525
defaults:
2626
run:
@@ -39,44 +39,12 @@ jobs:
3939
- name: Setup Ninja
4040
run: pip install ninja
4141

42-
- name: Cache protobuf
43-
id: cache-protobuf
44-
uses: actions/cache@v4
45-
with:
46-
path: vsort/protobuf/install
47-
key: ${{ runner.os }}-vsort-protobuf-v4
48-
49-
- name: Checkout protobuf
50-
uses: actions/checkout@v4
51-
if: steps.cache-protobuf.outputs.cache-hit != 'true'
52-
with:
53-
repository: protocolbuffers/protobuf
54-
# follows protobuf in https://github.com/AmusementClub/onnxruntime/blob/master/cmake/external/onnxruntime_external_deps.cmake#L203
55-
# if you change this, remember to bump the version of the cache key.
56-
ref: v3.21.12
57-
fetch-depth: 1
58-
path: vsort/protobuf
59-
60-
- name: Configure protobuf
61-
if: steps.cache-protobuf.outputs.cache-hit != 'true'
62-
run: cmake -S protobuf -B protobuf\build_rel -G Ninja -LA
63-
-D CMAKE_BUILD_TYPE=Release
64-
-D protobuf_BUILD_SHARED_LIBS=OFF -D protobuf_BUILD_TESTS=OFF
65-
66-
- name: Build protobuf
67-
if: steps.cache-protobuf.outputs.cache-hit != 'true'
68-
run: cmake --build protobuf\build_rel --verbose
69-
70-
- name: Install protobuf
71-
if: steps.cache-protobuf.outputs.cache-hit != 'true'
72-
run: cmake --install protobuf\build_rel --prefix protobuf\install
73-
74-
- name: Cache onnx
42+
- name: Restore cached onnx
7543
id: cache-onnx
76-
uses: actions/cache@v4
44+
uses: actions/cache/restore@v4
7745
with:
7846
path: vsort/onnx/install
79-
key: ${{ runner.os }}-vsort-onnx-v5
47+
key: ${{ runner.os }}-vsort-onnx-v6
8048

8149
- name: Checkout onnx
8250
if: steps.cache-onnx.outputs.cache-hit != 'true'
@@ -85,20 +53,19 @@ jobs:
8553
repository: onnx/onnx
8654
# follows onnx in https://github.com/AmusementClub/onnxruntime/tree/master/cmake/external
8755
# if you change this, remember to bump the version of the cache key.
88-
ref: 990217f043af7222348ca8f0301e17fa7b841781
56+
ref: v1.19.0
8957
fetch-depth: 1
9058
path: vsort/onnx
9159

9260
- name: Configure onnx
9361
if: steps.cache-onnx.outputs.cache-hit != 'true'
9462
run: cmake -S onnx -B onnx\build -G Ninja -LA
9563
-D CMAKE_BUILD_TYPE=Release
96-
-D Protobuf_PROTOC_EXECUTABLE=protobuf\install\bin\protoc
97-
-D Protobuf_LITE_LIBRARY=protobuf\install\lib
98-
-D Protobuf_LIBRARIES=protobuf\install\lib
64+
-D CMAKE_PREFIX_PATH=%cd%\protobuf\install\lib\cmake
9965
-D ONNX_USE_LITE_PROTO=ON -D ONNX_USE_PROTOBUF_SHARED_LIBS=OFF
10066
-D ONNX_GEN_PB_TYPE_STUBS=OFF -D ONNX_ML=0
10167
-D ONNX_USE_MSVC_STATIC_RUNTIME=1
68+
-D ONNX_BUILD_CUSTOM_PROTOBUF=ON
10269

10370
- name: Build onnx
10471
if: steps.cache-onnx.outputs.cache-hit != 'true'
@@ -108,6 +75,13 @@ jobs:
10875
if: steps.cache-onnx.outputs.cache-hit != 'true'
10976
run: cmake --install onnx\build --prefix onnx\install
11077

78+
- name: Save onnx
79+
if: steps.cache-onnx.outputs.cache-hit != 'true'
80+
uses: actions/cache/save@v4
81+
with:
82+
path: vsort/onnx/install
83+
key: ${{ steps.cache-onnx.outputs.cache-primary-key }}
84+
11185
- name: Download VapourSynth headers
11286
run: |
11387
curl -s -o vs.zip -L https://github.com/vapoursynth/vapoursynth/archive/refs/tags/R54.zip
@@ -116,33 +90,39 @@ jobs:
11690
11791
- name: Download ONNX Runtime Precompilation
11892
run: |
119-
curl -s -o ortgpu.zip -LJO https://github.com/AmusementClub/onnxruntime/releases/download/orttraining_rc2-8036-geb41d57f21-240425-0428/onnxruntime-gpu-win64.zip
93+
curl -s -o ortgpu.zip -LJO https://github.com/AmusementClub/onnxruntime/releases/download/orttraining_rc2-10488-g4754a1d64e-250831-1153/onnxruntime-gpu-win64.zip
12094
unzip -q ortgpu.zip
12195
122-
- name: Cache CUDA
96+
- name: Restore cached CUDA
12397
id: cache-cuda
124-
uses: actions/cache@v4
98+
uses: actions/cache/restore@v4
12599
with:
126100
path: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA
127-
key: ${{ runner.os }}-cuda-12.4.1
101+
key: ${{ runner.os }}-cuda-12.9.1
128102

129103
- name: Setup CUDA
130104
if: steps.cache-cuda.outputs.cache-hit != 'true'
131105
run: |
132-
curl -s -o cuda_installer.exe -L https://developer.download.nvidia.com/compute/cuda/12.4.1/network_installers/cuda_12.4.1_windows_network.exe
133-
cuda_installer.exe -s nvcc_12.4 cudart_12.4
106+
curl -s -o cuda_installer.exe -L https://developer.download.nvidia.com/compute/cuda/12.9.1/network_installers/cuda_12.9.1_windows_network.exe
107+
cuda_installer.exe -s nvcc_12.9 cudart_12.9
108+
109+
- name: Save CUDA
110+
if: steps.cache-cuda.outputs.cache-hit != 'true'
111+
uses: actions/cache/save@v4
112+
with:
113+
path: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA
114+
key: ${{ steps.cache-cuda.outputs.cache-primary-key }}
134115

135116
- name: Configure
136117
run: cmake -S . -B build -G Ninja -LA
137118
-D CMAKE_BUILD_TYPE=Release
119+
-D CMAKE_PREFIX_PATH=onnx\install
138120
-D CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
139121
-D VAPOURSYNTH_INCLUDE_DIRECTORY=vapoursynth\include
140-
-D protobuf_DIR=protobuf\install\cmake
141-
-D ONNX_DIR=onnx\install\lib\cmake\ONNX
142122
-D ONNX_RUNTIME_API_DIRECTORY=onnxruntime-gpu\include\onnxruntime
143123
-D ONNX_RUNTIME_LIB_DIRECTORY=onnxruntime-gpu\lib
144124
-D ENABLE_CUDA=1
145-
-D CUDAToolkit_ROOT="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4"
125+
-D CUDAToolkit_ROOT="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.9"
146126
-D ENABLE_DML=1
147127
-D CMAKE_CXX_STANDARD=20
148128

@@ -161,7 +141,7 @@ jobs:
161141
- name: Download DirectML Library
162142
# follows DirectML in https://github.com/AmusementClub/onnxruntime/blob/master/cmake/external/dml.cmake#L44
163143
run: |
164-
curl -s -o directml.nupkg -LJO https://www.nuget.org/api/v2/package/Microsoft.AI.DirectML/1.14.1
144+
curl -s -o directml.nupkg -LJO https://www.nuget.org/api/v2/package/Microsoft.AI.DirectML/1.15.4
165145
unzip -q directml.nupkg -d dml
166146
copy dml\bin\x64-win\DirectML.dll artifact\vsort\
167147
@@ -171,6 +151,12 @@ jobs:
171151
name: VSORT-Windows-x64
172152
path: vsort/artifact
173153

154+
- name: Describe
155+
run: git describe --tags --long
156+
157+
- name: Dump dependencies
158+
run: dumpbin /dependents artifact\vsort.dll
159+
174160
- name: Setup Python portable
175161
run: |
176162
curl -s -o python.zip -LJO https://www.python.org/ftp/python/3.9.10/python-3.9.10-embed-amd64.zip
@@ -199,7 +185,7 @@ jobs:
199185
200186
- name: Create script
201187
shell: bash
202-
run: echo "import vapoursynth as vs;from vapoursynth import core;import sys;print(core.ort, file=sys.stderr);print(core.ort.Version(),file=sys.stderr);core.std.BlankClip(format=vs.RGBS).ort.Model(r\"waifu2x\\upconv_7_anime_style_art_rgb\\scale2.0x_model.onnx\", builtin=True).resize.Bicubic(format=vs.YUV420P10, matrix_s='709').set_output()" > test.vpy
188+
run: echo "import vapoursynth as vs;from vapoursynth import core;import sys;print(core.ort, file=sys.stderr);print(core.ort.Version(),file=sys.stderr);core.std.BlankClip(format=vs.RGBS).ort.Model(r\"waifu2x\\upconv_7_anime_style_art_rgb\\scale2.0x_model.onnx\", builtin=True, verbosity=4).resize.Bicubic(format=vs.YUV420P10, matrix_s='709').set_output()" > test.vpy
203189

204190
- name: Run vspipe
205191
shell: bash
@@ -277,12 +263,6 @@ jobs:
277263
grep -i 'error' x265.log && exit 1
278264
exit 0
279265
280-
- name: Describe
281-
run: git describe --tags --long
282-
283-
- name: Dump dependencies
284-
run: dumpbin /dependents artifact\vsort.dll
285-
286266
- name: Compress artifact for release
287267
if: github.event_name == 'workflow_dispatch' && github.event.inputs.tag != ''
288268
run: |

.github/workflows/windows-release.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,11 @@ jobs:
121121
pushd models
122122
for tag in $(echo "${{ github.event.inputs.model-tags }}" | tr ',' ' '); do
123123
echo "Handling tag $tag"
124-
curl -s https://api.github.com/repos/AmusementClub/vs-mlrt/releases/tags/"$tag" > release.json
124+
curl -s -H 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' https://api.github.com/repos/AmusementClub/vs-mlrt/releases/tags/"$tag" > release.json
125+
cat release.json
125126
for url in $(cat release.json | jq '.assets | .[] | .url ' | tr -d '"'); do
126127
echo "Downloading $url"
127-
curl -o dl.7z -LJ -H 'Accept: application/octet-stream' "$url"
128+
curl -o dl.7z -LJ -H 'Accept: application/octet-stream' -H 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' "$url"
128129
# later release should overwrite earlier ones
129130
7za x -y dl.7z
130131
done

vsort/win32.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ static std::vector<std::wstring> cudaDlls {
2222
L"cudart64",
2323
L"cublasLt64", L"cublas64",
2424
L"cufft64",
25-
L"cudnn_ops_infer64", L"cudnn_cnn_infer64", L"cudnn_adv_infer64", L"cudnn64",
25+
// follows the dependency graph in
26+
// https://docs.nvidia.com/deeplearning/cudnn/backend/v9.12.0/api/overview.html#backend-api-overview
27+
L"cudnn_engines_precompiled64", L"cudnn_heuristic64", L"cudnn_engines_runtime_compiled64",
28+
L"cudnn_graph64", L"cudnn_ops64", L"cudnn_cnn64", L"cudnn_adv64",
29+
L"cudnn64",
2630
L"cupti64",
2731
};
2832

0 commit comments

Comments
 (0)