[ WARN:0@1.416] global net_impl.cpp:174 setUpNet DNN module was not built with CUDA backend; switching to CPU

I am using OpenCV 4.8.0 and also make sure CuDNN and CUDA is installed from below command:

cmake -D CMAKE_BUILD_TYPE=RELEASE
-D CMAKE_INSTALL_PREFIX=/usr/local
-D INSTALL_PYTHON_EXAMPLES=ON
-D INSTALL_C_EXAMPLES=OFF
-D OPENCV_ENABLE_NONFREE=ON
-D WITH_CUDA=ON
-D WITH_CUDNN=ON
-D WITH_CUDNN=ON
-D OPENCV_DNN_CUDA=ON
-D ENABLE_FAST_MATH=1
-D BUILD_OPENCV_WORLD=ON
-D CUDA_FAST_MATH=1
-D CUDA_ARCH_BIN=8.7
-D WITH_CUBLAS=1
-D OPENCV_DNN_CUDA=ON
-D ENABLE_FAST_MATH=1
-D CUDA_FAST_MATH=1
-D CUDA_ARCH_BIN=6.1
-D WITH_CUBLAS=1
-D OPENCV_EXTRA_MODULES_PATH=/home/neeraj/Applications/OpenCV/opencv_contrib/modules
-D CUDNN_LIBRARY=/usr/lib/cuda/lib64/libcudnn.so.8.9.5
-D CUDNN_INCLUDE_DIR=/usr/lib/cuda/include
-D HAVE_opencv_python3=ON
-D PYTHON_EXECUTABLE=~/.virtualenvs/opencv_dnn_cuda/bin/python
-D BUILD_EXAMPLES=OFF …

from below output:

– ocv_init_download: OpenCV source tree is not fetched as git repository. 3rdparty resources will be downloaded from github.com by default.
– Detected processor: x86_64
CMake Warning (dev) at cmake/OpenCVUtils.cmake:144 (find_package):
Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
are removed. Run β€œcmake --help-policy CMP0148” for policy details. Use
the cmake_policy command to set the policy and suppress this warning.

Call Stack (most recent call first):
cmake/OpenCVDetectPython.cmake:64 (find_host_package)
cmake/OpenCVDetectPython.cmake:271 (find_python)
CMakeLists.txt:649 (include)
This warning is for project developers. Use -Wno-dev to suppress it.

– Looking for ccache - found (/usr/bin/ccache)
– Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found suitable version β€œ1.2.11”, minimum required is β€œ1.2.3”)
Cleaning INTERNAL cached variable: WEBP_LIBRARY
Cleaning INTERNAL cached variable: WEBP_INCLUDE_DIR
– Could NOT find OpenJPEG (minimal suitable version: 2.0, recommended version >= 2.3.1). OpenJPEG will be built from sources
– OpenJPEG: VERSION = 2.5.0, BUILD = opencv-4.8.0-openjp2-2.5.0
– OpenJPEG libraries will be built from sources: libopenjp2 (version β€œ2.5.0”)
– Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version β€œ1.2.11”)
– Found OpenEXR: /usr/lib/x86_64-linux-gnu/libIlmImf-2_5.so
– libva: missing va.h header (VA_INCLUDE_DIR)
– found Intel IPP (ICV version): 2021.8.0 [2021.8]
– at: /home/neeraj/Applications/OpenCV/opencv/build/3rdparty/ippicv/ippicv_lnx/icv
– found Intel IPP Integration Wrappers sources: 2021.8.0
– at: /home/neeraj/Applications/OpenCV/opencv/build/3rdparty/ippicv/ippicv_lnx/iw
CMake Warning (dev) at cmake/OpenCVUtils.cmake:144 (find_package):
Policy CMP0146 is not set: The FindCUDA module is removed. Run β€œcmake
–help-policy CMP0146” for policy details. Use the cmake_policy command to
set the policy and suppress this warning.

Call Stack (most recent call first):
cmake/OpenCVDetectCUDA.cmake:21 (find_host_package)
cmake/OpenCVFindLibsPerf.cmake:43 (include)
CMakeLists.txt:756 (include)
This warning is for project developers. Use -Wno-dev to suppress it.

– CUDA detected: 11.5
– CUDA: Using CUDA_ARCH_BIN=6.1
– CUDA NVCC target flags: -gencode;arch=compute_61,code=sm_61;-D_FORCE_INLINES
– Could not find OpenBLAS include. Turning OpenBLAS_FOUND off
– Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off
– Could NOT find Atlas (missing: Atlas_CLAPACK_INCLUDE_DIR)
– VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file
– Checking for module β€˜libavresample’
– No package β€˜libavresample’ found
– freetype2: YES (ver 24.1.18)
– harfbuzz: YES (ver 2.7.4)
– Could NOT find HDF5 (missing: HDF5_LIBRARIES HDF5_INCLUDE_DIRS) (found version β€œβ€)
– Julia not found. Not compiling Julia Bindings.
– Module opencv_ovis disabled because OGRE3D was not found
– No preference for use of exported gflags CMake configuration set, and no hints for include/library directories provided. Defaulting to preferring an installed/exported gflags CMake configuration if available.
– Failed to find installed gflags CMake configuration, searching for gflags build directories exported with CMake.
– Failed to find gflags - Failed to find an installed/exported CMake configuration for gflags, will perform search for installed gflags components.
– Failed to find gflags - Could not find gflags include directory, set GFLAGS_INCLUDE_DIR to directory containing gflags/gflags.h
– Failed to find glog - Could not find glog include directory, set GLOG_INCLUDE_DIR to directory containing glog/logging.h
– Module opencv_sfm disabled because the following dependencies are not found: Glog/Gflags
– Checking for module β€˜tesseract’
– No package β€˜tesseract’ found
– Tesseract: NO
– Allocator metrics storage type: β€˜long long’
– Excluding from source files list: modules/imgproc/src/imgwarp.lasx.cpp
– Excluding from source files list: modules/imgproc/src/resize.lasx.cpp
– Registering hook β€˜INIT_MODULE_SOURCES_opencv_dnn’: /home/neeraj/Applications/OpenCV/opencv/modules/dnn/cmake/hooks/INIT_MODULE_SOURCES_opencv_dnn.cmake
– Excluding from source files list: /modules/dnn/layers/layers_common.rvv.cpp
– Excluding from source files list: /modules/dnn/layers/layers_common.lasx.cpp
– Excluding from source files list: /modules/dnn/int8layers/layers_common.lasx.cpp
– Excluding from source files list: /modules/dnn/layers/cpu_kernels/conv_depthwise.rvv.cpp
– Excluding from source files list: /modules/dnn/layers/cpu_kernels/conv_depthwise.lasx.cpp
– highgui: using builtin backend: GTK3
– Building with NVIDIA Optical Flow API 2.0
– Found β€˜misc’ Python modules from /home/neeraj/Applications/OpenCV/opencv/modules/python/package/extra_modules
– Found β€˜mat_wrapper;utils’ Python modules from /home/neeraj/Applications/OpenCV/opencv/modules/core/misc/python/package
– Found β€˜gapi’ Python modules from /home/neeraj/Applications/OpenCV/opencv/modules/gapi/misc/python/package
– Found β€˜misc’ Python modules from /home/neeraj/Applications/OpenCV/opencv/modules/python/package/extra_modules
– Found β€˜mat_wrapper;utils’ Python modules from /home/neeraj/Applications/OpenCV/opencv/modules/core/misc/python/package
– Found β€˜gapi’ Python modules from /home/neeraj/Applications/OpenCV/opencv/modules/gapi/misc/python/package

– General configuration for OpenCV 4.8.0 =====================================
– Version control: unknown

– Extra modules:
– Location (extra): /home/neeraj/Applications/OpenCV/opencv_contrib/modules
– Version control (extra): unknown

– Platform:
– Timestamp: 2023-09-28T11:17:53Z
– Host: Linux 6.2.0-33-generic x86_64
– CMake: 3.27.4
– 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 (18 files): + SSSE3 SSE4_1
– SSE4_2 (2 files): + SSSE3 SSE4_1 POPCNT SSE4_2
– FP16 (1 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
– AVX (8 files): + SSSE3 SSE4_1 POPCNT SSE4_2 AVX
– AVX2 (37 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2
– AVX512_SKX (8 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 -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 -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 -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 -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: YES
– 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/lib/x86_64-linux-gnu -L/usr/lib/cuda/lib64
– 3rdparty dependencies:

– OpenCV modules:
– To be built: alphamat 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 java 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 ts video videoio videostab wechat_qrcode xfeatures2d ximgproc xobjdetect xphoto
– Disabled: world
– Disabled by dependency: -
– Unavailable: cvv hdf julia matlab ovis python2 sfm viz
– Applications: tests perf_tests apps
– Documentation: NO
– Non-free algorithms: YES

– GUI: GTK3
– GTK+: YES (ver 3.24.33)
– GThread : YES (ver 2.72.4)
– GtkGlExt: 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: YES (2.2.6)
– 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: pthreads

– Trace: YES (with Intel ITT)

– Other third-party libraries:
– Intel IPP: 2021.8 [2021.8.0]
– at: /home/neeraj/Applications/OpenCV/opencv/build/3rdparty/ippicv/ippicv_lnx/icv
– Intel IPP IW: sources (2021.8.0)
– at: /home/neeraj/Applications/OpenCV/opencv/build/3rdparty/ippicv/ippicv_lnx/iw
– VA: NO
– Lapack: NO
– Eigen: YES (ver 3.4.0)
– Custom HAL: NO
– Protobuf: build (3.19.1)
– Flatbuffers: builtin/3rdparty (23.5.9)

– NVIDIA CUDA: YES (ver 11.5, CUFFT CUBLAS FAST_MATH)
– NVIDIA GPU arch: 61
– NVIDIA PTX archs:

– cuDNN: YES (ver 8.9.5)

– OpenCL: YES (no extra features)
– Include path: /home/neeraj/Applications/OpenCV/opencv/3rdparty/include/opencl/1.2
– Link libraries: Dynamic load

– Python 3:
– Interpreter: /usr/bin/python3 (ver 3.10.12)
– Libraries: /usr/lib/x86_64-linux-gnu/libpython3.10.so (ver 3.10.12)
– numpy: /usr/local/lib/python3.10/dist-packages/numpy/core/include (ver 1.22.4)
– install path: lib/python3.10/dist-packages/cv2/python-3.10

– Python (for build): /usr/bin/python3

– Java:
– ant: NO
– Java: YES (ver 11.0.20)
– JNI: /usr/lib/jvm/java-8-openjdk-amd64/include /usr/lib/jvm/java-8-openjdk-amd64/include/linux /usr/lib/jvm/java-8-openjdk-amd64/include
– Java wrappers: YES (JAVA)
– Java tests: NO

– Install to: /usr/local


–
– Configuring done (17.4s)
– Generating done (9.6s)
– Build files have been written to: /home/neeraj/Applications/OpenCV/opencv/build

But when I am trying to execute ultralytics/examples/YOLOv8-CPP-Inference. I am getting a warning message. β€œ[ WARN:0@1.107] global net_impl.cpp:174 setUpNet DNN module was not built with CUDA backend; switching to CPU”.

Am I doing anything wrong?

Please help.

Thanks in advance.

Thanks and regards,
Neeraj Dhekale

please show exactly, what you’re doing here.

Thank you @berak for the reply.
in YOLOv8-CPP-Inference. folder I executed the below commands with success without any errors.

mkdir build
cd build
cmake …
make

And then to execute the command :
./Yolov8CPPInference

Output of each command given below:
cmake …
CMake Warning (dev) at CMakeLists.txt:9 (find_package):
Policy CMP0146 is not set: The FindCUDA module is removed. Run β€œcmake
–help-policy CMP0146” for policy details. Use the cmake_policy command to
set the policy and suppress this warning.

This warning is for project developers. Use -Wno-dev to suppress it.

– Configuring done (0.3s)
– Generating done (0.0s)
– Build files have been written to: /var/www/iot/OpenCV_CPP/cpp_test/ultralytics/examples/YOLOv8-CPP-Inference/build
neeraj@neeraj-VivoBook-15-ASUS-Laptop-X507UF:/var/www/iot/OpenCV_CPP/cpp_test/ultralytics/examples/YOLOv8-CPP-Inference/build$ make
[100%] Built target Yolov8CPPInference

I refer below link for the above steps.

Thanks and regards,
Neeraj Dhekale

1 Like

insert in your c++ code
cout << getBuildInformation() <<endl;

to check cuda availabilty at runtime

1 Like

After inserting below code:
cout << getBuildInformation() <<endl;

Output:

Running on CUDA
[ WARN:0@0.482] global net_impl.cpp:174 setUpNet DNN module was not built with CUDA backend; switching to CPU
Number of detections:5
Gtk-Message: 17:09:59.667: Failed to load module β€œcanberra-gtk-module”

General configuration for OpenCV 4.7.0-dev =====================================
Version control: 4.7.0-117-g752ac19a2f

Extra modules:
Location (extra): /opt/opencv_contrib/modules
Version control (extra): 4.7.0-25-g9d4b93a2

Platform:
Timestamp: 2023-03-19T07:43:49Z
Host: Linux 5.19.0-35-generic x86_64
CMake: 3.26.0
CMake generator: Unix Makefiles
CMake build tool: /usr/bin/gmake
Configuration: RELEASE

CPU/HW features:
Baseline: SSE SSE2 SSE3
requested: SSE3
disabled: AVX
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 (7 files): + SSSE3 SSE4_1 POPCNT SSE4_2 AVX
AVX2 (34 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.3.0)
C++ flags (Release): -fsigned-char -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 -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 -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 -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,–gc-sections -Wl,–as-needed -Wl,–no-undefined
Linker flags (Debug): -Wl,–gc-sections -Wl,–as-needed -Wl,–no-undefined
ccache: YES
Precompiled headers: NO
Extra dependencies: dl m pthread rt
3rdparty dependencies:

OpenCV modules:
To be built: aruco barcode bgsegm bioinspired calib3d ccalib core 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 cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv hdf java julia matlab ovis python2 sfm ts viz
Applications: apps
Documentation: NO
Non-free algorithms: NO

GUI: GTK2
GTK+: YES (ver 2.24.33)
GThread : YES (ver 2.72.4)
GtkGlExt: 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: build (ver 42 - 4.2.0)
JPEG 2000: build (ver 2.4.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: YES (2.2.6)
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)

Parallel framework: TBB (ver 2020.2 interface 11102)

Trace: YES (with Intel ITT)

Other third-party libraries:
VA: NO
Lapack: NO
Custom HAL: NO
Protobuf: build (3.19.1)
Flatbuffers: builtin/3rdparty (23.1.21)

Python 3:
Interpreter: /usr/bin/python3 (ver 3.10.6)
Libraries: /usr/lib/x86_64-linux-gnu/libpython3.10.so (ver 3.10.6)
numpy: /usr/local/lib/python3.10/dist-packages/numpy/core/include (ver 1.22.4)
install path: lib/python3.10/dist-packages/cv2/python-3.10

Python (for build): /usr/bin/python3

Java:
ant: NO
JNI: /usr/lib/jvm/java-8-openjdk-amd64/include /usr/lib/jvm/java-8-openjdk-amd64/include/linux /usr/lib/jvm/java-8-openjdk-amd64/include
Java wrappers: NO
Java tests: NO

Install to: /usr/local

Number of detections:3

General configuration for OpenCV 4.7.0-dev =====================================
Version control: 4.7.0-117-g752ac19a2f

Extra modules:
Location (extra): /opt/opencv_contrib/modules
Version control (extra): 4.7.0-25-g9d4b93a2

Platform:
Timestamp: 2023-03-19T07:43:49Z
Host: Linux 5.19.0-35-generic x86_64
CMake: 3.26.0
CMake generator: Unix Makefiles
CMake build tool: /usr/bin/gmake
Configuration: RELEASE

CPU/HW features:
Baseline: SSE SSE2 SSE3
requested: SSE3
disabled: AVX
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 (7 files): + SSSE3 SSE4_1 POPCNT SSE4_2 AVX
AVX2 (34 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.3.0)
C++ flags (Release): -fsigned-char -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 -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 -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 -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,–gc-sections -Wl,–as-needed -Wl,–no-undefined
Linker flags (Debug): -Wl,–gc-sections -Wl,–as-needed -Wl,–no-undefined
ccache: YES
Precompiled headers: NO
Extra dependencies: dl m pthread rt
3rdparty dependencies:

OpenCV modules:
To be built: aruco barcode bgsegm bioinspired calib3d ccalib core 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 cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv hdf java julia matlab ovis python2 sfm ts viz
Applications: apps
Documentation: NO
Non-free algorithms: NO

GUI: GTK2
GTK+: YES (ver 2.24.33)
GThread : YES (ver 2.72.4)
GtkGlExt: 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: build (ver 42 - 4.2.0)
JPEG 2000: build (ver 2.4.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: YES (2.2.6)
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)

Parallel framework: TBB (ver 2020.2 interface 11102)

Trace: YES (with Intel ITT)

Other third-party libraries:
VA: NO
Lapack: NO
Custom HAL: NO
Protobuf: build (3.19.1)
Flatbuffers: builtin/3rdparty (23.1.21)

Python 3:
Interpreter: /usr/bin/python3 (ver 3.10.6)
Libraries: /usr/lib/x86_64-linux-gnu/libpython3.10.so (ver 3.10.6)
numpy: /usr/local/lib/python3.10/dist-packages/numpy/core/include (ver 1.22.4)
install path: lib/python3.10/dist-packages/cv2/python-3.10

Python (for build): /usr/bin/python3

Java:
ant: NO
JNI: /usr/lib/jvm/java-8-openjdk-amd64/include /usr/lib/jvm/java-8-openjdk-amd64/include/linux /usr/lib/jvm/java-8-openjdk-amd64/include
Java wrappers: NO
Java tests: NO

Install to: /usr/local

4.8.0 in post #1, 4.7.0-dev above
you’re not using the version you built with cuda but a previous one