CMAKE BUILD FAIL - openCV 4.9.0; CUDA 12.4; cuDNN 9.1.0; gcc 11.4

I’ve tried openCV 4.8.0 and 4.9.0; same errors.

Here is where the 1st error occurs:

7 errors detected in the compilation of "/home/dk/opencv490/opencv_contrib-4.9.0/modules/cudaarithm/src/cuda/minmax.cu".
CMake Error at cuda_compile_1_generated_minmax.cu.o.RELEASE.cmake:282 (message):
  Error generating file
  /home/dk/opencv490/opencv-4.9.0/build/modules/cudaarithm/CMakeFiles/cuda_compile_1.dir/src/cuda/./cuda_compile_1_generated_minmax.cu.o

Here is where the 2nd error occurs:


[ 35%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/layers/softmax_layer.cpp.o
In file included from /home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/../cuda4dnn/primitives/../../cuda4dnn/csl/cudnn.hpp:,
                 from /home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/../cuda4dnn/primitives/../../op_cuda.hpp:12,
                 from /home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/../cuda4dnn/primitives/recurrent_cells.hpp:8,
                 from /home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/recurrent_layers.cpp:49:
/home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/../cuda4dnn/primitives/../csl/cudnn/recurrent.hpp: In instantiation of ‘cv::dnn::cuda4dnn::csl::cudnn::RNNDescriptor<T>::RNNDescriptor(const cv::dnn::cuda4dnn::csl::cudnn::Handle&, cv::dnn::cuda4dnn::csl::cudnn::RNNDescriptor<T>::RNNMode, int, int, bool, const cv::dnn::cuda4dnn::csl::cudnn::DropoutDescriptor&) [with T = __half]’:
/home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/../cuda4dnn/primitives/../csl/tensor_ops.hpp:541:23:   required from ‘cv::dnn::cuda4dnn::csl::LSTM<T>::LSTM(cv::dnn::cuda4dnn::csl::cudnn::Handle, const cv::dnn::cuda4dnn::csl::LSTM<T>::params_type&) [with T = __half]’
/home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/../cuda4dnn/primitives/recurrent_cells.hpp:48:21:   required from ‘cv::dnn::cuda4dnn::LSTMOp<T>::LSTMOp(cv::dnn::cuda4dnn::csl::Stream, cv::dnn::cuda4dnn::csl::cudnn::Handle, const cv::Mat&, const cv::Mat&, const cv::Mat&, const cv::dnn::cuda4dnn::RNNConfiguration&) [with T = __half]’
/home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/../cuda4dnn/primitives/../../op_cuda.hpp:194:37:   required from ‘cv::Ptr<cv::dnn::dnn4_v20231225::BackendNode> cv::dnn::make_cuda_node(int, Args&& ...) [with NodeType = cv::dnn::cuda4dnn::LSTMOp; Args = {cv::dnn::cuda4dnn::csl::Stream, cv::dnn::cuda4dnn::csl::cudnn::Handle, cv::Mat&, cv::Mat&, cv::Mat&, cv::dnn::cuda4dnn::RNNConfiguration&}]’
/home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/recurrent_layers.cpp:763:48:   required from here
/home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/../cuda4dnn/primitives/../csl/cudnn/recurrent.hpp:122:58: error: ‘cudnnSetRNNDescriptor_v6’ was not declared in this scope; did you mean ‘cudnnSetRNNDescriptor_v8’?
  122 |             CUDA4DNN_CHECK_CUDNN(cudnnSetRNNDescriptor_v6(
/home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/../cuda4dnn/primitives/../../cuda4dnn/csl/cudnn/cudnn.hpp:22:53: note: in definition of macro ‘CUDA4DNN_CHECK_CUDNN’
   22 |     ::cv::dnn::cuda4dnn::csl::cudnn::detail::check((call), CV_Func, __FILE__, __LINE__)
      |                                                     ^~~~
/home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/../cuda4dnn/primitives/../csl/cudnn/recurrent.hpp: In instantiation of ‘size_t cv::dnn::cuda4dnn::csl::cudnn::getRNNWorkspaceSize(const cv::dnn::cuda4dnn::csl::cudnn::Handle&, const cv::dnn::cuda4dnn::csl::cudnn::RNNDescriptor<T>&, int, const cv::dnn::cuda4dnn::csl::cudnn::TensorDescriptorsArray<T>&) [with T = __half; size_t = long unsigned int]’:
/home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/../cuda4dnn/primitives/../csl/tensor_ops.hpp:553:58:   required from ‘cv::dnn::cuda4dnn::csl::LSTM<T>::LSTM(cv::dnn::cuda4dnn::csl::cudnn::Handle, const cv::dnn::cuda4dnn::csl::LSTM<T>::params_type&) [with T = __half]’
/home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/../cuda4dnn/primitives/recurrent_cells.hpp:48:21:   required from ‘cv::dnn::cuda4dnn::LSTMOp<T>::LSTMOp(cv::dnn::cuda4dnn::csl::Stream, cv::dnn::cuda4dnn::csl::cudnn::Handle, const cv::Mat&, const cv::Mat&, const cv::Mat&, const cv::dnn::cuda4dnn::RNNConfiguration&) [with T = __half]’
/home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/../cuda4dnn/primitives/../../op_cuda.hpp:194:37:   required from ‘cv::Ptr<cv::dnn::dnn4_v20231225::BackendNode> cv::dnn::make_cuda_node(int, Args&& ...) [with NodeType = cv::dnn::cuda4dnn::LSTMOp; Args = {cv::dnn::cuda4dnn::csl::Stream, cv::dnn::cuda4dnn::csl::cudnn::Handle, cv::Mat&, cv::Mat&, cv::Mat&, cv::dnn::cuda4dnn::RNNConfiguration&}]’
/home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/recurrent_layers.cpp:763:48:   required from here
/home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/../cuda4dnn/primitives/../csl/cudnn/recurrent.hpp:166:50: error: ‘cudnnGetRNNWorkspaceSize’ was not declared in this scope; did you mean ‘cudnnGetRNNWeightSpaceSize’?
  166 |     CUDA4DNN_CHECK_CUDNN(cudnnGetRNNWorkspaceSize(handle.get(), rnnDesc.get(), seqLength,
/home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/../cuda4dnn/primitives/../../cuda4dnn/csl/cudnn/cudnn.hpp:22:53: note: in definition of macro ‘CUDA4DNN_CHECK_CUDNN’
   22 |     ::cv::dnn::cuda4dnn::csl::cudnn::detail::check((call), CV_Func, __FILE__, __LINE__)
      |                                                     ^~~~
/home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/../cuda4dnn/primitives/../csl/cudnn/recurrent.hpp: In instantiation of ‘cv::dnn::cuda4dnn::csl::cudnn::RNNDescriptor<T>::RNNDescriptor(const cv::dnn::cuda4dnn::csl::cudnn::Handle&, cv::dnn::cuda4dnn::csl::cudnn::RNNDescriptor<T>::RNNMode, int, int, bool, const cv::dnn::cuda4dnn::csl::cudnn::DropoutDescriptor&) [with T = float]’:
/home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/../cuda4dnn/primitives/../csl/tensor_ops.hpp:541:23:   required from ‘cv::dnn::cuda4dnn::csl::LSTM<T>::LSTM(cv::dnn::cuda4dnn::csl::cudnn::Handle, const cv::dnn::cuda4dnn::csl::LSTM<T>::params_type&) [with T = float]’
/home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/../cuda4dnn/primitives/recurrent_cells.hpp:48:21:   required from ‘cv::dnn::cuda4dnn::LSTMOp<T>::LSTMOp(cv::dnn::cuda4dnn::csl::Stream, cv::dnn::cuda4dnn::csl::cudnn::Handle, const cv::Mat&, const cv::Mat&, const cv::Mat&, const cv::dnn::cuda4dnn::RNNConfiguration&) [with T = float]’
/home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/../cuda4dnn/primitives/../../op_cuda.hpp:196:37:   required from ‘cv::Ptr<cv::dnn::dnn4_v20231225::BackendNode> cv::dnn::make_cuda_node(int, Args&& ...) [with NodeType = cv::dnn::cuda4dnn::LSTMOp; Args = {cv::dnn::cuda4dnn::csl::Stream, cv::dnn::cuda4dnn::csl::cudnn::Handle, cv::Mat&, cv::Mat&, cv::Mat&, cv::dnn::cuda4dnn::RNNConfiguration&}]’
/home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/recurrent_layers.cpp:763:48:   required from here
/home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/../cuda4dnn/primitives/../csl/cudnn/recurrent.hpp:122:58: error: ‘cudnnSetRNNDescriptor_v6’ was not declared in this scope; did you mean ‘cudnnSetRNNDescriptor_v8’?
  122 |             CUDA4DNN_CHECK_CUDNN(cudnnSetRNNDescriptor_v6(
/home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/../cuda4dnn/primitives/../../cuda4dnn/csl/cudnn/cudnn.hpp:22:53: note: in definition of macro ‘CUDA4DNN_CHECK_CUDNN’
   22 |     ::cv::dnn::cuda4dnn::csl::cudnn::detail::check((call), CV_Func, __FILE__, __LINE__)
      |                                                     ^~~~
/home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/../cuda4dnn/primitives/../csl/cudnn/recurrent.hpp: In instantiation of ‘size_t cv::dnn::cuda4dnn::csl::cudnn::getRNNWorkspaceSize(const cv::dnn::cuda4dnn::csl::cudnn::Handle&, const cv::dnn::cuda4dnn::csl::cudnn::RNNDescriptor<T>&, int, const cv::dnn::cuda4dnn::csl::cudnn::TensorDescriptorsArray<T>&) [with T = float; size_t = long unsigned int]’:
/home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/../cuda4dnn/primitives/../csl/tensor_ops.hpp:553:58:   required from ‘cv::dnn::cuda4dnn::csl::LSTM<T>::LSTM(cv::dnn::cuda4dnn::csl::cudnn::Handle, const cv::dnn::cuda4dnn::csl::LSTM<T>::params_type&) [with T = float]’
/home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/../cuda4dnn/primitives/recurrent_cells.hpp:48:21:   required from ‘cv::dnn::cuda4dnn::LSTMOp<T>::LSTMOp(cv::dnn::cuda4dnn::csl::Stream, cv::dnn::cuda4dnn::csl::cudnn::Handle, const cv::Mat&, const cv::Mat&, const cv::Mat&, const cv::dnn::cuda4dnn::RNNConfiguration&) [with T = float]’
/home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/../cuda4dnn/primitives/../../op_cuda.hpp:196:37:   required from ‘cv::Ptr<cv::dnn::dnn4_v20231225::BackendNode> cv::dnn::make_cuda_node(int, Args&& ...) [with NodeType = cv::dnn::cuda4dnn::LSTMOp; Args = {cv::dnn::cuda4dnn::csl::Stream, cv::dnn::cuda4dnn::csl::cudnn::Handle, cv::Mat&, cv::Mat&, cv::Mat&, cv::dnn::cuda4dnn::RNNConfiguration&}]’
/home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/recurrent_layers.cpp:763:48:   required from here
/home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/../cuda4dnn/primitives/../csl/cudnn/recurrent.hpp:166:50: error: ‘cudnnGetRNNWorkspaceSize’ was not declared in this scope; did you mean ‘cudnnGetRNNWeightSpaceSize’?
  166 |     CUDA4DNN_CHECK_CUDNN(cudnnGetRNNWorkspaceSize(handle.get(), rnnDesc.get(), seqLength,
/home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/../cuda4dnn/primitives/../../cuda4dnn/csl/cudnn/cudnn.hpp:22:53: note: in definition of macro ‘CUDA4DNN_CHECK_CUDNN’
   22 |     ::cv::dnn::cuda4dnn::csl::cudnn::detail::check((call), CV_Func, __FILE__, __LINE__)
      |                                                     ^~~~
[ 35%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/layers/split_layer.cpp.o
[ 35%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/layers/tile_layer.cpp.o
/home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/../cuda4dnn/primitives/../csl/cudnn/recurrent.hpp: In instantiation of ‘void cv::dnn::cuda4dnn::csl::cudnn::LSTMForward(const cv::dnn::cuda4dnn::csl::cudnn::Handle&, const cv::dnn::cuda4dnn::csl::cudnn::RNNDescriptor<T>&, const cv::dnn::cuda4dnn::csl::cudnn::FilterDescriptor<T>&, cv::dnn::cuda4dnn::csl::DevicePtr<const T>, const cv::dnn::cuda4dnn::csl::cudnn::TensorDescriptorsArray<T>&, cv::dnn::cuda4dnn::csl::DevicePtr<const T>, const cv::dnn::cuda4dnn::csl::cudnn::TensorDescriptor<T>&, cv::dnn::cuda4dnn::csl::DevicePtr<const T>, const cv::dnn::cuda4dnn::csl::cudnn::TensorDescriptor<T>&, cv::dnn::cuda4dnn::csl::DevicePtr<const T>, int, const cv::dnn::cuda4dnn::csl::cudnn::TensorDescriptorsArray<T>&, cv::dnn::cuda4dnn::csl::DevicePtr<T>, cv::dnn::cuda4dnn::csl::DevicePtr<T>, cv::dnn::cuda4dnn::csl::WorkspaceInstance) [with T = float]’:
/home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/../cuda4dnn/primitives/../csl/tensor_ops.hpp:563:34:   required from ‘void cv::dnn::cuda4dnn::csl::LSTM<T>::inference(cv::dnn::cuda4dnn::csl::TensorView<T>, cv::dnn::cuda4dnn::csl::TensorSpan<T>, cv::dnn::cuda4dnn::csl::TensorSpan<T>, cv::dnn::cuda4dnn::csl::TensorView<T>, cv::dnn::cuda4dnn::csl::TensorView<T>, cv::dnn::cuda4dnn::csl::TensorView<T>, cv::dnn::cuda4dnn::csl::WorkspaceInstance) [with T = float]’
/home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/../cuda4dnn/primitives/recurrent_cells.hpp:79:23:   required from ‘void cv::dnn::cuda4dnn::LSTMOp<T>::forward(const std::vector<cv::Ptr<cv::dnn::dnn4_v20231225::BackendWrapper> >&, const std::vector<cv::Ptr<cv::dnn::dnn4_v20231225::BackendWrapper> >&, cv::dnn::cuda4dnn::csl::Workspace&) [with T = float]’
/home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/../cuda4dnn/primitives/recurrent_cells.hpp:63:10:   required from here
/home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/../cuda4dnn/primitives/../csl/cudnn/recurrent.hpp:182:50: error: ‘cudnnRNNForwardInference’ was not declared in this scope
  182 |     CUDA4DNN_CHECK_CUDNN(cudnnRNNForwardInference(handle.get(), rnnDesc.get(), seqLength,
/home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/../cuda4dnn/primitives/../../cuda4dnn/csl/cudnn/cudnn.hpp:22:53: note: in definition of macro ‘CUDA4DNN_CHECK_CUDNN’
   22 |     ::cv::dnn::cuda4dnn::csl::cudnn::detail::check((call), CV_Func, __FILE__, __LINE__)
      |                                                     ^~~~
/home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/../cuda4dnn/primitives/../csl/cudnn/recurrent.hpp: In instantiation of ‘void cv::dnn::cuda4dnn::csl::cudnn::LSTMForward(const cv::dnn::cuda4dnn::csl::cudnn::Handle&, const cv::dnn::cuda4dnn::csl::cudnn::RNNDescriptor<T>&, const cv::dnn::cuda4dnn::csl::cudnn::FilterDescriptor<T>&, cv::dnn::cuda4dnn::csl::DevicePtr<const T>, const cv::dnn::cuda4dnn::csl::cudnn::TensorDescriptorsArray<T>&, cv::dnn::cuda4dnn::csl::DevicePtr<const T>, const cv::dnn::cuda4dnn::csl::cudnn::TensorDescriptor<T>&, cv::dnn::cuda4dnn::csl::DevicePtr<const T>, const cv::dnn::cuda4dnn::csl::cudnn::TensorDescriptor<T>&, cv::dnn::cuda4dnn::csl::DevicePtr<const T>, int, const cv::dnn::cuda4dnn::csl::cudnn::TensorDescriptorsArray<T>&, cv::dnn::cuda4dnn::csl::DevicePtr<T>, cv::dnn::cuda4dnn::csl::DevicePtr<T>, cv::dnn::cuda4dnn::csl::WorkspaceInstance) [with T = __half]’:
/home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/../cuda4dnn/primitives/../csl/tensor_ops.hpp:563:34:   required from ‘void cv::dnn::cuda4dnn::csl::LSTM<T>::inference(cv::dnn::cuda4dnn::csl::TensorView<T>, cv::dnn::cuda4dnn::csl::TensorSpan<T>, cv::dnn::cuda4dnn::csl::TensorSpan<T>, cv::dnn::cuda4dnn::csl::TensorView<T>, cv::dnn::cuda4dnn::csl::TensorView<T>, cv::dnn::cuda4dnn::csl::TensorView<T>, cv::dnn::cuda4dnn::csl::WorkspaceInstance) [with T = __half]’
/home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/../cuda4dnn/primitives/recurrent_cells.hpp:79:23:   required from ‘void cv::dnn::cuda4dnn::LSTMOp<T>::forward(const std::vector<cv::Ptr<cv::dnn::dnn4_v20231225::BackendWrapper> >&, const std::vector<cv::Ptr<cv::dnn::dnn4_v20231225::BackendWrapper> >&, cv::dnn::cuda4dnn::csl::Workspace&) [with T = __half]’
/home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/../cuda4dnn/primitives/recurrent_cells.hpp:63:10:   required from here
/home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/../cuda4dnn/primitives/../csl/cudnn/recurrent.hpp:182:50: error: ‘cudnnRNNForwardInference’ was not declared in this scope
  182 |     CUDA4DNN_CHECK_CUDNN(cudnnRNNForwardInference(handle.get(), rnnDesc.get(), seqLength,
/home/dk/opencv490/opencv-4.9.0/modules/dnn/src/layers/../cuda4dnn/primitives/../../cuda4dnn/csl/cudnn/cudnn.hpp:22:53: note: in definition of macro ‘CUDA4DNN_CHECK_CUDNN’
   22 |     ::cv::dnn::cuda4dnn::csl::cudnn::detail::check((call), CV_Func, __FILE__, __LINE__)
      |                                                     ^~~~
make[2]: *** [modules/dnn/CMakeFiles/opencv_dnn.dir/build.make:1386: modules/dnn/CMakeFiles/opencv_dnn.dir/src/layers/recurrent_layers.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:5793: modules/dnn/CMakeFiles/opencv_dnn.dir/all] Error 2
[ 35%] Building CXX object modules/cudawarping/CMakeFiles/opencv_cudawarping.dir/src/pyramids.cpp.o
[ 35%] Building CXX object modules/cudawarping/CMakeFiles/opencv_cudawarping.dir/src/remap.cpp.o
[ 36%] Building CXX object modules/cudawarping/CMakeFiles/opencv_cudawarping.dir/src/resize.cpp.o
[ 36%] Building CXX object modules/cudawarping/CMakeFiles/opencv_cudawarping.dir/src/warp.cpp.o
[ 36%] Linking CXX shared library ../../lib/libopencv_cudawarping.so
[ 36%] Built target opencv_cudawarping
make: *** [Makefile:166: all] Error 2

openCV build config:


-- 
-- General configuration for OpenCV 4.9.0 =====================================
--   Version control:               unknown
-- 
--   Extra modules:
--     Location (extra):            /home/dk/opencv490/opencv_contrib-4.9.0/modules
--     Version control (extra):     unknown
-- 
--   Platform:
--     Timestamp:                   2024-04-25T20:21:23Z
--     Host:                        Linux 6.5.0-28-generic x86_64
--     CMake:                       3.22.1
--     CMake generator:             Unix Makefiles
--     CMake build tool:            /usr/bin/gmake
--     Configuration:               RELEASE
-- 
--   CPU/HW features:
--     Baseline:                    SSE SSE2 SSE3
--       requested:                 SSE3
--     Dispatched code generation:  SSE4_1 SSE4_2 FP16 AVX AVX2 AVX512_SKX
--       requested:                 SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX
--       SSE4_1 (16 files):         + SSSE3 SSE4_1
--       SSE4_2 (1 files):          + SSSE3 SSE4_1 POPCNT SSE4_2
--       FP16 (0 files):            + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
--       AVX (8 files):             + SSSE3 SSE4_1 POPCNT SSE4_2 AVX
--       AVX2 (36 files):           + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2
--       AVX512_SKX (5 files):      + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2 AVX_512F AVX512_COMMON AVX512_SKX
-- 
--   C/C++:
--     Built as dynamic libs?:      YES
--     C++ standard:                11
--     C++ Compiler:                /usr/bin/g++-11  (ver 11.4.0)
--     C++ flags (Release):         -fsigned-char -ffast-math -fno-finite-math-only -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -fopenmp -O3 -DNDEBUG  -DNDEBUG
--     C++ flags (Debug):           -fsigned-char -ffast-math -fno-finite-math-only -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -fopenmp -g  -O0 -DDEBUG -D_DEBUG
--     C Compiler:                  /usr/bin/gcc-11
--     C flags (Release):           -fsigned-char -ffast-math -fno-finite-math-only -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -fopenmp -O3 -DNDEBUG  -DNDEBUG
--     C flags (Debug):             -fsigned-char -ffast-math -fno-finite-math-only -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -fopenmp -g  -O0 -DDEBUG -D_DEBUG
--     Linker flags (Release):      -Wl,--exclude-libs,libippicv.a -Wl,--exclude-libs,libippiw.a   -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined  
--     Linker flags (Debug):        -Wl,--exclude-libs,libippicv.a -Wl,--exclude-libs,libippiw.a   -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined  
--     ccache:                      NO
--     Precompiled headers:         NO
--     Extra dependencies:          m pthread cudart_static dl rt nppc nppial nppicc nppidei nppif nppig nppim nppist nppisu nppitc npps cublas cudnn cufft -L/usr/local/cuda/lib64 -L/usr/lib/x86_64-linux-gnu
--     3rdparty dependencies:
-- 
--   OpenCV modules:
--     To be built:                 aruco bgsegm bioinspired calib3d ccalib core cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev datasets dnn dnn_objdetect dnn_superres dpm face features2d flann freetype fuzzy gapi hfs highgui img_hash imgcodecs imgproc intensity_transform line_descriptor mcc ml objdetect optflow phase_unwrapping photo plot python3 quality rapid reg rgbd saliency shape stereo stitching structured_light superres surface_matching text tracking video videoio videostab wechat_qrcode xfeatures2d ximgproc xobjdetect xphoto
--     Disabled:                    world
--     Disabled by dependency:      -
--     Unavailable:                 alphamat cannops cvv hdf java julia matlab ovis python2 sfm ts viz
--     Applications:                examples apps
--     Documentation:               NO
--     Non-free algorithms:         NO
-- 
--   GUI:                           GTK3
--     GTK+:                        YES (ver 3.24.33)
--       GThread :                  YES (ver 2.72.4)
--       GtkGlExt:                  NO
--     OpenGL support:              NO
--     VTK support:                 NO
-- 
--   Media I/O: 
--     ZLib:                        /usr/lib/x86_64-linux-gnu/libz.so (ver 1.2.11)
--     JPEG:                        /usr/lib/x86_64-linux-gnu/libjpeg.so (ver 80)
--     WEBP:                        build (ver encoder: 0x020f)
--     PNG:                         /usr/lib/x86_64-linux-gnu/libpng.so (ver 1.6.37)
--     TIFF:                        /usr/lib/x86_64-linux-gnu/libtiff.so (ver 42 / 4.3.0)
--     JPEG 2000:                   build (ver 2.5.0)
--     OpenEXR:                     /usr/lib/x86_64-linux-gnu/libImath-2_5.so /usr/lib/x86_64-linux-gnu/libIlmImf-2_5.so /usr/lib/x86_64-linux-gnu/libIex-2_5.so /usr/lib/x86_64-linux-gnu/libHalf-2_5.so /usr/lib/x86_64-linux-gnu/libIlmThread-2_5.so (ver 2_5)
--     HDR:                         YES
--     SUNRASTER:                   YES
--     PXM:                         YES
--     PFM:                         YES
-- 
--   Video I/O:
--     DC1394:                      NO
--     FFMPEG:                      YES
--       avcodec:                   YES (58.134.100)
--       avformat:                  YES (58.76.100)
--       avutil:                    YES (56.70.100)
--       swscale:                   YES (5.9.100)
--       avresample:                NO
--     GStreamer:                   YES (1.20.3)
--     v4l/v4l2:                    YES (linux/videodev2.h)
-- 
--   Parallel framework:            TBB (ver 2020.2 interface 11102)
-- 
--   Trace:                         YES (with Intel ITT)
-- 
--   Other third-party libraries:
--     Intel IPP:                   2021.10.0 [2021.10.0]
--            at:                   /home/dk/opencv490/opencv-4.9.0/build/3rdparty/ippicv/ippicv_lnx/icv
--     Intel IPP IW:                sources (2021.10.0)
--               at:                /home/dk/opencv490/opencv-4.9.0/build/3rdparty/ippicv/ippicv_lnx/iw
--     VA:                          NO
--     Lapack:                      NO
--     Eigen:                       NO
--     Custom HAL:                  NO
--     Protobuf:                    build (3.19.1)
--     Flatbuffers:                 builtin/3rdparty (23.5.9)
-- 
--   NVIDIA CUDA:                   YES (ver 12.4, CUFFT CUBLAS NVCUVID NVCUVENC FAST_MATH)
--     NVIDIA GPU arch:             50 52 60 61 70 75 80 86 89 90
--     NVIDIA PTX archs:            90
-- 
--   cuDNN:                         YES (ver 9.1.0)
-- 
--   OpenCL:                        YES (no extra features)
--     Include path:                /home/dk/opencv490/opencv-4.9.0/3rdparty/include/opencl/1.2
--     Link libraries:              Dynamic load
-- 
--   Python 3:
--     Interpreter:                 /home/dk/.virtualenvs/cv/bin/python (ver 3.10.12)
--     Libraries:                   /usr/lib/x86_64-linux-gnu/libpython3.10.so (ver 3.10.12)
--     numpy:                       /home/dk/.virtualenvs/cv/lib/python3.10/site-packages/numpy/core/include (ver 1.26.4)
--     install path:                ~/.virtualenvs/cv/lib/python3.10/site-packages/cv2/python-3.10
-- 
--   Python (for build):            /home/dk/.virtualenvs/cv/bin/python
-- 
--   Java:                          
--     ant:                         NO
--     Java:                        NO
--     JNI:                         NO
--     Java wrappers:               NO
--     Java tests:                  NO
-- 
--   Install to:                    /usr/local
-- -----------------------------------------------------------------
-- 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/dk/opencv490/opencv-4.9.0/build

I’ve tried many things… nothing helps. Maybe need to install OLDER GCC? Not sure exactly how I should do that safely.

Need some advice on what my issue is.

Again Issues · opencv/opencv · GitHub

Thanks for this update… so it seems I need to down-revision CUDA to 12.3 and cuDNN to 8.9.7.

I successfully removed CUDA 12.4 and installed CUDA 12.3.

However, after many tries to install cuDNN 8.9.7 from the archive,
( cuDNN Archive | NVIDIA Developer)… I think I am giving up.

I downloaded cudnn-local-repo-ubuntu2204-8.9.7.29_1.0-1_amd64.deb

Then installing with this command:
dk@ASUS:~$ sudo dpkg -D2 -i cudnn-local-repo-ubuntu2204-8.9.7.29_1.0-1_amd64.deb

This is the output:

(Reading database … 231272 files and directories currently installed.)
Preparing to unpack cudnn-local-repo-ubuntu2204-8.9.7.29_1.0-1_amd64.deb …
D000002: maintscript_fallback nonexistent prerm ‘/var/lib/dpkg/info/cudnn-local-repo-ubuntu2204-8.9.7.29.prerm’
D000002: maintscript_new nonexistent preinst ‘/var/lib/dpkg/tmp.ci/preinst’
Unpacking cudnn-local-repo-ubuntu2204-8.9.7.29 (1.0-1) over (1.0-1) …
D000002: maintscript_fallback nonexistent postrm ‘/var/lib/dpkg/info/cudnn-local-repo-ubuntu2204-8.9.7.29.postrm’
D000002: process_archive info installed /var/lib/dpkg/tmp.ci/conffiles as /var/lib/dpkg/info/cudnn-local-repo-ubuntu2204-8.9.7.29.conffiles
D000002: process_archive info installed /var/lib/dpkg/tmp.ci/md5sums as /var/lib/dpkg/info/cudnn-local-repo-ubuntu2204-8.9.7.29.md5sums
D000002: process_archive info installed /var/lib/dpkg/tmp.ci/postinst as /var/lib/dpkg/info/cudnn-local-repo-ubuntu2204-8.9.7.29.postinst
D000002: process_archive tmp.ci script/file ‘/var/lib/dpkg/tmp.ci/control’ is control
D000002: process_archive tmp.ci script/file ‘…’ contains dot
D000002: process_archive tmp.ci script/file ‘.’ contains dot
Setting up cudnn-local-repo-ubuntu2204-8.9.7.29 (1.0-1) …
D000002: fork/exec /var/lib/dpkg/info/cudnn-local-repo-ubuntu2204-8.9.7.29.postinst ( configure 1.0-1 )
dk@ASUS:~$

I have followed the post about renaming and copying GPG key to install this, and I have followed all these steps… and the key is there in there… but it still doesnt work.

I am about to give up.

I decided to try with CUDNN=OFF and OPENCV_DNN_CUDA=OFF.

Here is my make script:

dk@ASUS:~$ cat MAKE_script_for_ASUS_opencv490.sh
#!/usr/bin/env bash

by DK April 2024

ASUS-PC version

JUST THE OPENCV MAKE portion

set -e # exit script immediately upon any error

CMAKEFLAGS="
-D ENABLE_PRECOMPILED_HEADERS=OFF
-D CMAKE_BUILD_TYPE=RELEASE
-D CMAKE_INSTALL_PREFIX=/usr/local
-D CMAKE_PREFIX_PATH=/usr/lib

-D OPENCV_EXTRA_MODULES_PATH=~/opencv490/opencv_contrib-4.9.0/modules
-D BUILD_EXAMPLES=ON
-D BUILD_TESTS=OFF
-D BUILD_PERF_TESTS=OFF
-D INSTALL_C_EXAMPLES=ON
-D OPENCV_GENERATE_PKGCONFIG=ON

-D WITH_CUDA=ON
-D WITH_CUDNN=OFF
-D OPENCV_DNN_CUDA=OFF

-D WITH_CUBLAS=ON
-D ENABLE_FAST_MATH=ON
-D CUDA_FAST_MATH=ON
-D WITH_OPENMP=ON
-D WITH_OPENGL=ON
-D WITH_FFMPEG=ON
-D WITH_GSTREAMER=ON
-D WITH_TBB=ON
-D BUILD_TBB=ON

-D BUILD_NEW_PYTHON_SUPPORT=ON
-D BUILD_opencv_python3=TRUE
-D INSTALL_PYTHON_EXAMPLES=ON
-D PYTHON_EXECUTABLE=~/.virtualenvs/cv/bin/python
-D OPENCV_PYTHON3_INSTALL_PATH=~/.virtualenvs/cv/lib/python3.10/site-packages"

cd ~/opencv490/opencv-4.9.0

mkdir build
cd build

echo “DK-INFO>cmake flags: ${CMAKEFLAGS}”

cmake ${CMAKEFLAGS} …

echo “DK-INFO>Make”
make -j24

echo “DK-INFO>Make Install”
sudo make install

sudo ldconfig

echo "DK-INFO>Done!

It got much further along… but still failed, even with DNN =OFF (see above).

Here is the 1st error.

Error 2:

[ 78%] Building CXX object modules/cudalegacy/CMakeFiles/opencv_cudalegacy.dir/src/gmg.cpp.o
[ 78%] Building CXX object modules/cudalegacy/CMakeFiles/opencv_cudalegacy.dir/src/image_pyramid.cpp.o
[ 78%] Building CXX object modules/cudalegacy/CMakeFiles/opencv_cudalegacy.dir/src/graphcuts.cpp.o
[ 78%] Building CXX object modules/cudalegacy/CMakeFiles/opencv_cudalegacy.dir/src/needle_map.cpp.o
[ 78%] Building CXX object modules/cudalegacy/CMakeFiles/opencv_cudalegacy.dir/src/interpolate_frames.cpp.o
[ 78%] Linking CXX shared library …/…/lib/libopencv_cudalegacy.so
[ 78%] Built target opencv_cudalegacy
make: *** [Makefile:166: all] Error 2
dk@ASUS:~$

So now I really don’t know what to do next…
Any help is much appreciated.

Use the latest commits from the 4.x branches. Your error was fixed in

Regarding cuDNN just download the archive and extract to your CUDA directory don’t bother with the .deb.

Thanks for your help. So, I just downloaded latest from

opencv-4.x.zip, opencv_contrib-4.x.zip.

Unzipped, and updated my make script to this new folder. Keeping cuDNN still OFF.

It failed very quickly:

In file included from /home/dk/opencv/opencv-4.x/build/3rdparty/tbb/oneTBB-2021.11.0/src/tbb/task_dispatcher.h:24,
from /home/dk/opencv/opencv-4.x/build/3rdparty/tbb/oneTBB-2021.11.0/src/tbb/arena.cpp:17:
/home/dk/opencv/opencv-4.x/build/3rdparty/tbb/oneTBB-2021.11.0/src/tbb/scheduler_common.h:248:16: note: called from here
248 | _tpause(0, time_stamp + 1000);
| ~^~~~~~~~~~~~~~~~
make[2]: *** [3rdparty/tbb/CMakeFiles/tbb.dir/build.make:104: 3rdparty/tbb/CMakeFiles/tbb.dir/oneTBB-2021.11.0/src/tbb/arena.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs…
[ 3%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dec/io_dec.c.o
[ 3%] Building C object 3rdparty/ippiw/CMakeFiles/ippiw.dir/src/iw_image_filter_sobel.c.o
[ 3%] Building C object 3rdparty/openjpeg/openjp2/CMakeFiles/libopenjp2.dir/tgt.c.o
[ 3%] Building C object 3rdparty/ippiw/CMakeFiles/ippiw.dir/src/iw_image_op_copy.c.o
[ 3%] Building CXX object CMakeFiles/ade.dir/3rdparty/ade/ade-0.1.2d/sources/ade/source/metatypes.cpp.o
[ 3%] Building C object 3rdparty/openjpeg/openjp2/CMakeFiles/libopenjp2.dir/function_list.c.o
[ 3%] Building C object 3rdparty/ippiw/CMakeFiles/ippiw.dir/src/iw_image_op_copy_channel.c.o
[ 3%] Building C object 3rdparty/ippiw/CMakeFiles/ippiw.dir/src/iw_image_op_copy_make_border.c.o
[ 3%] Building C object 3rdparty/openjpeg/openjp2/CMakeFiles/libopenjp2.dir/opj_malloc.c.o
[ 4%] Building C object 3rdparty/ippiw/CMakeFiles/ippiw.dir/src/iw_image_op_copy_merge.c.o
[ 4%] Building CXX object CMakeFiles/ade.dir/3rdparty/ade/ade-0.1.2d/sources/ade/source/node.cpp.o
Note: Class cv::detail::GraphCutSeamFinder has more than 1 base class (not supported by Python C extensions)
Bases: cv::detail::GraphCutSeamFinderBase, cv::detail::SeamFinder
Only the first base class will be used
[ 4%] Building C object 3rdparty/openjpeg/openjp2/CMakeFiles/libopenjp2.dir/sparse_array.c.o
[ 4%] Building C object 3rdparty/ippiw/CMakeFiles/ippiw.dir/src/iw_image_op_copy_split.c.o
[ 4%] Building C object 3rdparty/ippiw/CMakeFiles/ippiw.dir/src/iw_image_op_scale.c.o

This certainly is not easy nor straightforward. Appreciate all your help.

Turned OFF TBB. Retry.

Still can get it to go.

[ 4%] Linking CXX shared library …/…/lib/libopencv_cudev.so
[ 4%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/cost.c.o
[ 4%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/cost_mips32.c.o
[ 4%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/cost_mips_dsp_r2.c.o
/usr/bin/ld: cannot find -llib64: No such file or directory
[ 4%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/cost_neon.c.o
collect2: error: ld returned 1 exit status
make[2]: *** [modules/cudev/CMakeFiles/opencv_cudev.dir/build.make:99: lib/libopencv_cudev.so.4.9.0] Error 1
make[1]: *** [CMakeFiles/Makefile2:4852: modules/cudev/CMakeFiles/opencv_cudev.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs…
[ 4%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/cost_sse2.c.o
[ 4%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/cpu.c.o
[ 4%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/dec.c.o
[ 4%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/dec_clip_tables.c.o
[ 4%] Building CXX object 3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/repeated_ptr_field.cc.o
[ 4%] Building CXX object 3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/stubs/bytestream.cc.o
[ 4%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/dec_mips32.c.o
[ 4%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/dec_mips_dsp_r2.c.o
[ 4%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/dec_msa.c.o
[ 4%] Building CXX object 3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/stubs/common.cc.o
[ 4%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/dec_sse2.c.o
[ 4%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/dec_sse41.c.o
[ 4%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/dec_neon.c.o
[ 4%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/enc.c.o
[ 4%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/enc_mips32.c.o
[ 4%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/enc_mips_dsp_r2.c.o
[ 4%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/enc_msa.c.o
[ 4%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/enc_neon.c.o
[ 4%] Building CXX object 3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/stubs/int128.cc.o
[ 4%] Building CXX object 3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/stubs/status.cc.o
[ 4%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/enc_sse2.c.o
[ 4%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/enc_sse41.c.o
[ 4%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/filters.c.o
[ 4%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/filters_mips_dsp_r2.c.o
[ 4%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/filters_msa.c.o
[ 4%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/filters_neon.c.o
[ 5%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/filters_sse2.c.o
[ 5%] Building CXX object 3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/stubs/stringpiece.cc.o
[ 5%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/lossless.c.o
[ 5%] Building CXX object 3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/stubs/stringprintf.cc.o
[ 5%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/lossless_enc.c.o
[ 5%] Building CXX object 3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/stubs/structurally_valid.cc.o
[ 5%] Building CXX object 3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/stubs/strutil.cc.o
[ 5%] Building CXX object 3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/wire_format_lite.cc.o
[ 5%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/lossless_enc_mips32.c.o
[ 5%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/lossless_enc_mips_dsp_r2.c.o
[ 5%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/lossless_enc_msa.c.o
[ 5%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/lossless_enc_neon.c.o
[ 5%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/lossless_enc_sse2.c.o
[ 5%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/lossless_enc_sse41.c.o
[ 5%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/lossless_mips_dsp_r2.c.o
[ 5%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/lossless_msa.c.o
[ 5%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/lossless_neon.c.o
[ 5%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/lossless_sse2.c.o
[ 5%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/lossless_sse41.c.o
[ 5%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/rescaler.c.o
[ 5%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/rescaler_mips32.c.o
[ 5%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/rescaler_mips_dsp_r2.c.o
[ 5%] Building CXX object 3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/any.cc.o
[ 5%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/rescaler_neon.c.o
[ 5%] Building CXX object 3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/descriptor.cc.o
[ 5%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/rescaler_msa.c.o
[ 5%] Building CXX object 3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/descriptor.pb.cc.o
[ 5%] Building CXX object 3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/descriptor_database.cc.o
[ 5%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/rescaler_sse2.c.o
[ 5%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/ssim.c.o
[ 5%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/ssim_sse2.c.o
[ 5%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/upsampling.c.o
[ 5%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/upsampling_mips_dsp_r2.c.o
[ 5%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/upsampling_msa.c.o
[ 5%] Building CXX object 3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/extension_set_heavy.cc.o
[ 5%] Building CXX object 3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/dynamic_message.cc.o
[ 5%] Building CXX object 3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/generated_message_reflection.cc.o
[ 5%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/upsampling_neon.c.o
[ 5%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/upsampling_sse2.c.o
[ 6%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/upsampling_sse41.c.o
[ 6%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/yuv.c.o
[ 6%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/yuv_mips32.c.o
[ 6%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/yuv_mips_dsp_r2.c.o
[ 6%] Building CXX object 3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/io/tokenizer.cc.o
[ 6%] Building CXX object 3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/map_field.cc.o
[ 6%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/yuv_neon.c.o
[ 6%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/yuv_sse2.c.o
[ 6%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/yuv_sse41.c.o
[ 6%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/enc/alpha_enc.c.o
[ 6%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/enc/analysis_enc.c.o
[ 6%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/enc/backward_references_cost_enc.c.o
[ 6%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/enc/backward_references_enc.c.o
[ 6%] Built target gen_opencv_python_source
[ 6%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/enc/config_enc.c.o
[ 6%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/enc/cost_enc.c.o
[ 6%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/enc/filter_enc.c.o
[ 6%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/enc/frame_enc.c.o
[ 6%] Linking CXX static library 3rdparty/lib/libade.a
[ 6%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/enc/histogram_enc.c.o
[ 6%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/enc/iterator_enc.c.o
[ 6%] Built target ade
[ 6%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/enc/near_lossless_enc.c.o
[ 6%] Building CXX object 3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/message.cc.o
[ 6%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/enc/picture_csp_enc.c.o
[ 6%] Building CXX object 3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/reflection_ops.cc.o
[ 6%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/enc/picture_enc.c.o
[ 6%] Building CXX object 3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/stubs/substitute.cc.o
[ 6%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/enc/picture_psnr_enc.c.o
[ 6%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/enc/picture_rescale_enc.c.o
[ 7%] Building CXX object 3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/text_format.cc.o
[ 7%] Building CXX object 3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/unknown_field_set.cc.o
[ 7%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/enc/picture_tools_enc.c.o
[ 7%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/enc/predictor_enc.c.o
[ 7%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/enc/quant_enc.c.o
[ 7%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/enc/syntax_enc.c.o
[ 8%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/enc/token_enc.c.o
[ 8%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/enc/tree_enc.c.o
[ 8%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/enc/vp8l_enc.c.o
[ 8%] Building CXX object 3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/wire_format.cc.o
[ 8%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/enc/webp_enc.c.o
[ 8%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/mux/anim_encode.c.o
[ 8%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/mux/muxedit.c.o
[ 8%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/mux/muxinternal.c.o
[ 8%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/mux/muxread.c.o
[ 8%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/utils/bit_reader_utils.c.o
[ 8%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/utils/bit_writer_utils.c.o
[ 8%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/utils/color_cache_utils.c.o
[ 8%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/utils/filters_utils.c.o
[ 8%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/utils/huffman_encode_utils.c.o
[ 8%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/utils/palette.c.o
[ 8%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/utils/huffman_utils.c.o
[ 8%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/utils/quant_levels_dec_utils.c.o
[ 8%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/utils/quant_levels_utils.c.o
[ 8%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/utils/random_utils.c.o
[ 8%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/utils/rescaler_utils.c.o
[ 8%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/utils/thread_utils.c.o
[ 8%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/utils/utils.c.o
[ 8%] Linking C static library …/lib/liblibwebp.a
[ 8%] Built target libwebp
[ 8%] Linking C static library …/…/lib/liblibopenjp2.a
[ 8%] Built target libopenjp2
[ 8%] Linking CXX static library …/lib/liblibprotobuf.a
[ 8%] Built target libprotobuf
make: *** [Makefile:166: all] Error 2
dk@ASUS:~$

Did you clean your build directory?

Yes, the build folder is deleted after each try. The bash script does a ‘mkdir build’ and 'cd ‘build’ each time.

Just tried another run. Failed as usual.

Here is error:

[  4%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/rescaler_mips_dsp_r2.c.o
[  4%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/rescaler_msa.c.o
[  4%] Built target ippiw
[  4%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/rescaler_neon.c.o
[  4%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/rescaler_sse2.c.o
[  4%] Building CXX object modules/cudev/CMakeFiles/opencv_cudev.dir/src/stub.cpp.o
[  4%] Building CXX object CMakeFiles/ade.dir/3rdparty/ade/ade-0.1.2d/sources/ade/source/memory_descriptor_ref.cpp.o
[  4%] Building CXX object CMakeFiles/ade.dir/3rdparty/ade/ade-0.1.2d/sources/ade/source/memory_descriptor_view.cpp.o
[  4%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/ssim.c.o
[  4%] Linking CXX shared library ../../lib/libopencv_cudev.so
/usr/bin/ld: cannot find -llib64: No such file or directory
[  5%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/ssim_sse2.c.o
[  5%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/upsampling_mips_dsp_r2.c.o
collect2: error: ld returned 1 exit status
make[2]: *** [modules/cudev/CMakeFiles/opencv_cudev.dir/build.make:99: lib/libopencv_cudev.so.4.9.0] Error 1
make[1]: *** [CMakeFiles/Makefile2:4808: modules/cudev/CMakeFiles/opencv_cudev.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[  5%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/upsampling_msa.c.o
[  5%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/upsampling.c.o

Here is my config:

-- General configuration for OpenCV 4.9.0-dev =====================================
--   Version control:               unknown
-- 
--   Extra modules:
--     Location (extra):            /home/dk/opencv/opencv_contrib-4.x/modules
--     Version control (extra):     unknown
-- 
--   Platform:
--     Timestamp:                   2024-04-27T13:38:02Z
--     Host:                        Linux 6.5.0-28-generic x86_64
--     CMake:                       3.22.1
--     CMake generator:             Unix Makefiles
--     CMake build tool:            /usr/bin/gmake
--     Configuration:               RELEASE
-- 
--   CPU/HW features:
--     Baseline:                    SSE SSE2 SSE3
--       requested:                 SSE3
--     Dispatched code generation:  SSE4_1 SSE4_2 FP16 AVX AVX2 AVX512_SKX
--       requested:                 SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX
--       SSE4_1 (16 files):         + SSSE3 SSE4_1
--       SSE4_2 (1 files):          + SSSE3 SSE4_1 POPCNT SSE4_2
--       FP16 (0 files):            + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
--       AVX (8 files):             + SSSE3 SSE4_1 POPCNT SSE4_2 AVX
--       AVX2 (36 files):           + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2
--       AVX512_SKX (5 files):      + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2 AVX_512F AVX512_COMMON AVX512_SKX
-- 
--   C/C++:
--     Built as dynamic libs?:      YES
--     C++ standard:                11
--     C++ Compiler:                /usr/bin/c++  (ver 11.4.0)
--     C++ flags (Release):         -fsigned-char -ffast-math -fno-finite-math-only -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -fopenmp -O3 -DNDEBUG  -DNDEBUG
--     C++ flags (Debug):           -fsigned-char -ffast-math -fno-finite-math-only -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -fopenmp -g  -O0 -DDEBUG -D_DEBUG
--     C Compiler:                  /usr/bin/cc
--     C flags (Release):           -fsigned-char -ffast-math -fno-finite-math-only -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -fopenmp -O3 -DNDEBUG  -DNDEBUG
--     C flags (Debug):             -fsigned-char -ffast-math -fno-finite-math-only -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -fopenmp -g  -O0 -DDEBUG -D_DEBUG
--     Linker flags (Release):      -Wl,--exclude-libs,libippicv.a -Wl,--exclude-libs,libippiw.a   -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined  
--     Linker flags (Debug):        -Wl,--exclude-libs,libippicv.a -Wl,--exclude-libs,libippiw.a   -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined  
--     ccache:                      NO
--     Precompiled headers:         NO
--     Extra dependencies:          m pthread cudart_static dl rt nppc nppial nppicc nppidei nppif nppig nppim nppist nppisu nppitc npps cublas lib64 cufft -L/usr/local/cuda/lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/local/cuda
--     3rdparty dependencies:
-- 
--   OpenCV modules:
--     To be built:                 aruco bgsegm bioinspired calib3d ccalib core cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev datasets dnn dnn_objdetect dnn_superres dpm face features2d flann freetype fuzzy gapi hfs highgui img_hash imgcodecs imgproc intensity_transform line_descriptor mcc ml objdetect optflow phase_unwrapping photo plot python3 quality rapid reg rgbd saliency shape signal stereo stitching structured_light superres surface_matching text tracking video videoio videostab wechat_qrcode xfeatures2d ximgproc xobjdetect xphoto
--     Disabled:                    world
--     Disabled by dependency:      -
--     Unavailable:                 alphamat cannops cvv hdf java julia matlab ovis python2 sfm ts viz
--     Applications:                examples apps
--     Documentation:               NO
--     Non-free algorithms:         NO
-- 
--   GUI:                           GTK3
--     GTK+:                        YES (ver 3.24.33)
--       GThread :                  YES (ver 2.72.4)
--       GtkGlExt:                  NO
--     OpenGL support:              NO
--     VTK support:                 NO
-- 
--   Media I/O: 
--     ZLib:                        /usr/lib/x86_64-linux-gnu/libz.so (ver 1.2.11)
--     JPEG:                        /usr/lib/x86_64-linux-gnu/libjpeg.so (ver 80)
--     WEBP:                        build (ver encoder: 0x020f)
--     PNG:                         /usr/lib/x86_64-linux-gnu/libpng.so (ver 1.6.37)
--     TIFF:                        /usr/lib/x86_64-linux-gnu/libtiff.so (ver 42 / 4.3.0)
--     JPEG 2000:                   build (ver 2.5.0)
--     OpenEXR:                     /usr/lib/x86_64-linux-gnu/libImath-2_5.so /usr/lib/x86_64-linux-gnu/libIlmImf-2_5.so /usr/lib/x86_64-linux-gnu/libIex-2_5.so /usr/lib/x86_64-linux-gnu/libHalf-2_5.so /usr/lib/x86_64-linux-gnu/libIlmThread-2_5.so (ver 2_5)
--     HDR:                         YES
--     SUNRASTER:                   YES
--     PXM:                         YES
--     PFM:                         YES
-- 
--   Video I/O:
--     DC1394:                      NO
--     FFMPEG:                      YES
--       avcodec:                   YES (58.134.100)
--       avformat:                  YES (58.76.100)
--       avutil:                    YES (56.70.100)
--       swscale:                   YES (5.9.100)
--       avresample:                NO
--     GStreamer:                   YES (1.20.3)
--     v4l/v4l2:                    YES (linux/videodev2.h)
-- 
--   Parallel framework:            OpenMP
-- 
--   Trace:                         YES (with Intel ITT)
-- 
--   Other third-party libraries:
--     Intel IPP:                   2021.11.0 [2021.11.0]
--            at:                   /home/dk/opencv/opencv-4.x/build/3rdparty/ippicv/ippicv_lnx/icv
--     Intel IPP IW:                sources (2021.11.0)
--               at:                /home/dk/opencv/opencv-4.x/build/3rdparty/ippicv/ippicv_lnx/iw
--     VA:                          NO
--     Lapack:                      NO
--     Eigen:                       NO
--     Custom HAL:                  NO
--     Flatbuffers:                 builtin/3rdparty (23.5.9)
-- 
--   NVIDIA CUDA:                   YES (ver 12.3, CUFFT CUBLAS NVCUVID NVCUVENC FAST_MATH)
--     NVIDIA GPU arch:             50 52 60 61 70 75 80 86 89 90
--     NVIDIA PTX archs:            90
-- 
--   cuDNN:                         YES (ver 8.9.7)
-- 
--   OpenCL:                        YES (no extra features)
--     Include path:                /home/dk/opencv/opencv-4.x/3rdparty/include/opencl/1.2
--     Link libraries:              Dynamic load
-- 
--   Python 3:
--     Interpreter:                 /home/dk/.virtualenvs/cv/bin/python (ver 3.10.12)
--     Libraries:                   /usr/lib/x86_64-linux-gnu/libpython3.10.so (ver 3.10.12)
--     Limited API:                 NO
--     numpy:                       /home/dk/.virtualenvs/cv/lib/python3.10/site-packages/numpy/core/include (ver 1.26.4)
--     install path:                ~/.virtualenvs/cv/lib/python3.10/site-packages/cv2/python-3.10
-- 
--   Python (for build):            /home/dk/.virtualenvs/cv/bin/python
-- 
--   Java:                          
--     ant:                         NO
--     Java:                        NO
--     JNI:                         NO
--     Java wrappers:               NO
--     Java tests:                  NO
-- 
--   Install to:                    /usr/local
-- -----------------------------------------------------------------
-- 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/dk/opencv/opencv-4.x/build

UPDATE: Saturday evening, April 27.

I completely rebuilt the system, starting with clean new Ubuntu 22.04 OS from USB stick.

After a few hours to get all libraries and drivers and opencv all downloaded and installed, I tried a new opencv-4.9.0-dev build.

Thank you for all your help.

-- 
-- General configuration for OpenCV 4.9.0-dev =====================================
--   Version control:               unknown
-- 
--   Extra modules:
--     Location (extra):            /home/sd/opencv/opencv_contrib-4.x/modules
--     Version control (extra):     unknown
-- 
--   Platform:
--     Timestamp:                   2024-04-28T03:44:46Z
--     Host:                        Linux 6.5.0-28-generic x86_64
--     CMake:                       3.22.1
--     CMake generator:             Unix Makefiles
--     CMake build tool:            /usr/bin/gmake
--     Configuration:               RELEASE
-- 
--   CPU/HW features:
--     Baseline:                    SSE SSE2 SSE3
--       requested:                 SSE3
--     Dispatched code generation:  SSE4_1 SSE4_2 FP16 AVX AVX2 AVX512_SKX
--       requested:                 SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX
--       SSE4_1 (16 files):         + SSSE3 SSE4_1
--       SSE4_2 (1 files):          + SSSE3 SSE4_1 POPCNT SSE4_2
--       FP16 (0 files):            + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
--       AVX (8 files):             + SSSE3 SSE4_1 POPCNT SSE4_2 AVX
--       AVX2 (36 files):           + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2
--       AVX512_SKX (5 files):      + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2 AVX_512F AVX512_COMMON AVX512_SKX
-- 
--   C/C++:
--     Built as dynamic libs?:      YES
--     C++ standard:                11
--     C++ Compiler:                /usr/bin/c++  (ver 11.4.0)
--     C++ flags (Release):         -fsigned-char -ffast-math -fno-finite-math-only -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
--     C++ flags (Debug):           -fsigned-char -ffast-math -fno-finite-math-only -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
--     C Compiler:                  /usr/bin/cc
--     C flags (Release):           -fsigned-char -ffast-math -fno-finite-math-only -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -O3 -DNDEBUG  -DNDEBUG
--     C flags (Debug):             -fsigned-char -ffast-math -fno-finite-math-only -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG
--     Linker flags (Release):      -Wl,--exclude-libs,libippicv.a -Wl,--exclude-libs,libippiw.a   -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined  
--     Linker flags (Debug):        -Wl,--exclude-libs,libippicv.a -Wl,--exclude-libs,libippiw.a   -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined  
--     ccache:                      NO
--     Precompiled headers:         NO
--     Extra dependencies:          m pthread cudart_static dl rt nppc nppial nppicc nppidei nppif nppig nppim nppist nppisu nppitc npps cublas cudnn cufft -L/usr/local/cuda/lib64 -L/usr/lib/x86_64-linux-gnu
--     3rdparty dependencies:
-- 
--   OpenCV modules:
--     To be built:                 aruco bgsegm bioinspired calib3d ccalib core cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev datasets dnn dnn_objdetect dnn_superres dpm face features2d flann freetype fuzzy gapi hfs highgui img_hash imgcodecs imgproc intensity_transform line_descriptor mcc ml objdetect optflow phase_unwrapping photo plot python3 quality rapid reg rgbd saliency shape signal stereo stitching structured_light superres surface_matching text tracking video videoio videostab wechat_qrcode xfeatures2d ximgproc xobjdetect xphoto
--     Disabled:                    world
--     Disabled by dependency:      -
--     Unavailable:                 alphamat cannops cvv hdf java julia matlab ovis python2 sfm ts viz
--     Applications:                examples apps
--     Documentation:               NO
--     Non-free algorithms:         NO
-- 
--   GUI:                           GTK3
--     GTK+:                        YES (ver 3.24.33)
--       GThread :                  YES (ver 2.72.4)
--       GtkGlExt:                  NO
--     OpenGL support:              NO
--     VTK support:                 NO
-- 
--   Media I/O: 
--     ZLib:                        /usr/lib/x86_64-linux-gnu/libz.so (ver 1.2.11)
--     JPEG:                        /usr/lib/x86_64-linux-gnu/libjpeg.so (ver 80)
--     WEBP:                        build (ver encoder: 0x020f)
--     PNG:                         /usr/lib/x86_64-linux-gnu/libpng.so (ver 1.6.37)
--     TIFF:                        /usr/lib/x86_64-linux-gnu/libtiff.so (ver 42 / 4.3.0)
--     JPEG 2000:                   build (ver 2.5.0)
--     OpenEXR:                     build (ver 2.3.0)
--     HDR:                         YES
--     SUNRASTER:                   YES
--     PXM:                         YES
--     PFM:                         YES
-- 
--   Video I/O:
--     DC1394:                      NO
--     FFMPEG:                      YES
--       avcodec:                   YES (58.134.100)
--       avformat:                  YES (58.76.100)
--       avutil:                    YES (56.70.100)
--       swscale:                   YES (5.9.100)
--       avresample:                NO
--     GStreamer:                   YES (1.20.3)
--     v4l/v4l2:                    YES (linux/videodev2.h)
-- 
--   Parallel framework:            TBB (ver 2021.5 interface 12050)
-- 
--   Trace:                         YES (with Intel ITT)
-- 
--   Other third-party libraries:
--     Intel IPP:                   2021.11.0 [2021.11.0]
--            at:                   /home/sd/opencv/opencv-4.x/build/3rdparty/ippicv/ippicv_lnx/icv
--     Intel IPP IW:                sources (2021.11.0)
--               at:                /home/sd/opencv/opencv-4.x/build/3rdparty/ippicv/ippicv_lnx/iw
--     VA:                          NO
--     Lapack:                      NO
--     Eigen:                       NO
--     Custom HAL:                  NO
--     Protobuf:                    build (3.19.1)
--     Flatbuffers:                 builtin/3rdparty (23.5.9)
-- 
--   NVIDIA CUDA:                   YES (ver 12.3, CUFFT CUBLAS NVCUVID NVCUVENC FAST_MATH)
--     NVIDIA GPU arch:             50 52 60 61 70 75 80 86 89 90
--     NVIDIA PTX archs:            90
-- 
--   cuDNN:                         YES (ver 8.9.7)
-- 
--   OpenCL:                        YES (no extra features)
--     Include path:                /home/sd/opencv/opencv-4.x/3rdparty/include/opencl/1.2
--     Link libraries:              Dynamic load
-- 
--   Python 3:
--     Interpreter:                 /home/sd/.virtualenvs/cv/bin/python (ver 3.10.12)
--     Libraries:                   /usr/lib/x86_64-linux-gnu/libpython3.10.so (ver 3.10.12)
--     Limited API:                 NO
--     numpy:                       /home/sd/.virtualenvs/cv/lib/python3.10/site-packages/numpy/core/include (ver 1.26.4)
--     install path:                ~/.virtualenvs/cv/lib/python3.10/site-packages/cv2/python-3.10
-- 
--   Python (for build):            /home/sd/.virtualenvs/cv/bin/python
-- 
--   Java:                          
--     ant:                         NO
--     Java:                        NO
--     JNI:                         NO
--     Java wrappers:               NO
--     Java tests:                  NO
-- 
--   Install to:                    /usr/local
-- -----------------------------------------------------------------
-- 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/sd/opencv/opencv-4.x/build
1 Like

I’m not CUDA expert but may be you can reduce compilation time if you set only one GPU arch (your cuda card)

NVIDIA GPU arch:             50 52 60 61 70 75 80 86 89 90

in your cmake command :
DCUDA_ARCH_BIN=x.y

Thank you very much for all your help.

I changed my make bash script to add:
-D CUDA_ARCH_BIN=8.6,8.9,9.0
-D CUDA_ARCH_PTX=9.0

and the total make time was reduced significantly.

I’m using RTX 4070.

Should I just further adjust this and only make with just one value (since it is the only CUDA card that is installed)?
-D CUDA_ARCH_BIN=9.0
-D CUDA_ARCH_PTX=9.0

Again, thank you all for the help. I couldn’t have got this far without this forum!

1 Like

ptx is defined here

this blog too is interesting Matching CUDA arch and CUDA gencode for various NVIDIA architectures - Arnon Shimoni

If your building it for the machine you are on just use

-DCUDA_GENERATION=Auto

which in your case will just generate binaries for compute capability 8.9. i.e. It is equivelant to -D CUDA_ARCH_BIN=8.9.