OpenCV DNN with CUDA built from source (for arch bin < 5.3)
Hello, I'm trying to use my old gaming rig (3770K + GTX780) with OpenCV for home monitoring. I'm trying to feed my camera's h264 stream into OpenCV, detect objects (people, cars, etc), determine if they're within a bounding box (a perimeter), and then feed this off to another program. I actually have this all working well. The problem is that it's extremely slow (750 ms/frame) because it's all being done in software. I determined that OpenCV's VideoCapture function seems to open ffmpeg without the ability to pass the -c:v h264_nvcuvid flag to hardware decode, but I started another thread for that.
Specifically for this one, I realized the prebuilt openCV 4.2 library does not have CUDA support. So i built from source only to find out that my GTX780 arch bin (3.5) isn't supported?? Digging more into it, seems you need a GTX10xx series of graphics card or better, seems insane to me. Digging further into it, I found here's a patch that was pulled into in 4.3. So i checked out 4.3 beta and compiled that. It's successful at compiling, but when I attempt to use DNN at all, regardless of which backend or target setting I attempt, I get the following error: terminate called after throwing an instance of 'cv::Exception'
what(): OpenCV(4.3.0-pre) /home/jonathan/Projects/opencv/opencv/modules/core/src/cuda_info.cpp:62: error: (-217:Gpu API call) system has unsupported display driver / cuda driver combination in function 'getCudaEnabledDeviceCount'
Output of my getBuildInformation(): `>>> print (cv2.getBuildInformation())
General configuration for OpenCV 4.3.0-pre ===================================== Version control: 4.2.0-506-g4cdb4652cf
Extra modules: Location (extra): /home/jonathan/Projects/opencv/opencv_contrib/modules Version control (extra): 4.2.0
Platform: Timestamp: 2020-03-21T08:28:02Z Host: Linux 5.3.0-42-generic x86_64 CMake: 3.10.2 CMake generator: Unix Makefiles CMake build tool: /usr/bin/make 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 (2 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 (1 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX AVX (5 files): + SSSE3 SSE4_1 POPCNT SSE4_2 AVX AVX2 (30 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2 AVX512_SKX (6 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 7.5.0) C++ flags (Release): -fsigned-char -ffast-math -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -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 -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow ...