Skip to content

Commit

Permalink
.github/workflows/windows-{trt,cuda-dependency}.yml: use public cudnn…
Browse files Browse the repository at this point in the history
… tarball
  • Loading branch information
WolframRhodium committed Feb 6, 2024
1 parent cd198e0 commit a6c6825
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 32 deletions.
27 changes: 9 additions & 18 deletions .github/workflows/windows-cuda-dependency.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,21 @@ jobs:
shell: bash

steps:
# Note: unfortunately, cuDNN download requires registration and according to its license
# agreements, we can only redistribute it along with an application that uses it, so we
# have to use a private repository to hold a copy of the library.
- name: Download cuDNN inference library
run: |
# https://stackoverflow.com/questions/20396329/how-to-download-github-release-from-private-repo-using-command-line/35688093#35688093
tag=cudnn-8.9.6-bin
name=cudnn.7z
AUTH="Authorization: token ${{ secrets.REPO_TOKEN }}"
response=$(curl -sH "$AUTH" https://api.github.com/repos/AmusementClub/cuda/releases/tags/$tag)
eval $(echo "$response" | grep -C3 "name.:.\+$NAME" | grep -w id | tr : = | tr -cd '[[:alnum:]]=')
[ "$id" ] || { echo "Error: Failed to get asset id, response: $response" | awk 'length($0)<100' >&2; exit 1; }
ASSET="https://api.github.com/repos/AmusementClub/cuda/releases/assets/$id"
curl -LJO -H "$AUTH" -H 'Accept: application/octet-stream' "$ASSET"
run: curl -LJ https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/windows-x86_64/cudnn-windows-x86_64-8.9.6.50_cuda12-archive.zip -o cudnn.zip

- name: Extract cuDNN library
run: 7z x cudnn.7z
run: unzip cudnn.zip

- name: Move cuDNN library
run: mv cudnn/bin vsmlrt-cuda -v
run: |
mkdir -p vsmlrt-cuda
mv cudnn-windows-*/bin/*.dll vsmlrt-cuda/ -v
rm vsmlrt-cuda/cudnn_*_train*.dll -v
# Same licensing issue with the tensorrt libraries.
# Note: unfortunately, TensorRT download requires registration and according to its license
# agreements, we can only redistribute it along with an application that uses it, so we
# have to use a private repository to hold a copy of the library.
- name: Download TensorRT library
run: |
# https://stackoverflow.com/questions/20396329/how-to-download-github-release-from-private-repo-using-command-line/35688093#35688093
Expand Down
30 changes: 16 additions & 14 deletions .github/workflows/windows-trt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -43,10 +43,11 @@ jobs:

- name: Cache CUDA
id: cache-cuda
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA
key: ${{ runner.os }}-vstrt-cuda-12.3.1
save-always: true

- name: Setup CUDA
if: steps.cache-cuda.outputs.cache-hit != 'true'
Expand All @@ -55,20 +56,21 @@ jobs:
cuda_installer.exe -s nvcc_12.3 cudart_12.3 nvprof_12.3 cuda_profiler_api_12.3 thrust_12.3 cublas_dev_12.3
- name: Checkout tensorrt
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: AmusementClub/cuda
token: ${{ secrets.REPO_TOKEN }}
ref: tensorrt-9.2.0
path: tensorrt

- name: Checkout cudnn
uses: actions/checkout@v3
with:
repository: AmusementClub/cuda
token: ${{ secrets.REPO_TOKEN }}
ref: cudnn-8.9.6
path: cudnn
- name: Download cuDNN
run: |
curl -LJ https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/windows-x86_64/cudnn-windows-x86_64-8.9.6.50_cuda12-archive.zip -o cudnn.zip
unzip cudnn.zip
mkdir -p cudnn
mv cudnn-windows-*/include -t cudnn
mv cudnn-windows-*/lib -t cudnn
ls -R cudnn
- name: Download VapourSynth headers
run: |
Expand All @@ -84,7 +86,7 @@ jobs:
-D VAPOURSYNTH_INCLUDE_DIRECTORY="%cd%\vapoursynth\include"
-D TENSORRT_HOME="%cd%\..\tensorrt\tensorrt"
-D USE_NVINFER_PLUGIN=ON
-D CUDNN_HOME="%cd%\..\cudnn\cudnn"
-D CUDNN_HOME="cudnn"

- name: Build
run: cmake --build build --config Release --verbose
Expand All @@ -93,7 +95,7 @@ jobs:
run: cmake --install build --prefix install

- name: Checkout TensorRT OSS
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: NVIDIA/TensorRT
ref: release/9.2
Expand All @@ -111,7 +113,7 @@ jobs:
-D CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
-D CUDAToolkit_ROOT="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.3"
-D TENSORRT_HOME="%cd%\..\tensorrt\tensorrt"
-D CUDNN_HOME="%cd%\..\cudnn\cudnn"
-D CUDNN_HOME="cudnn"

- name: Build trtexec
run: cmake --build build_trtexec --verbose
Expand All @@ -130,7 +132,7 @@ jobs:
run: git describe --tags --long

- name: Upload
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: VSTRT-Windows-x64
path: vstrt/artifact
Expand Down

0 comments on commit a6c6825

Please sign in to comment.