Skip to content

Commit 3402220

Browse files
committed
[actions] Create minimal distribution
Intended for DVR-Scan.
1 parent fb829bc commit 3402220

2 files changed

Lines changed: 6 additions & 32 deletions

File tree

.github/workflows/build_wheels_windows.yml

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -92,30 +92,6 @@ jobs:
9292
echo "CUDA_PATH=$CUDA_PATH" | Out-File -FilePath $env:GITHUB_ENV -Append
9393
Copy-Item -Path "$CUDA_PATH/bin/*" -Destination . -Include "*.dll"
9494
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
101-
- name: 🔧 Install NVIDIA CuDNN
102-
run: |
103-
$cudnn_path = "./.cache/cudnn.zip"
104-
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."
111-
}
112-
echo "Installing CuDNN..."
113-
7z x $cudnn_path
114-
$CUDNN_PATH = "D:/a/opencv-python-cuda/opencv-python-cuda/cudnn-windows-x86_64-8.9.7.29_cuda12-archive"
115-
echo "CUDNN_LIBRARY=$CUDNN_PATH/lib/x64/cudnn.lib" | Out-File -FilePath $env:GITHUB_ENV -Append
116-
echo "CUDNN_INCLUDE_DIR=$CUDNN_PATH/include" | Out-File -FilePath $env:GITHUB_ENV -Append
117-
Copy-Item -Path "$CUDNN_PATH/bin/*" -Destination . -Include "*.dll"
118-
shell: pwsh
11995

12096
# TODO: This isn't the correct cache key since it relies on the CMake options we build with.
12197
# This is good enough for now though to cache build artifacts; we can manually skip restoring
@@ -125,9 +101,9 @@ jobs:
125101
if: ${{ inputs.restore_build_cache }}
126102
with:
127103
path: _skbuild
128-
key: ${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/CMakeLists.txt') }}
104+
key: ${{ runner.os }}-${{ matrix.python-version }}-minimal-${{ hashFiles('**/CMakeLists.txt') }}
129105
restore-keys: |
130-
${{ runner.os }}-${{ matrix.python-version }}-
106+
${{ runner.os }}-${{ matrix.python-version }}-minimal-
131107
132108
- name: Build a package
133109
# CMake 3.25 regression fix. See https://stackoverflow.com/questions/74162633/problem-compiling-from-source-opencv-with-mvsc2019-in-64-bit-version
@@ -149,7 +125,7 @@ jobs:
149125
if: ${{ inputs.save_build_cache }}
150126
with:
151127
path: _skbuild
152-
key: ${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/CMakeLists.txt') }}
128+
key: ${{ runner.os }}-${{ matrix.python-version }}-minimal-${{ hashFiles('**/CMakeLists.txt') }}
153129
- name: Saving all wheels
154130
uses: actions/upload-artifact@v4
155131
with:

setup.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,6 @@ def main():
149149
else ["-G", "Unix Makefiles"]
150150
)
151151

152-
cudnn_library = os.environ["CUDNN_LIBRARY"]
153-
cudnn_include_dir = os.environ["CUDNN_INCLUDE_DIR"]
154152
cuda_arch_bin = "6.0;6.1;7.0;7.5"
155153
cuda_arch_ptx = "7.5"
156154

@@ -186,9 +184,9 @@ def main():
186184
"-DWITH_NVCUVID=OFF",
187185
f"-DCUDA_ARCH_BIN={cuda_arch_bin}",
188186
f"-DCUDA_ARCH_PTX={cuda_arch_ptx}",
189-
f"-DCUDNN_LIBRARY={cudnn_library}",
190-
f"-DCUDNN_INCLUDE_DIR={cudnn_include_dir}",
191-
]
187+
"-DWITH_CUDNN=OFF",
188+
"-DBUILD_LIST=bgsegm,cudabgsegm,cudacodec,cudafilters,cudev,imgcodecs,imgproc,python3,text,video,videoio"
189+
]
192190
+ (
193191
# CMake flags for windows/arm64 build
194192
["-DCMAKE_GENERATOR_PLATFORM=ARM64",

0 commit comments

Comments
 (0)