From a6c68250e6c717ea67841676c9d59d702ad29b47 Mon Sep 17 00:00:00 2001 From: WolframRhodium Date: Tue, 6 Feb 2024 11:51:35 +0800 Subject: [PATCH] .github/workflows/windows-{trt,cuda-dependency}.yml: use public cudnn tarball --- .github/workflows/windows-cuda-dependency.yml | 27 ++++++----------- .github/workflows/windows-trt.yml | 30 ++++++++++--------- 2 files changed, 25 insertions(+), 32 deletions(-) diff --git a/.github/workflows/windows-cuda-dependency.yml b/.github/workflows/windows-cuda-dependency.yml index 8c24357..6d880ec 100644 --- a/.github/workflows/windows-cuda-dependency.yml +++ b/.github/workflows/windows-cuda-dependency.yml @@ -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 diff --git a/.github/workflows/windows-trt.yml b/.github/workflows/windows-trt.yml index 587c826..0b80ffc 100644 --- a/.github/workflows/windows-trt.yml +++ b/.github/workflows/windows-trt.yml @@ -31,7 +31,7 @@ jobs: steps: - name: Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 @@ -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' @@ -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: | @@ -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 @@ -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 @@ -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 @@ -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