Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[opencv4] Build error #28597

Closed
seigeweapon opened this issue Dec 28, 2022 · 3 comments
Closed

[opencv4] Build error #28597

seigeweapon opened this issue Dec 28, 2022 · 3 comments
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support

Comments

@seigeweapon
Copy link

seigeweapon commented Dec 28, 2022

Host Environment

  • OS: Win10
  • Compiler: Visual Studio 2022 professional 17.4.3, tried both WIN SDK 10.0.20348.0 and 10.0.22000.0
  • Cuda SDK:11.7 V11.7.64 Build cuda_11.7.r11.7/compiler.31294372_0

To Reproduce

./vcpkg install opencv4[core,contrib,cuda]:x64-windows

Failure logs

console output:

Installing 26/26 opencv4:x64-windows...
Building opencv4[contrib,core,cuda]:x64-windows...
-- Downloading https://github.com/opencv/opencv/archive/4.6.0.tar.gz -> opencv-opencv-4.6.0-1.tar.gz...
-- Extracting source C:/Users/Admin/work/vcpkg/downloads/opencv-opencv-4.6.0-1.tar.gz
-- Applying patch 0001-disable-downloading.patch
-- Applying patch 0002-install-options.patch
-- Applying patch 0003-force-package-requirements.patch
-- Applying patch 0004-fix-eigen.patch
-- Applying patch 0005-fix-policy-CMP0057.patch
-- Applying patch 0006-fix-uwp.patch
-- Applying patch 0008-devendor-quirc.patch
-- Applying patch 0009-fix-protobuf.patch
-- Applying patch 0010-fix-uwp-tiff-imgcodecs.patch
-- Applying patch 0011-remove-python2.patch
-- Applying patch 0012-fix-zlib.patch
-- Applying patch 0015-fix-freetype.patch
-- Applying patch 0017-mingw-strsafe-no-deprecate.patch
-- Using source at C:/Users/Admin/work/vcpkg/buildtrees/opencv4/src/4.6.0-9a95a1b699.clean
-- Downloading https://github.com/NVIDIA/NVIDIAOpticalFlowSDK/archive/edb50da3cf849840d680249aa6dbef248ebce2ca.zip -> opencv-cache/nvidia_optical_flow/a73cd48b18dcc0cc8933b30796074191-edb50da3cf849840d680249aa6dbef248ebce2ca.zip...
-- Downloading https://github.com/opencv/opencv_contrib/archive/4.6.0.tar.gz -> opencv-opencv_contrib-4.6.0.tar.gz...
-- Extracting source C:/Users/Admin/work/vcpkg/downloads/opencv-opencv_contrib-4.6.0.tar.gz
-- Applying patch 0007-fix-hdf5.patch
-- Applying patch 0013-fix-ceres.patch
-- Applying patch 0014-fix-ogre.patch
-- Applying patch 0016-fix-freetype-contrib.patch
-- Applying patch 0018-fix-depend-tesseract.patch
-- Using source at C:/Users/Admin/work/vcpkg/buildtrees/opencv4/src/4.6.0-2d21bd324c.clean
-- Downloading https://raw.githubusercontent.com/WeChatCV/opencv_3rdparty/a8b69ccc738421293254aec5ddb38bd523503252/detect.caffemodel -> opencv-cache/wechat_qrcode/238e2b2d6f3c18d6c3a30de0c31e23cf-detect.caffemodel...
-- Downloading https://raw.githubusercontent.com/WeChatCV/opencv_3rdparty/a8b69ccc738421293254aec5ddb38bd523503252/sr.caffemodel -> opencv-cache/wechat_qrcode/cbfcd60361a73beb8c583eea7e8e6664-sr.caffemodel...
-- Downloading https://raw.githubusercontent.com/WeChatCV/opencv_3rdparty/a8b69ccc738421293254aec5ddb38bd523503252/detect.prototxt -> opencv-cache/wechat_qrcode/6fb4976b32695f9f5c6305c19f12537d-detect.prototxt...
-- Downloading https://raw.githubusercontent.com/WeChatCV/opencv_3rdparty/a8b69ccc738421293254aec5ddb38bd523503252/sr.prototxt -> opencv-cache/wechat_qrcode/69db99927a70df953b471daaba03fbef-sr.prototxt...
-- Downloading https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_bgm.i -> opencv-cache/xfeatures2d/boostdesc/0ea90e7a8f3f7876d450e4149c97c74f-boostdesc_bgm.i...
-- Downloading https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_bgm_bi.i -> opencv-cache/xfeatures2d/boostdesc/232c966b13651bd0e46a1497b0852191-boostdesc_bgm_bi.i...
-- Downloading https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_bgm_hd.i -> opencv-cache/xfeatures2d/boostdesc/324426a24fa56ad9c5b8e3e0b3e5303e-boostdesc_bgm_hd.i...
-- Downloading https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_binboost_064.i -> opencv-cache/xfeatures2d/boostdesc/202e1b3e9fec871b04da31f7f016679f-boostdesc_binboost_064.i...
-- Downloading https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_binboost_128.i -> opencv-cache/xfeatures2d/boostdesc/98ea99d399965c03d555cef3ea502a0b-boostdesc_binboost_128.i...
-- Downloading https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_binboost_256.i -> opencv-cache/xfeatures2d/boostdesc/e6dcfa9f647779eb1ce446a8d759b6ea-boostdesc_binboost_256.i...
-- Downloading https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_lbgm.i -> opencv-cache/xfeatures2d/boostdesc/0ae0675534aa318d9668f2a179c2a052-boostdesc_lbgm.i...
-- Downloading https://raw.githubusercontent.com/opencv/opencv_3rdparty/fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d/vgg_generated_48.i -> opencv-cache/xfeatures2d/vgg/e8d0dcd54d1bcfdc29203d011a797179-vgg_generated_48.i...
-- Downloading https://raw.githubusercontent.com/opencv/opencv_3rdparty/fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d/vgg_generated_64.i -> opencv-cache/xfeatures2d/vgg/7126a5d9a8884ebca5aea5d63d677225-vgg_generated_64.i...
-- Downloading https://raw.githubusercontent.com/opencv/opencv_3rdparty/fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d/vgg_generated_80.i -> opencv-cache/xfeatures2d/vgg/7cd47228edec52b6d82f46511af325c5-vgg_generated_80.i...
-- Downloading https://raw.githubusercontent.com/opencv/opencv_3rdparty/fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d/vgg_generated_120.i -> opencv-cache/xfeatures2d/vgg/151805e03568c9f490a5e3a872777b75-vgg_generated_120.i...
-- Downloading https://raw.githubusercontent.com/opencv/opencv_3rdparty/8afa57abc8229d611c4937165d20e2a2d9fc5a12/face_landmark_model.dat -> opencv-cache/data/7505c44ca4eb54b4ab1e4777cb96ac05-face_landmark_model.dat...
-- Found external ninja('1.11.0').
-- Configuring x64-windows
-- Building x64-windows-dbg
CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:131 (message):
    Command failed: "C:/Program Files/CMake/bin/cmake.exe" --build . --config Debug --target install -- -v -j13
    Working Directory: C:/Users/Admin/work/vcpkg/buildtrees/opencv4/x64-windows-dbg
    See logs for more information:
      C:\Users\Admin\work\vcpkg\buildtrees\opencv4\install-x64-windows-dbg-out.log

Call Stack (most recent call first):
  installed/x64-windows/share/vcpkg-cmake/vcpkg_cmake_build.cmake:74 (vcpkg_execute_build_process)
  installed/x64-windows/share/vcpkg-cmake/vcpkg_cmake_install.cmake:16 (vcpkg_cmake_build)
  ports/opencv4/portfile.cmake:452 (vcpkg_cmake_install)
  scripts/ports.cmake:147 (include)


error: building opencv4:x64-windows failed with: BUILD_FAILED
error: Please ensure you're using the latest port files with `git pull` and `vcpkg update`.
Then check for known issues at:
    https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+opencv4
You can submit a new issue at:
    https://github.com/microsoft/vcpkg/issues/new?template=report-package-build-failure.md&title=[opencv4]+Build+error
Include '[opencv4] Build error' in your bug report title, the following version information in your bug description, and attach any relevant failure logs from above.
    vcpkg-tool version: 2022-11-10-5fdee72bc1fceca198fb1ab7589837206a8b81ba
    vcpkg-scripts version: 6f7ffeb18 2022-11-11 (8 weeks ago)

the last few lines from install-x64-windows-dbg-out.log show that it's a cuda compile failure

[888/1057] cmd.exe /C "cd /D C:\Users\Admin\work\vcpkg\buildtrees\opencv4\x64-windows-dbg\modules\cudafeatures2d\CMakeFiles\cuda_compile_1.dir\src\cuda && "C:\Program Files\CMake\bin\cmake.exe" -E make_directory C:/Users/Admin/work/vcpkg/buildtrees/opencv4/x64-windows-dbg/modules/cudafeatures2d/CMakeFiles/cuda_compile_1.dir/src/cuda/. && "C:\Program Files\CMake\bin\cmake.exe" -D verbose:BOOL=OFF -D build_configuration:STRING=Debug -D generated_file:STRING=C:/Users/Admin/work/vcpkg/buildtrees/opencv4/x64-windows-dbg/modules/cudafeatures2d/CMakeFiles/cuda_compile_1.dir/src/cuda/./cuda_compile_1_generated_bf_radius_match.cu.obj -D generated_cubin_file:STRING=C:/Users/Admin/work/vcpkg/buildtrees/opencv4/x64-windows-dbg/modules/cudafeatures2d/CMakeFiles/cuda_compile_1.dir/src/cuda/./cuda_compile_1_generated_bf_radius_match.cu.obj.cubin.txt -P C:/Users/Admin/work/vcpkg/buildtrees/opencv4/x64-windows-dbg/modules/cudafeatures2d/CMakeFiles/cuda_compile_1.dir/src/cuda/cuda_compile_1_generated_bf_radius_match.cu.obj.Debug.cmake"
FAILED: modules/cudafeatures2d/CMakeFiles/cuda_compile_1.dir/src/cuda/cuda_compile_1_generated_bf_radius_match.cu.obj C:/Users/Admin/work/vcpkg/buildtrees/opencv4/x64-windows-dbg/modules/cudafeatures2d/CMakeFiles/cuda_compile_1.dir/src/cuda/cuda_compile_1_generated_bf_radius_match.cu.obj 
cmd.exe /C "cd /D C:\Users\Admin\work\vcpkg\buildtrees\opencv4\x64-windows-dbg\modules\cudafeatures2d\CMakeFiles\cuda_compile_1.dir\src\cuda && "C:\Program Files\CMake\bin\cmake.exe" -E make_directory C:/Users/Admin/work/vcpkg/buildtrees/opencv4/x64-windows-dbg/modules/cudafeatures2d/CMakeFiles/cuda_compile_1.dir/src/cuda/. && "C:\Program Files\CMake\bin\cmake.exe" -D verbose:BOOL=OFF -D build_configuration:STRING=Debug -D generated_file:STRING=C:/Users/Admin/work/vcpkg/buildtrees/opencv4/x64-windows-dbg/modules/cudafeatures2d/CMakeFiles/cuda_compile_1.dir/src/cuda/./cuda_compile_1_generated_bf_radius_match.cu.obj -D generated_cubin_file:STRING=C:/Users/Admin/work/vcpkg/buildtrees/opencv4/x64-windows-dbg/modules/cudafeatures2d/CMakeFiles/cuda_compile_1.dir/src/cuda/./cuda_compile_1_generated_bf_radius_match.cu.obj.cubin.txt -P C:/Users/Admin/work/vcpkg/buildtrees/opencv4/x64-windows-dbg/modules/cudafeatures2d/CMakeFiles/cuda_compile_1.dir/src/cuda/cuda_compile_1_generated_bf_radius_match.cu.obj.Debug.cmake"
bf_radius_match.cu
nvcc warning : The 'compute_35', 'compute_37', 'sm_35', and 'sm_37' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
Wrote crash dump file "C:\Users\Admin\AppData\Local\Temp\cicc.exe-67ef3a.dmp"
LLVMSymbolizer: error reading file: 'kernel32.pdb': no such file or directory
LLVMSymbolizer: error reading file: 'ntdll.pdb': no such file or directory
#0 0x00007ff780eef335 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\nvvm\bin\cicc.exe 0xb2f335 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\nvvm\bin\cicc.exe 0xb30a82
#1 0x00007ff780eef335 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\nvvm\bin\cicc.exe 0xb3161b C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\nvvm\bin\cicc.exe 0xaffeba
#2 0x00007ff780eef335 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\nvvm\bin\cicc.exe 0xbadf0c C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\nvvm\bin\cicc.exe 0x640730
#3 0x00007ff780eef335 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\nvvm\bin\cicc.exe 0x6409b3 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\nvvm\bin\cicc.exe 0x640be7
#4 0x00007ff780eef335 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\nvvm\bin\cicc.exe 0x640080 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\nvvm\bin\cicc.exe 0x3ffec7
#5 0x00007ff780eef335 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\nvvm\bin\cicc.exe 0x3ff521 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\nvvm\bin\cicc.exe 0x3f43db
#6 0x00007ff780eef335 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\nvvm\bin\cicc.exe 0x3c308b C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\nvvm\bin\cicc.exe 0x3c062a
#7 0x00007ff780eef335 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\nvvm\bin\cicc.exe 0x3b82b1 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\nvvm\bin\cicc.exe 0x3c5550
#8 0x00007ff780eef335 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\nvvm\bin\cicc.exe 0xf93334 (C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\nvvm\bin\cicc.exe+0xb2f335)
#9 0x00007ff780eef335 
#10 0x00007ff780eef335 (C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\nvvm\bin\cicc.exe+0xb2f335)
0x00007FF780EEF335 (0x000001F09BDE3E58 0x0000009A535FD850 0x000001F09BDE3E58 0x000001F098A08B01)
0x00007FF780EF0A82 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000)
0x00007FF780EF161B (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x000001F0920D53F0)
0x00007FF780EBFEBA (0x000001F000000001 0x0000000000000000 0x0000000000000001 0x000001F000000001)
0x00007FF780F6DF0C (0x0000000000000000 0x000001F09BBA6BE0 0x0000000000000000 0x000001F09BDE3E58)
0x00007FF780A00730 (0x000001F0920D5390 0x000001F09BDE3E90 0x000001F0920D5300 0x000001F096F34301)
0x00007FF780A009B3 (0x000001F09436EBD0 0x0000000000000030 0x0000009A535FDC69 0x000001F09436ECD0)
0x00007FF780A00BE7 (0x000001F096F34330 0x000001F0959F7200 0x000001F000000000 0x0000000000000006)
0x00007FF780A00080 (0x000001F0921042C0 0x0000009A535FDE20 0x7FFFFFFFFFFFFFFF 0x000001F09436ED10)
0x00007FF7807BFEC7 (0x000001F09BB635D0 0x000001F092101A78 0x0000B77D64312BFA 0x00007FF780433946)
0x00007FF7807BF521 (0x000001F09436EBD0 0x0000009A535FE4C0 0x0000000000000009 0x0000000000000007)
0x00007FF7807B43DB (0x0000009A535FEF10 0xFFFFFFFFFFFFFFFF 0x0000009A535FF0E8 0x0000009A535FEF10)
0x00007FF78078308B (0x0000000000000000 0x0000009A00000000 0x000001F095060180 0x000001F09436EBD0)
0x00007FF78078062A (0x000001F092055780 0x00007FF781DE46D8 0x000001F092055780 0x000001F092055780)
0x00007FF7807782B1 (0x00007FF781DE46D8 0x00000000000003FF 0x000001F09204D3D0 0x00007FF781DE46D8)
0x00007FF780785550 (0x00007FF781DE46D8 0x0000000000000000 0x000001F092045910 0x0000000000000000)
0x00007FF781353334 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000)
0x00007FFB469B74B4 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000)
0x00007FFB47BE26A1 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000), RtlUserThreadStart() + 0x21 bytes(s)
nvcc warning : The 'compute_35', 'compute_37', 'sm_35', and 'sm_37' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
bf_radius_match.cu
nvcc error   : 'cicc' died with status 0xC0000005 (ACCESS_VIOLATION)

CMake Error at cuda_compile_1_generated_bf_radius_match.cu.obj.Debug.cmake:280 (message):
  Error generating file
  C:/Users/Admin/work/vcpkg/buildtrees/opencv4/x64-windows-dbg/modules/cudafeatures2d/CMakeFiles/cuda_compile_1.dir/src/cuda/./cuda_compile_1_generated_bf_radius_match.cu.obj

full log is also uploaded.
install-x64-windows-dbg-out.log

@seigeweapon seigeweapon added the category:port-bug The issue is with a library, which is something the port should already support label Dec 28, 2022
@seigeweapon
Copy link
Author

seigeweapon commented Dec 30, 2022

Also notice:

  1. This nvcc error can happen at random position of compilation. Each time I tried, the cu file where nvcc threw error is different.
  2. Manually compiling Opencv with CMake and Visual Studio is OK. No error.
  3. I tried several different tags of vcpkg, 2022.02.02, 2022.11.14, master, and I tried both vs2019 and vs2022, CUDA 11.7 and CUDA 11.8, all of them failed.
  4. Although more tests should be done, I see this failure only on this specific PC ( Lenovo 10750H 32GB ram GTX 1650ti-MaxQ)

@Phoenix-64
Copy link

Using MSVC as a compiler also does not work

@seigeweapon
Copy link
Author

This seems to be a hardware related nv compiler issue, which only reproduce on my Thinkpad X1 extreme. Close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support
Projects
None yet
Development

No branches or pull requests

3 participants