@@ -67,22 +67,27 @@ jobs:
6767 uses : microsoft/setup-msbuild@v1.1
6868 - name : Setup NASM
6969 uses : ilammy/setup-nasm@v1
70- - name : Cache CUDA Toolkit Installer
71- id : cache-cuda-installer
70+ - name : Cache NVIDIA dependencies
71+ id : cache-nvidia-deps
7272 uses : actions/cache@v3
7373 with :
74- path : ./.cache/cuda_installer.exe
75- key : cuda-installer-12.4.0
74+ path : .deps/Nvidia
75+ key : nvidia-deps-cuda-12.4.0-cudnn-8.9.7.29
76+ - name : Clone NVIDIA dependencies
77+ if : steps.cache-nvidia-deps.outputs.cache-hit != 'true'
78+ env :
79+ SSH_PRIVATE_KEY : ${{ secrets.DEPS_REPO_SSH_KEY }}
80+ run : |
81+ eval "$(ssh-agent -s)"
82+ ssh-add - <<< "${SSH_PRIVATE_KEY}"
83+ ssh-keyscan github.com >> ~/.ssh/known_hosts 2>/dev/null
84+ git clone git@github.com:Breakthrough/opencv-python-cuda-deps.git .deps
85+ shell : bash
7686 - name : 🔧 Install NVIDIA CUDA Toolkit
7787 run : |
78- $installer_path = "./.cache/cuda_installer .exe"
88+ $installer_path = ".deps/Nvidia/cuda_12.4.0_windows_network .exe"
7989 if (-not (Test-Path $installer_path)) {
80- echo "Downloading CUDA Toolkit..."
81- $cuda_installer_url = "https://developer.download.nvidia.com/compute/cuda/12.4.0/network_installers/cuda_12.4.0_windows_network.exe"
82- New-Item -Path (Split-Path $installer_path) -ItemType Directory -Force
83- curl -L -o $installer_path $cuda_installer_url
84- } else {
85- echo "CUDA Toolkit installer found in cache."
90+ throw "CUDA Toolkit installer not found at $installer_path"
8691 }
8792 echo "Installing CUDA Toolkit silently..."
8893 $arguments = "-s nvcc_12.4 cudart_12.4 cublas_12.4 cublas_dev_12.4 cufft_12.4 cufft_dev_12.4 npp_12.4 npp_dev_12.4"
@@ -92,22 +97,11 @@ jobs:
9297 echo "CUDA_PATH=$CUDA_PATH" | Out-File -FilePath $env:GITHUB_ENV -Append
9398 Copy-Item -Path "$CUDA_PATH/bin/*" -Destination . -Include "*.dll"
9499 shell : pwsh
95- - name : Cache CuDNN Installer
96- id : cache-cudnn-installer
97- uses : actions/cache@v3
98- with :
99- path : ./.cache/cudnn.zip
100- key : cudnn-8.9.7.29-cuda-12-windows
101100 - name : 🔧 Install NVIDIA CuDNN
102101 run : |
103- $cudnn_path = "./.cache /cudnn.zip"
102+ $cudnn_path = ".deps/Nvidia /cudnn-windows-x86_64-8.9.7.29_cuda12-archive .zip"
104103 if (-not (Test-Path $cudnn_path)) {
105- echo "Downloading CuDNN..."
106- $cudnn_installer_url = "https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/windows-x86_64/cudnn-windows-x86_64-8.9.7.29_cuda12-archive.zip"
107- New-Item -Path (Split-Path $cudnn_path) -ItemType Directory -Force
108- curl -L -o $cudnn_path $cudnn_installer_url
109- } else {
110- echo "CuDNN installer found in cache."
104+ throw "CuDNN archive not found at $cudnn_path"
111105 }
112106 echo "Installing CuDNN..."
113107 7z x $cudnn_path
0 commit comments