@@ -67,22 +67,32 @@ 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+ DEPS_SSH_KEY : ${{ secrets.DEPS_REPO_SSH_KEY }}
80+ run : |
81+ # Set up SSH key for private repo access
82+ New-Item -Path ~/.ssh -ItemType Directory -Force
83+ $env:DEPS_SSH_KEY | Out-File -FilePath ~/.ssh/id_ed25519 -Encoding ascii -NoNewline
84+ (Get-Content ~/.ssh/id_ed25519 -Raw) -replace "`r`n", "`n" | Set-Content ~/.ssh/id_ed25519 -NoNewline
85+ ssh-keyscan github.com 2>$null | Out-File -FilePath ~/.ssh/known_hosts -Encoding ascii -Append
86+ # Clone with LFS
87+ git clone git@github.com:Breakthrough/opencv-python-cuda-deps.git .deps
88+ # Cleanup SSH key
89+ Remove-Item ~/.ssh/id_ed25519 -Force
90+ shell : pwsh
7691 - name : 🔧 Install NVIDIA CUDA Toolkit
7792 run : |
78- $installer_path = "./.cache/cuda_installer .exe"
93+ $installer_path = ".deps/Nvidia/cuda_12.4.0_windows_network .exe"
7994 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."
95+ throw "CUDA Toolkit installer not found at $installer_path"
8696 }
8797 echo "Installing CUDA Toolkit silently..."
8898 $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 +102,11 @@ jobs:
92102 echo "CUDA_PATH=$CUDA_PATH" | Out-File -FilePath $env:GITHUB_ENV -Append
93103 Copy-Item -Path "$CUDA_PATH/bin/*" -Destination . -Include "*.dll"
94104 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
101105 - name : 🔧 Install NVIDIA CuDNN
102106 run : |
103- $cudnn_path = "./.cache /cudnn.zip"
107+ $cudnn_path = ".deps/Nvidia /cudnn-windows-x86_64-8.9.7.29_cuda12-archive .zip"
104108 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."
109+ throw "CuDNN archive not found at $cudnn_path"
111110 }
112111 echo "Installing CuDNN..."
113112 7z x $cudnn_path
0 commit comments