microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
22.99k stars 6.35k forks source link

install opencv2[cuda * * * ] fails with error: Unsupported gpu architecture 'compute_30' #20991

Closed cmikef closed 2 years ago

cmikef commented 2 years ago

Describe the bug: When installing opencv2[cuda,eigen,ffmpeg,jasper,jpeg,openexr,opengl,png,qt,tiff,world] on windows 10 home with CUDA 11.4, installed, the install fails with this message in the log file:

nvcc fatal : Unsupported gpu architecture 'compute_30'

Environment

To Reproduce

.\vcpkg.exe install opencv2[cuda,eigen,ffmpeg,jasper,jpeg,openexr,opengl,png,qt,tiff,world]

Expected behavior The install should be completed, with all the targeted packages installed.

The actual outcome CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:155 (message):

**What did get installed before the failure:

PS C:\vcpkg> .\vcpkg.exe list
brotli:x64-windows                                 1.0.9#2          a generic-purpose lossless compression algorithm...
bzip2:x64-windows                                  1.0.8#2          bzip2 is a freely available, patent free, high-q...
cuda:x64-windows                                   10.1#8           A parallel computing platform and programming model
double-conversion:x64-windows                      3.1.5#1          Efficient binary-decimal and decimal-binary conv...
egl-registry:x64-windows                           2020-02-20#1     the EGL API and Extension Registry
eigen3:x64-windows                                 3.3.9#1          C++ template library for linear algebra: matrice...
ffmpeg:x64-windows                                 4.4#15           a library to decode, encode, transcode, mux, dem...
ffmpeg[avcodec]:x64-windows                                         Build the avcodec library
ffmpeg[avdevice]:x64-windows                                        Build the avdevice library
ffmpeg[avfilter]:x64-windows                                        Build the avfilter library
ffmpeg[avformat]:x64-windows                                        Build the avformat library
ffmpeg[swresample]:x64-windows                                      Build the swresample library
ffmpeg[swscale]:x64-windows                                         Build the swscale library
freeglut:x64-windows                               3.2.1#6          Open source implementation of GLUT with source a...
freetype:x64-windows                               2.11.0#1         A library to render fonts.
freetype[brotli]:x64-windows                                        Support decompression of WOFF2 streams
freetype[bzip2]:x64-windows                                         Support bzip2 compressed fonts.
freetype[png]:x64-windows                                           Support PNG compressed OpenType embedded bitmaps.
freetype[zlib]:x64-windows                                          Use zlib instead of internal library for DEFLATE
harfbuzz:x64-windows                               3.0.0            HarfBuzz OpenType text shaping engine
icu:x64-windows                                    69.1#15          Mature and widely used Unicode and localization ...
jasper:x64-windows                                 2.0.33           Open source implementation of the JPEG-2000 Part...
libjpeg-turbo:x64-windows                          2.0.6#2          libjpeg-turbo is a JPEG image codec that uses SI...
liblzma:x64-windows                                5.2.5#3          Compression library with an API similar to that ...
libpng:x64-windows                                 1.6.37#15        libpng is a library implementing an interface fo...
openexr:x64-windows                                2.5.0#3          OpenEXR is a high dynamic-range (HDR) image file...
opengl:x64-windows                                 0.0#9            Open Graphics Library (OpenGL)[3][4][5] is a cro...
openssl:x64-windows                                1.1.1l#2         OpenSSL is an open source project that provides ...
pcre2:x64-windows                                  10.37            PCRE2 is a re-working of the original Perl Compa...
qt5-base:x64-windows                               5.15.2#11        Qt5 Application Framework Base Module. Includes ...
sqlite3:x64-windows                                3.36.0#1         SQLite is a software library that implements a s...
tiff:x64-windows                                   4.3.0#2          A library that supports the manipulation of TIFF...
tiff[jpeg]:x64-windows                                              Support JPEG compression in TIFF image files
tiff[lzma]:x64-windows                                              Support LZMA compression in TIFF image files
tiff[zip]:x64-windows                                               Support ZIP/deflate compression in TIFF image files
vcpkg-cmake-config:x64-windows                     2021-09-27
vcpkg-cmake:x64-windows                            2021-09-13
vcpkg-pkgconfig-get-modules:x64-windows            2021-04-02#1
zlib:x64-windows                                   1.2.11#13        A compression library
zstd:x64-windows                                   1.5.0            Zstandard - Fast real-time compression algorithm

Console output

Starting package 28/28: opencv2:x64-windows
Building package opencv2[core,cuda,eigen,ffmpeg,jasper,jpeg,openexr,opengl,png,qt,tiff,world]:x64-windows...
-- Downloading https://github.com/opencv/opencv/archive/2.4.13.7.tar.gz -> opencv-opencv-2.4.13.7.tar.gz...
-- Extracting source C:/vcpkg/downloads/opencv-opencv-2.4.13.7.tar.gz
-- Applying patch 0002-install-options.patch
-- Applying patch 0003-force-package-requirements.patch
-- Applying patch 0004-add-ffmpeg-missing-defines.patch
-- Applying patch 0005-fix-cuda.patch
-- Using source at C:/vcpkg/buildtrees/opencv2/src/2.4.13.7-64eb3208d2.clean
-- Found external ninja('1.10.2').
-- Configuring x64-windows
-- Building x64-windows-dbg
CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:155 (message):
    Command failed: "C:/Program Files/CMake/bin/cmake.exe" --build . --config Debug --target install -- -v -j25
    Working Directory: C:/vcpkg/buildtrees/opencv2/x64-windows-dbg
    See logs for more information:
      C:\vcpkg\buildtrees\opencv2\install-x64-windows-dbg-out.log

Call Stack (most recent call first):
  installed/x64-windows/share/vcpkg-cmake/vcpkg_cmake_build.cmake:102 (vcpkg_execute_build_process)
  installed/x64-windows/share/vcpkg-cmake/vcpkg_cmake_install.cmake:41 (vcpkg_cmake_build)
  ports/opencv2/portfile.cmake:98 (vcpkg_cmake_install)
  scripts/ports.cmake:142 (include)

Error: Building package opencv2:x64-windows failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `.\vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: opencv2:x64-windows
  Vcpkg version: 2021-09-10-2059ef11aa6067e6f59b0d939c5d17e3c5c47d3e

Additionally, attach any relevant sections from the log files above.

Failure logs: from: install-x64-windows-dbg-out.log

[1/546] cmd.exe /C "cd /D C:\vcpkg\buildtrees\opencv2\x64-windows-dbg\modules\core\CMakeFiles\cuda_compile_1.dir\__\dynamicuda\src\cuda && "C:\Program Files\CMake\bin\cmake.exe" -E make_directory C:/vcpkg/buildtrees/opencv2/x64-windows-dbg/modules/core/CMakeFiles/cuda_compile_1.dir/__/dynamicuda/src/cuda/. && "C:\Program Files\CMake\bin\cmake.exe" -D verbose:BOOL=OFF -D build_configuration:STRING=Debug -D generated_file:STRING=C:/vcpkg/buildtrees/opencv2/x64-windows-dbg/modules/core/CMakeFiles/cuda_compile_1.dir/__/dynamicuda/src/cuda/./cuda_compile_1_generated_matrix_operations.cu.obj -D generated_cubin_file:STRING=C:/vcpkg/buildtrees/opencv2/x64-windows-dbg/modules/core/CMakeFiles/cuda_compile_1.dir/__/dynamicuda/src/cuda/./cuda_compile_1_generated_matrix_operations.cu.obj.cubin.txt -P C:/vcpkg/buildtrees/opencv2/x64-windows-dbg/modules/core/CMakeFiles/cuda_compile_1.dir/__/dynamicuda/src/cuda/cuda_compile_1_generated_matrix_operations.cu.obj.Debug.cmake"
FAILED: modules/core/CMakeFiles/cuda_compile_1.dir/__/dynamicuda/src/cuda/cuda_compile_1_generated_matrix_operations.cu.obj C:/vcpkg/buildtrees/opencv2/x64-windows-dbg/modules/core/CMakeFiles/cuda_compile_1.dir/__/dynamicuda/src/cuda/cuda_compile_1_generated_matrix_operations.cu.obj 
cmd.exe /C "cd /D C:\vcpkg\buildtrees\opencv2\x64-windows-dbg\modules\core\CMakeFiles\cuda_compile_1.dir\__\dynamicuda\src\cuda && "C:\Program Files\CMake\bin\cmake.exe" -E make_directory C:/vcpkg/buildtrees/opencv2/x64-windows-dbg/modules/core/CMakeFiles/cuda_compile_1.dir/__/dynamicuda/src/cuda/. && "C:\Program Files\CMake\bin\cmake.exe" -D verbose:BOOL=OFF -D build_configuration:STRING=Debug -D generated_file:STRING=C:/vcpkg/buildtrees/opencv2/x64-windows-dbg/modules/core/CMakeFiles/cuda_compile_1.dir/__/dynamicuda/src/cuda/./cuda_compile_1_generated_matrix_operations.cu.obj -D generated_cubin_file:STRING=C:/vcpkg/buildtrees/opencv2/x64-windows-dbg/modules/core/CMakeFiles/cuda_compile_1.dir/__/dynamicuda/src/cuda/./cuda_compile_1_generated_matrix_operations.cu.obj.cubin.txt -P C:/vcpkg/buildtrees/opencv2/x64-windows-dbg/modules/core/CMakeFiles/cuda_compile_1.dir/__/dynamicuda/src/cuda/cuda_compile_1_generated_matrix_operations.cu.obj.Debug.cmake"
nvcc fatal   : Unsupported gpu architecture 'compute_30'
CMake Error at cuda_compile_1_generated_matrix_operations.cu.obj.Debug.cmake:220 (message):
  Error generating
  C:/vcpkg/buildtrees/opencv2/x64-windows-dbg/modules/core/CMakeFiles/cuda_compile_1.dir/__/dynamicuda/src/cuda/./cuda_compile_1_generated_matrix_operations.cu.obj

[2/546] cmd.exe /C "cd /D C:\vcpkg\buildtrees\opencv2\x64-windows-dbg\modules\highgui && "C:\Program Files\CMake\bin\cmake.exe" -E cmake_autogen C:/vcpkg/buildtrees/opencv2/x64-windows-dbg/modules/highgui/CMakeFiles/opencv_highgui_autogen.dir/AutogenInfo.json Debug && "C:\Program Files\CMake\bin\cmake.exe" -E touch C:/vcpkg/buildtrees/opencv2/x64-windows-dbg/modules/highgui/opencv_highgui_autogen/timestamp && "C:\Program Files\CMake\bin\cmake.exe" -E cmake_transform_depfile Ninja gccdepfile C:/vcpkg/buildtrees/opencv2/src/2.4.13.7-64eb3208d2.clean C:/vcpkg/buildtrees/opencv2/src/2.4.13.7-64eb3208d2.clean/modules/highgui C:/vcpkg/buildtrees/opencv2/x64-windows-dbg C:/vcpkg/buildtrees/opencv2/x64-windows-dbg/modules/highgui C:/vcpkg/buildtrees/opencv2/x64-windows-dbg/modules/highgui/opencv_highgui_autogen/deps C:/vcpkg/buildtrees/opencv2/x64-windows-dbg/CMakeFiles/d/96907176fc92cb7c6f4b88b92bd4963a777599b51031e9924eea198598cb16df.d"
ninja: build stopped: subcommand failed.

What I found: The problem and fix seem to be described on stackoverflow link.

NancyLi1013 commented 2 years ago

@cenit

Does opencv2 support this?

cmikef commented 2 years ago

According to this link https://opencv.org/platforms/cuda it does. See the example just below "Short sample".

I started working with old code that uses OpenCV2 and OpenPose. I wanted to start from a known configuration. The OpenCV in the current code does not use CUDA, and I am moving to OpenCV4 going forward. I thought I'd report the bug. Don't fix it on my account. I have already moved on.

Thanks

Mike

On Tue, Oct 26, 2021 at 12:16 AM NancyLi1013 @.***> wrote:

@cenit https://github.com/cenit

Does opencv2 support this?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/microsoft/vcpkg/issues/20991#issuecomment-951630740, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACU2JXNF6H5YKMKNW6WEBTUIZIS7ANCNFSM5GWNLYOQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

cenit commented 2 years ago

it is supported, we need to update our patch for newer cuda. I'll do that in the PR already opened

NancyLi1013 commented 2 years ago

Thanks for your information @cenit.

NancyLi1013 commented 2 years ago

Might be fixed by PR #20658?

cenit commented 2 years ago

yes

cenit commented 2 years ago

@cmikef please try #20658, opencv2[cuda] should work now even with new CUDA versions