Skip to content

Commit 4745495

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

File tree

2 files changed

+6
-33
lines changed

2 files changed

+6
-33
lines changed

.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 & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,6 @@ def main():
162162
else ["-G", "Unix Makefiles"]
163163
)
164164

165-
cudnn_library = os.environ["CUDNN_LIBRARY"]
166-
cudnn_include_dir = os.environ["CUDNN_INCLUDE_DIR"]
167-
168165
cmake_args = (
169166
(ci_cmake_generator if is_CI_build else [])
170167
+ [
@@ -197,9 +194,9 @@ def main():
197194
"-DWITH_NVCUVID=OFF",
198195
f"-DCUDA_ARCH_BIN={cuda_arch_bin}",
199196
f"-DCUDA_ARCH_PTX={cuda_arch_ptx}",
200-
f"-DCUDNN_LIBRARY={cudnn_library}",
201-
f"-DCUDNN_INCLUDE_DIR={cudnn_include_dir}",
202-
]
197+
"-DWITH_CUDNN=OFF",
198+
"-DBUILD_LIST=bgsegm,cudabgsegm,cudacodec,cudafilters,cudaimgproc,cudev,imgcodecs,imgproc,python3,text,video,videoio"
199+
]
203200
+ (
204201
# CMake flags for windows/arm64 build
205202
["-DCMAKE_GENERATOR_PLATFORM=ARM64",

0 commit comments

Comments
 (0)