Skip to content

Commit 92b5dbe

Browse files
committed
[build] Stage headers/libs in CUDA dirs
1 parent 69f0720 commit 92b5dbe

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

.github/workflows/build_wheels_windows.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,13 @@ jobs:
151151
echo "CUDA_nvcuvid_LIBRARY=$SDK_PATH/Lib/win/x64/nvcuvid.lib" | Out-File -FilePath $env:GITHUB_ENV -Append
152152
echo "CUDA_nvencodeapi_LIBRARY=$SDK_PATH/Lib/win/x64/nvencodeapi.lib" | Out-File -FilePath $env:GITHUB_ENV -Append
153153
echo "NVCUVID_INCLUDE_DIR=$SDK_PATH/Interface" | Out-File -FilePath $env:GITHUB_ENV -Append
154+
# OpenCV's WITH_NVCUVID/WITH_NVCUVENC detection only searches the CUDA toolkit
155+
# include/lib dirs (find_path); it ignores CMAKE_INCLUDE_PATH and CUDA_nvcuvid_LIBRARY.
156+
# Stage the SDK headers and import libs into the toolkit tree so detection succeeds,
157+
# otherwise the codec is silently compiled out ("NVCUVID: Header not found").
158+
echo "Staging Video Codec SDK headers/libs into CUDA toolkit ($env:CUDA_PATH)..."
159+
Copy-Item -Path "$SDK_PATH/Interface/*.h" -Destination "$env:CUDA_PATH/include/" -Force
160+
Copy-Item -Path "$SDK_PATH/Lib/win/x64/*.lib" -Destination "$env:CUDA_PATH/lib/x64/" -Force
154161
shell: pwsh
155162

156163
- name: Restore build artifacts

0 commit comments

Comments
 (0)