Package Details: opencv-cuda 4.3.0-1

Git Clone URL: https://aur.archlinux.org/opencv-cuda.git (read-only, click to copy)
Package Base: opencv-cuda
Description: Open Source Computer Vision Library with CUDA support
Upstream URL: http://opencv.org/
Licenses: BSD
Conflicts: opencv, opencv-samples
Provides: opencv, opencv-samples
Submitter: billypilgrim
Maintainer: billypilgrim
Last Packager: billypilgrim
Votes: 9
Popularity: 0.37
First Submitted: 2018-08-11 08:14
Last Updated: 2020-04-15 16:25

Dependencies (24)

Required by (270)

Sources (2)

Latest Comments

1 2 3 4 Next › Last »

zjhzxhz commented on 2020-03-29 14:24

I got the following error

/usr/bin/ld: /usr/lib/libIlmImf-2_4.so.24: undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()@GLIBCXX_3.4.26'

And solve it by adding the following two options to cmake

-DWITH_OPENEXR=OFF \
-DBUILD_OPENEXR=OFF \

stevesp commented on 2020-03-09 10:38

@billypilgrim, I looked at it again and the following is the case:

  • Without passing any flags like -DCUDA_ARCH_BIN it builds CUDA binaries for all available platforms (3.0, 3.5, 3.7, ..., 7.5 for me with CUDA 10.2) and that is a problem for the DNN module since it needs a version 5.3 or higher. So it cannot compile the DNN module for all lower versions and therefore fails.

  • Passing the flag -DCUDA_ARCH_BIN you can actually pass one or several versions, separated by a comma (e.g. -DCUDA_ARCH_BIN=6.0,6.1,7.0,7.5).

  • It is also possible to pass the actual architecture type of the GPU that should be supported (e.g. Fermi, Kepler, Maxwell, Pascal, Volta, Turing) with the -DCUDA_GENERATION flag. Then the CUDA_ARCH_BIN version is set to the supported versions.

  • Furthermore, Auto can be passed to the CUDA_GENERATION flag (-DCUDA_GENERATION=Auto). Then cmake runs a small program to get the correct CUDA_ARCH_BIN version (a Nvidia GPU needs to be present, otherwise it fails and sets it to all available platform versions as in the first point explained. I think this last option fixes the build error generally, so it would make sense to add the -DCUDA_GENERATION=Auto to cmake flags in the PKGBUILD file. Don't you think?

billypilgrim commented on 2020-03-08 18:11

@stevesp I'm not sure I completely understand... If the version is not specified then are only versions < 5.3 built or something?

stevesp commented on 2020-03-06 10:27

@petronny you are welcome. I think it should actually work automatically, at least that is what I think according to the following file: https://github.com/opencv/opencv/blob/master/cmake/OpenCVDetectCUDA.cmake But I think the problem is that it tries to build it for all versions, if nothing is set explicitly, also the versions < 5.3. Therefore, passing the version solves the issue. It is possible to build it for several version as well if they are >= 5.3 (see: https://stackoverflow.com/questions/59480475/building-opencv-4-requires-cc-5-3-or-higher-rtx-2080ti ).

petronny commented on 2020-03-03 09:05

Hi, your fix works. Thanks.

BTW, what's the default CUDA_ARCH that the package is building for? Can I build it for all CUDA_ARCHs?

stevesp commented on 2020-03-03 08:10

@znmeb you need to add -DCUDA_ARCH_BIN=7.5 to the cmake flags in the build function in the PKGBUILD. Substitute 7.5 with the compute capability your graphics card supports (find out at https://developer.nvidia.com/cuda-gpus).

znmeb commented on 2020-03-02 23:47

CMake Error at modules/dnn/CMakeLists.txt:99 (message):
  CUDA backend for DNN module requires CC 5.3 or higher.  Please remove
  unsupported architectures from CUDA_ARCH_BIN option.


-- Configuring incomplete, errors occurred!
See also "/home/znmeb/.cache/yay/opencv-cuda/src/build/CMakeFiles/CMakeOutput.log".
See also "/home/znmeb/.cache/yay/opencv-cuda/src/build/CMakeFiles/CMakeError.log".
==> ERROR: A failure occurred in build().
    Aborting...
Error making: opencv-cuda

billypilgrim commented on 2020-03-01 10:04

@petronny I've pushed a fix, so hopefully it should work for you now.

petronny commented on 2020-03-01 05:06

==> Starting prepare()...
  -> Patching sources for CUDA v10
patching file modules/core/include/opencv2/core/cvstd_wrapper.hpp
patching file modules/cudacodec/CMakeLists.txt
patching file modules/cudacodec/src/cuvid_ffmpeg_api.hpp
patching file modules/cudacodec/src/cuvid_ffmpeg_impl.hpp
patching file modules/cudacodec/src/precomp.hpp
Hunk #1 FAILED at 81.
1 out of 1 hunk FAILED -- saving rejects to file modules/cudacodec/src/precomp.hpp.rej
==> ERROR: A failure occurred in prepare().
    Aborting...

A patch failed in a clean build. Please fix it.

sl1pkn07 commented on 2020-02-14 00:01

fix-cuda-10.1.patch seems not need anymore. build OK without it

greetings