Closed SaddamBInSyed closed 4 years ago
The build script you linked does not enable the CUDA backend for the DNN module.
Please try building with this script. I have added the WITH_CUDNN
and OPENCV_DNN_CUDA
to the cmake command.
@YashasSamaga Thank you for your reply. Do I need to purge the existing OpenCV lib's and install your build script? OR Is there any terminal cmd to execute these CMAKE flag's (WITH_CUDNN, OPENCV_DNN_CUDA) with existing installation? Note: In jetson nano, the OpenCV build taking around 4 hours.
please advise.
You have to purge the existing OpenCV installation and build using the script I provided. Your build time is 4 hours because you are building all the modules (even the ones you may not need). You might be able to reduce the build time by disabling the modules that you won't need.
Thank you much.
https://gist.github.com/YashasSamaga/e2b19a6807a13046e399f4bc3cca3a49
with the current installation when I try to execute your code I am getting the below error.
yolov3_opencv_dnn_cuda.cpp:9:10: fatal error: opencv2/core.hpp: No such file or directory
^~~~~~
compilation terminated.
can you please advise.
The OpenCV 4 headers are placed inside opencv4
directory. You need to use opencv4/opencv2/core.hpp
or pass -I/usr/local/include/opencv4
to your compiler. For example,
g++ main.cpp -O3 -I/usr/local/include/opencv4 -lopencv_core -lopencv_dnn
Thank you, I will try to purge the existing cv libs and then install the OpenCV master branch repo with your script and once successful I will run the Yolov3 code and I will update the status.
Scanning dependencies of target tegra_hal [ 21%] Linking CXX static library ../../lib/libtegra_hal.a [ 21%] Built target tegra_hal Scanning dependencies of target opencv_cudev make[2]: No rule to make target '/usr/lib/aarch64-linux-gnu/libGL.so', needed by 'lib/libopencv_cudev.so.4.2.0'. Stop. make[2]: Waiting for unfinished jobs.... [ 21%] Building CXX object modules/cudev/CMakeFiles/opencv_cudev.dir/src/stub.cpp.o CMakeFiles/Makefile2:2547: recipe for target 'modules/cudev/CMakeFiles/opencv_cudev.dir/all' failed make[1]: [modules/cudev/CMakeFiles/opencv_cudev.dir/all] Error 2 make[1]: Waiting for unfinished jobs.... [ 21%] Linking CXX static library ../lib/liblibprotobuf.a [ 21%] Built target libprotobuf Note: Class Feature2D has more than 1 base class (not supported by Python C extensions) Bases: cv::Algorithm, cv::class, cv::Feature2D, cv::Algorithm Only the first base class will be used Note: Class 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 [ 21%] Built target gen_opencv_python_source Makefile:162: recipe for target 'all' failed make: *** [all] Error 2
real 4m39.009s user 17m0.128s sys 0m52.252s Make did not build Retrying ... [ 3%] Built target libjasper [ 10%] Built target IlmImf [ 15%] Built target libprotobuf [ 15%] Built target quirc [ 19%] Built target carotene_objs [ 20%] Built target tegra_hal [ 20%] Built target ittnotify [ 21%] Built target ade [ 21%] Built target opencv_videoio_plugins make[2]: No rule to make target '/usr/lib/aarch64-linux-gnu/libGL.so', needed by 'lib/libopencv_cudev.so.4.2.0'. Stop. CMakeFiles/Makefile2:2547: recipe for target 'modules/cudev/CMakeFiles/opencv_cudev.dir/all' failed make[1]: [modules/cudev/CMakeFiles/opencv_cudev.dir/all] Error 2
@YashasSamaga
When I try to build your code then I am getting the below error. ( on jetson nano)
Scanning dependencies of target tegra_hal [ 21%] Linking CXX static library ../../lib/libtegra_hal.a [ 21%] Built target tegra_hal Scanning dependencies of target opencv_cudev make[2]: No rule to make target '/usr/lib/aarch64-linux-gnu/libGL.so', needed by 'lib/libopencv_cudev.so.4.2.0'. Stop. make[2]: Waiting for unfinished jobs.... [ 21%] Building CXX object modules/cudev/CMakeFiles/opencv_cudev.dir/src/stub.cpp.o CMakeFiles/Makefile2:2547: recipe for target 'modules/cudev/CMakeFiles/opencv_cudev.dir/all' failed make[1]: [modules/cudev/CMakeFiles/opencv_cudev.dir/all] Error 2 make[1]: Waiting for unfinished jobs.... [ 21%] Linking CXX static library ../lib/liblibprotobuf.a [ 21%] Built target libprotobuf Note: Class Feature2D has more than 1 base class (not supported by Python C extensions) Bases: cv::Algorithm, cv::class, cv::Feature2D, cv::Algorithm Only the first base class will be used Note: Class 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 [ 21%] Built target gen_opencv_python_source Makefile:162: recipe for target 'all' failed make: *** [all] Error 2
real 4m39.009s user 17m0.128s sys 0m52.252s Make did not build Retrying ... [ 3%] Built target libjasper [ 10%] Built target IlmImf [ 15%] Built target libprotobuf [ 15%] Built target quirc [ 19%] Built target carotene_objs [ 20%] Built target tegra_hal [ 20%] Built target ittnotify [ 21%] Built target ade [ 21%] Built target opencv_videoio_plugins make[2]: No rule to make target '/usr/lib/aarch64-linux-gnu/libGL.so', needed by 'lib/libopencv_cudev.so.4.2.0'. Stop. CMakeFiles/Makefile2:2547: recipe for target 'modules/cudev/CMakeFiles/opencv_cudev.dir/all' failed make[1]: [modules/cudev/CMakeFiles/opencv_cudev.dir/all] Error 2
please advise
I am confused. The only changes I made were adding -D WITH_CUDNN=ON -D OPENCV_DNN_CUDA=ON
. If the build script had worked before, it should still work.
Can you try the solution given here: https://devtalk.nvidia.com/default/topic/1051752/jetson-tx2/build-opencv-3-4-with-cuda-on-nvidia-jetson-tx2/post/5338614/#5338614
No rule to make target '/usr/lib/aarch64-linux-gnu/libGL.so'
@SaddamBInSyed You should check configuration flags of your build.
Inspect CMakeVars.txt / CMakeCache.txt files first. Also re-check WITH_OPENGL
(disabled by default)
To work with reproducible results, you must cleanup CMake's cache before each trial with changing of configuration flags or upgraded/installed dependencies.
Build / usage questions should go to Users OpenCV Q/A forum: http://answers.opencv.org
The OpenCV 4 headers are placed inside
opencv4
directory. You need to useopencv4/opencv2/core.hpp
or pass-I/usr/local/include/opencv4
to your compiler. For example,g++ main.cpp -O3 -I/usr/local/include/opencv4 -lopencv_core -lopencv_dnn
@YashasSamaga I have successsfully installed above advised your buildOPenCV4 script on jetson nano and when I run the "yolov3_opencv_dnn_cuda.cpp" file then I am getting the below "undefined reference" error.
please advise
g++ yolov3_opencv_dnn_cuda.cpp -O3 -I/usr/local/include/opencv4 -lopencv_core -lopencv_dnn -lopencv_imgproc
/tmp/ccBlrJl0.o: In function main': main.cpp:(.text.startup+0x228): undefined reference to
cv::VideoCapture::VideoCapture(int, int)'
main.cpp:(.text.startup+0x384): undefined reference to cv::waitKey(int)' main.cpp:(.text.startup+0x398): undefined reference to
cv::VideoCapture::operator>>(cv::Mat&)'
main.cpp:(.text.startup+0x3cc): undefined reference to cv::waitKey(int)' main.cpp:(.text.startup+0x3fc): undefined reference to
cv::VideoCapture::~VideoCapture()'
main.cpp:(.text.startup+0xf8c): undefined reference to cv::namedWindow(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)' main.cpp:(.text.startup+0xfec): undefined reference to
cv::imshow(std::__cxx11::basic_string<char, std::char_traits
after linking lib its working fine. thank you.
g++ main.cpp -O3 -I/usr/local/include/opencv4 -lopencv_core -lopencv_dnn -lopencv_imgproc -lopencv_core -lopencv_videoio -lopencv_highgui
I have successfully compiled 4.2.0 for Jetson Nano with cudnn support and I am getting the following run time error. An ideas ?
cv2 version= 4.2.0
cv2 path= /usr/local/lib/python3.6/dist-packages/cv2/python-3.6/cv2.cpython-36m-aarch64-linux-gnu.so
[INFO] setting preferable backend and target to CUDA...
[INFO] accessing video stream...
Traceback (most recent call last):
File "ssd_object_detection.py", line 76, in <module>
detections = net.forward()
cv2.error: OpenCV(4.2.0) /home/dlinano/Downloads/opencv/modules/dnn/src/dnn.cpp:1304: error: (-215:Assertion failed) preferableBackend != DNN_BACKEND_OPENCV || preferableTarget == DNN_TARGET_CPU || preferableTarget == DNN_TARGET_OPENCL || preferableTarget == DNN_TARGET_OPENCL_FP16 in function 'setUpNet'
global /tmp/build_opencv/opencv/modules/dnn/src/dnn.cpp (1363)
setUpNet DNN module was not built with CUDA backend; switching to CPU
I have just followed the instructions given above, but this is the error I am getting and moreover the external camera is not able to detect the image in the webcam frame.
Any suggestions would help me.
@SaiSandeepKantareddy Please show the CMake output. Are you using buildOpenCv.sh?
Hi,
The cv2 components are here: https://github.com/opencv/opencv/issues/17372 as printed by the source I sent you.
If you need a full listing, I can run it again tonight and send you.
My "suspicion" is that maybe my models which came from pyimagesearch are for 32 bits and maybe the Jetson cuda needs 16bits and hence the errors ?
In the link above there is also a download link for the code (that you have) and the caffee model.
Best, Mickey
From: Yashas Samaga B L notifications@github.com Sent: Tuesday, May 26, 2020 4:42:27 PM To: opencv/opencv opencv@noreply.github.com Cc: tadam98 tadam_98@hotmail.com; Mention mention@noreply.github.com Subject: Re: [opencv/opencv] Compiling Opencv 4.2.0 + CUDA on jetson nano board (#16439)
@SaiSandeepKantareddyhttps://github.com/SaiSandeepKantareddy Please show the CMake output. Are you using buildOpenCv.sh?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/opencv/opencv/issues/16439#issuecomment-634032799, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFBMCT2OXFOB2DBCOGTJG3DRTPBMHANCNFSM4KLW76EA.
@tadam98 The code you sent is working on my computer. Are you sure that your locally built OpenCV 4.2 is being used instead of the OpenCV 4.1.2? (try printing cv2.__version__
)
Hi,
Yes, it is working on a pc. The problem is on the jetson nano.
The printout in the github link i gave you was PRINTED BY THE PROGRAM ITSELF showing what the program sees in the cv2 library it is actually using. (See the 3rd print in the source from me, not the dowloaded one from phimagesearch)
Thus i am 100% certain it is using 4.2.0, with CUDA 10.2 and with cuDNN 8.0. (due to cuda 10.2 i had to correct cmake/FindCUDNN.cmake. Correcrions that worked well)
Before compiling the OpenCV 4.2.0 i did make uninstall and then a deep search after any remaining files of 4.1.2 and removed all. Including the 4.1.2 downloaded zips and compilation folders.
Best, Mickey
From: Yashas Samaga B L notifications@github.com Sent: Tuesday, May 26, 2020 6:33:40 PM To: opencv/opencv opencv@noreply.github.com Cc: tadam98 tadam_98@hotmail.com; Mention mention@noreply.github.com Subject: Re: [opencv/opencv] Compiling Opencv 4.2.0 + CUDA on jetson nano board (#16439)
@tadam98https://github.com/tadam98 The code you sent is working on my computer. Are you sure that your locally built OpenCV 4.2 is being used instead of the OpenCV 4.1.2? (try printing cv2.version)
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/opencv/opencv/issues/16439#issuecomment-634100898, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFBMCT7XPCSJJMPDLMQLSH3RTPONJANCNFSM4KLW76EA.
CV_Assert(preferableBackend != DNN_BACKEND_OPENCV ||
preferableTarget == DNN_TARGET_CPU ||
preferableTarget == DNN_TARGET_OPENCL ||
preferableTarget == DNN_TARGET_OPENCL_FP16);
is the assertion that was triggered.
The only way this can be triggered is if the backend is set to DNN_BACKEND_OPENCV
. What are the arguments you are passing to the script?
I was expecting to see a message that said OpenCV DNN had switched to CPU due to the unavailability of the CUDA backend. I don't see it. Can you try export OPENCV_LOG_LEVEL=INFO
in the terminal where you run the python script?
During run time is what I sent you with the parameters to the models that come in the zip. It is identical to the instructions on their website.
From: Yashas Samaga B L notifications@github.com Sent: Tuesday, May 26, 2020 7:13:48 PM To: opencv/opencv opencv@noreply.github.com Cc: tadam98 tadam_98@hotmail.com; Mention mention@noreply.github.com Subject: Re: [opencv/opencv] Compiling Opencv 4.2.0 + CUDA on jetson nano board (#16439)
CV_Assert(preferableBackend != DNN_BACKEND_OPENCV || preferableTarget == DNN_TARGET_CPU || preferableTarget == DNN_TARGET_OPENCL || preferableTarget == DNN_TARGET_OPENCL_FP16);
is the assertion that was triggered.
The only way this can be triggered is if the backend is set to DNN_BACKEND_OPENCV. What are the arguments you are passing to the script?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/opencv/opencv/issues/16439#issuecomment-634125057, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFBMCT65JKOQEA72A4MAQCTRTPTDZANCNFSM4KLW76EA.
A command line parameter allows selection between use gpu or not. I tries both. So the problem is not with the gpu.
I will be by my pc in ah hour and will send you.
From: Yashas Samaga B L notifications@github.com Sent: Tuesday, May 26, 2020 7:19:02 PM To: opencv/opencv opencv@noreply.github.com Cc: tadam98 tadam_98@hotmail.com; Mention mention@noreply.github.com Subject: Re: [opencv/opencv] Compiling Opencv 4.2.0 + CUDA on jetson nano board (#16439)
I was expecting to see a message that said OpenCV DNN had switched to CPU due to the unavailability of the CUDA backend. I don't see it. Can you try export OPENCV_LOG_LEVEL=INFO in the terminal where you run the python script?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/opencv/opencv/issues/16439#issuecomment-634127941, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFBMCT4MFAIZ7ZUJM2XPFSLRTPTXNANCNFSM4KLW76EA.
@SaiSandeepKantareddy Please show the CMake output. Are you using buildOpenCv.sh?
cuDNN : NO , but in your cmake file cuDNN is ON, but the system is not able to find the version required remaining all other say yes.
I suspect this could be a potential problem causer?
This is the runtime error:
[INFO] setting preferable backend and target to CUDA...
[INFO] accessing video stream...
**Traceback (most recent call last):
File "ssd_object_detection.py", line 77, in <module>
detections = net.forward()
cv2.error: OpenCV(4.2.0) /home/dlinano/Downloads/opencv/modules/dnn/src/dnn.cpp:1304: error: (-215:Assertion failed) preferableBackend != DNN_BACKEND_OPENCV || preferableTarget == DNN_TARGET_CPU || preferableTarget == DNN_TARGET_OPENCL || preferableTarget == DNN_TARGET_OPENCL_FP16 in function 'setUpNet'**
This is the OpenCV configuration as printed from the program itself at run time. So this is the opencv being used.
See below: ** NVIDIA CUDA: YES (ver 10.2, CUFFT CUBLAS FAST_MATH) NVIDIA GPU arch: 53 62 72 NVIDIA PTX archs:
cuDNN: YES (ver 8.0.0) **
Maybe the error is because of: Baseline: NEON FP16 in case the model is for 32bits and the engine is 16 bits?
I think there is no doubt that the OpenCV has CUDA and has cuDNN.
cv2 version= 4.2.0
cv2 path= /usr/local/lib/python3.6/dist-packages/cv2/python-3.6/cv2.cpython-36m-aarch64-linux-gnu.so
cv2 Build Information=
General configuration for OpenCV 4.2.0 =====================================
Version control: unknown
Extra modules:
Location (extra): /home/dlinano/Downloads/opencv_contrib/modules
Version control (extra): unknown
Platform:
Timestamp: 2020-05-25T21:07:56Z
Host: Linux 4.9.140-tegra aarch64
CMake: 3.10.2
CMake generator: Unix Makefiles
CMake build tool: /usr/bin/make
Configuration: RELEASE
CPU/HW features:
Baseline: NEON FP16
required: NEON
disabled: VFPV3
C/C++:
Built as dynamic libs?: YES
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 -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -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 -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG
C Compiler: /usr/bin/cc
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 -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -fvisibility=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 -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG
Linker flags (Release): -Wl,--gc-sections
Linker flags (Debug): -Wl,--gc-sections
ccache: NO
Precompiled headers: NO
Extra dependencies: m pthread cudart_static -lpthread dl rt nppc nppial nppicc nppicom nppidei nppif nppig nppim nppist nppisu nppitc npps cublas cudnn cufft -L/usr/local/cuda/lib64 -L/usr/lib/aarch64-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 hdf hfs highgui img_hash imgcodecs imgproc line_descriptor ml objdetect optflow phase_unwrapping photo plot python3 quality reg rgbd saliency sfm shape stereo stitching structured_light superres surface_matching text tracking video videoio videostab xfeatures2d ximgproc xobjdetect xphoto
Disabled: python2 world
Disabled by dependency: -
Unavailable: cnn_3dobj cvv java js matlab ovis ts viz
Applications: examples apps
Documentation: NO
Non-free algorithms: YES
GUI:
GTK+: YES (ver 3.22.30)
GThread : YES (ver 2.56.4)
GtkGlExt: NO
OpenGL support: NO
VTK support: NO
Media I/O:
ZLib: /usr/lib/aarch64-linux-gnu/libz.so (ver 1.2.11)
JPEG: /usr/lib/aarch64-linux-gnu/libjpeg.so (ver 80)
WEBP: build (ver encoder: 0x020e)
PNG: /usr/lib/aarch64-linux-gnu/libpng.so (ver 1.6.34)
TIFF: /usr/lib/aarch64-linux-gnu/libtiff.so (ver 42 / 4.0.9)
JPEG 2000: build (ver 1.900.1)
OpenEXR: build (ver 2.3.0)
HDR: YES
SUNRASTER: YES
PXM: YES
PFM: YES
Video I/O:
DC1394: YES (2.2.5)
FFMPEG: YES
avcodec: YES (57.107.100)
avformat: YES (57.83.100)
avutil: YES (55.78.100)
swscale: YES (4.8.100)
avresample: YES (3.7.0)
GStreamer: YES (1.14.5)
v4l/v4l2: YES (linux/videodev2.h)
Parallel framework: pthreads
Trace: YES (with Intel ITT)
Other third-party libraries:
Lapack: NO
Eigen: YES (ver 3.3.4)
Custom HAL: YES (carotene (ver 0.0.1))
Protobuf: build (3.5.1)
NVIDIA CUDA: YES (ver 10.2, CUFFT CUBLAS FAST_MATH)
NVIDIA GPU arch: 53 62 72
NVIDIA PTX archs:
cuDNN: YES (ver 8.0.0)
OpenCL: YES (no extra features)
Include path: /home/dlinano/Downloads/opencv/3rdparty/include/opencl/1.2
Link libraries: Dynamic load
Python 3:
Interpreter: /usr/bin/python3 (ver 3.6.9)
Libraries: /usr/lib/aarch64-linux-gnu/libpython3.6m.so (ver 3.6.9)
numpy: /usr/lib/python3/dist-packages/numpy/core/include (ver 1.13.3)
install path: lib/python3.6/dist-packages/cv2/python-3.6
Python (for build): /usr/bin/python2.7
Java:
ant: NO
JNI: NO
Java wrappers: NO
Java tests: NO
Install to: /usr/local
-----------------------------------------------------------------
@SaiSandeepKantareddy That's defnitely the problem. You need WITH_CUDA
, WITH_CUDNN
, WITH_CUBLAS
and OPENCV_DNN_CUDA` set. Looking for lines that say "filtering out cuda4dnn source" in your CMake output. If you see this, it implies that the CUDA backend is not being built.
@tadam98 The assertion that is being triggered can only be triggered if the backend is set to DNN_BACKEND_OPENCV
. If you're trying to use the GPU, the script should have set the backend to DNN_BACKEND_CUDA
and that assertion shouldn't have been triggered at all.
See attached traces.
Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10
From: Yashas Samaga B Lmailto:notifications@github.com Sent: 27 May 2020 11:25 To: opencv/opencvmailto:opencv@noreply.github.com Cc: tadam98mailto:tadam_98@hotmail.com; Mentionmailto:mention@noreply.github.com Subject: Re: [opencv/opencv] Compiling Opencv 4.2.0 + CUDA on jetson nano board (#16439)
@SaiSandeepKantareddyhttps://github.com/SaiSandeepKantareddy That's defnitely the problem. You need WITH_CUDA, WITH_CUDNN, WITH_CUBLAS and OPENCV_DNN_CUDA` set. Looking for lines that say "filtering out cuda4dnn source" in your CMake output. If you see this, it implies that the CUDA backend is not being built.
@tadam98https://github.com/tadam98 The assertion that is being triggered can only be triggered if the backend is set to DNN_BACKEND_OPENCV. If you're trying to use the GPU, the script should have set the backend to DNN_BACKEND_CUDA and that assertion shouldn't have been triggered at all.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/opencv/opencv/issues/16439#issuecomment-634509466, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFBMCT2NM2765QYPLTUJJODRTTE7TANCNFSM4KLW76EA.
@tadam98 I don't see any attachment in mail nor on GitHub. Maybe GitHub doesn't support attachments via mail.
https://drive.google.com/folderview?id=1rotEOktKAFdQZhGJPr224A6aFpnZ3ubK
Try my google drive.
From: Yashas Samaga B L notifications@github.com Sent: Wednesday, May 27, 2020 5:05:45 PM To: opencv/opencv opencv@noreply.github.com Cc: tadam98 tadam_98@hotmail.com; Mention mention@noreply.github.com Subject: Re: [opencv/opencv] Compiling Opencv 4.2.0 + CUDA on jetson nano board (#16439)
@tadam98https://github.com/tadam98 I don't see any attachment in mail nor on GitHub. Maybe GitHub doesn't support attachments via mail.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/opencv/opencv/issues/16439#issuecomment-634683775, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFBMCT2S7WBGPS7TJ2JLBRTRTUM3TANCNFSM4KLW76EA.
Cmake trace
-- Detected processor: aarch64
-- Looking for ccache - not found
-- Found ZLIB: /usr/lib/aarch64-linux-gnu/libz.so (found suitable version "1.2.11", minimum required is "1.2.3")
-- Could NOT find Jasper (missing: JASPER_LIBRARIES JASPER_INCLUDE_DIR)
-- Found ZLIB: /usr/lib/aarch64-linux-gnu/libz.so (found version "1.2.11")
-- TBB: Download: v2020.0.tar.gz
-- CUDA detected: 10.2
-- CUDA NVCC target flags: -gencode;arch=compute_53,code=sm_53;-gencode;arch=compute_62,code=sm_62;-gencode;arch=compute_72,code=sm_72;-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)
-- A library with BLAS API found.
-- A library with LAPACK API found.
-- Could NOT find JNI (missing: JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
-- Could NOT find Pylint (missing: PYLINT_EXECUTABLE)
-- Could NOT find Flake8 (missing: FLAKE8_EXECUTABLE)
-- VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file
-- OpenCV Python: during development append to PYTHONPATH: /home/dlinano/Downloads/opencv/build/python_loader
-- Caffe: NO
-- Protobuf: NO
-- Glog: YES
-- freetype2: YES (ver 21.0.15)
-- harfbuzz: YES (ver 1.7.2)
-- HDF5: Using hdf5 compiler wrapper to determine C configuration
-- 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.
-- Found installed version of gflags: /usr/lib/aarch64-linux-gnu/cmake/gflags
-- Detected gflags version: 2.2.1
-- Checking SFM deps... TRUE
-- CERES support is disabled. Ceres Solver for reconstruction API is required.
-- Checking for module 'tesseract'
-- No package 'tesseract' found
-- Tesseract: NO
-- HDF5: Using hdf5 compiler wrapper to determine C configuration
-- Excluding from source files list: modules/imgproc/src/corner.avx.cpp
-- Excluding from source files list: modules/imgproc/src/imgwarp.avx2.cpp
-- Excluding from source files list: modules/imgproc/src/imgwarp.sse4_1.cpp
-- Excluding from source files list: modules/imgproc/src/resize.avx2.cpp
-- Excluding from source files list: modules/imgproc/src/resize.sse4_1.cpp
-- Excluding from source files list: modules/imgproc/src/sumpixels.avx512_skx.cpp
-- Registering hook 'INIT_MODULE_SOURCES_opencv_dnn': /home/dlinano/Downloads/opencv/modules/dnn/cmake/hooks/INIT_MODULE_SOURCES_opencv_dnn.cmake
-- Excluding from source files list: <BUILD>/modules/dnn/layers/layers_common.avx.cpp
-- Excluding from source files list: <BUILD>/modules/dnn/layers/layers_common.avx2.cpp
-- Excluding from source files list: <BUILD>/modules/dnn/layers/layers_common.avx512_skx.cpp
-- Excluding from source files list: modules/features2d/src/fast.avx2.cpp
-- 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.
-- Found installed version of gflags: /usr/lib/aarch64-linux-gnu/cmake/gflags
-- Detected gflags version: 2.2.1
-- Checking SFM deps... TRUE
-- CERES support is disabled. Ceres Solver for reconstruction API is required.
-- OpenCL samples are skipped: OpenCL SDK is required
--
-- General configuration for OpenCV 4.2.0 =====================================
-- Version control: unknown
--
-- Extra modules:
-- Location (extra): /home/dlinano/Downloads/opencv_contrib/modules
-- Version control (extra): unknown
--
-- Platform:
-- Timestamp: 2020-05-25T21:07:56Z
-- Host: Linux 4.9.140-tegra aarch64
-- CMake: 3.10.2
-- CMake generator: Unix Makefiles
-- CMake build tool: /usr/bin/make
-- Configuration: RELEASE
--
-- CPU/HW features:
-- Baseline: NEON FP16
-- required: NEON
-- disabled: VFPV3
--
-- C/C++:
-- Built as dynamic libs?: YES
-- 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 -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -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 -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG
-- C Compiler: /usr/bin/cc
-- 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 -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -fvisibility=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 -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG
-- Linker flags (Release): -Wl,--gc-sections
-- Linker flags (Debug): -Wl,--gc-sections
-- ccache: NO
-- Precompiled headers: NO
-- Extra dependencies: m pthread cudart_static -lpthread dl rt nppc nppial nppicc nppicom nppidei nppif nppig nppim nppist nppisu nppitc npps cublas cudnn cufft -L/usr/local/cuda/lib64 -L/usr/lib/aarch64-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 hdf hfs highgui img_hash imgcodecs imgproc line_descriptor ml objdetect optflow phase_unwrapping photo plot python3 quality reg rgbd saliency sfm shape stereo stitching structured_light superres surface_matching text tracking video videoio videostab xfeatures2d ximgproc xobjdetect xphoto
-- Disabled: python2 world
-- Disabled by dependency: -
-- Unavailable: cnn_3dobj cvv java js matlab ovis ts viz
-- Applications: examples apps
-- Documentation: NO
-- Non-free algorithms: YES
--
-- GUI:
-- GTK+: YES (ver 3.22.30)
-- GThread : YES (ver 2.56.4)
-- GtkGlExt: NO
-- OpenGL support: NO
-- VTK support: NO
--
-- Media I/O:
-- ZLib: /usr/lib/aarch64-linux-gnu/libz.so (ver 1.2.11)
-- JPEG: /usr/lib/aarch64-linux-gnu/libjpeg.so (ver 80)
-- WEBP: build (ver encoder: 0x020e)
-- PNG: /usr/lib/aarch64-linux-gnu/libpng.so (ver 1.6.34)
-- TIFF: /usr/lib/aarch64-linux-gnu/libtiff.so (ver 42 / 4.0.9)
-- JPEG 2000: build (ver 1.900.1)
-- OpenEXR: build (ver 2.3.0)
-- HDR: YES
-- SUNRASTER: YES
-- PXM: YES
-- PFM: YES
--
-- Video I/O:
-- DC1394: YES (2.2.5)
-- FFMPEG: YES
-- avcodec: YES (57.107.100)
-- avformat: YES (57.83.100)
-- avutil: YES (55.78.100)
-- swscale: YES (4.8.100)
-- avresample: YES (3.7.0)
-- GStreamer: YES (1.14.5)
-- v4l/v4l2: YES (linux/videodev2.h)
--
-- Parallel framework: pthreads
--
-- Trace: YES (with Intel ITT)
--
-- Other third-party libraries:
-- Lapack: NO
-- Eigen: YES (ver 3.3.4)
-- Custom HAL: YES (carotene (ver 0.0.1))
-- Protobuf: build (3.5.1)
--
-- NVIDIA CUDA: YES (ver 10.2, CUFFT CUBLAS FAST_MATH)
-- NVIDIA GPU arch: 53 62 72
-- NVIDIA PTX archs:
--
-- cuDNN: YES (ver 8.0.0)
--
-- OpenCL: YES (no extra features)
-- Include path: /home/dlinano/Downloads/opencv/3rdparty/include/opencl/1.2
-- Link libraries: Dynamic load
--
-- Python 3:
-- Interpreter: /usr/bin/python3 (ver 3.6.9)
-- Libraries: /usr/lib/aarch64-linux-gnu/libpython3.6m.so (ver 3.6.9)
-- numpy: /usr/lib/python3/dist-packages/numpy/core/include (ver 1.13.3)
-- install path: lib/python3.6/dist-packages/cv2/python-3.6
--
-- Python (for build): /usr/bin/python2.7
--
-- Java:
-- ant: NO
-- JNI: NO
-- Java wrappers: NO
-- Java tests: NO
--
-- Install to: /usr/local
-- -----------------------------------------------------------------
--
-- Configuring done
-- Generating done
-- Build files have been written to: /home/dlinano/Downloads/opencv/build
@SaiSandeepKantareddy That's defnitely the problem. You need
WITH_CUDA
,WITH_CUDNN
,WITH_CUBLAS
and OPENCV_DNN_CUDA` set. Looking for lines that say "filtering out cuda4dnn source" in your CMake output. If you see this, it implies that the CUDA backend is not being built.@tadam98 The assertion that is being triggered can only be triggered if the backend is set to
DNN_BACKEND_OPENCV
. If you're trying to use the GPU, the script should have set the backend toDNN_BACKEND_CUDA
and that assertion shouldn't have been triggered at all.
Okay, so what's the answer for it and how should I do get rid of the error on jetson nano?
Hi,
I have these flags on my cmake command line. I do not see the filtering out in the above trace I provided.
Did I miss anything ?
WITH_CUDA, WITH_CUDNN, WITH_CUBLAS and OPENCV_DNN_CUDA` set. Looking for lines that say "filtering out cuda4dnn source" in your CMake output. If you see this, it implies that the CUDA backend is not being built.
This is my cmake run:
$ cmake \
-D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D WITH_CUDA=ON \
-D WITH_CUDNN=ON \
-D OPENCV_DNN_CUDA=ON \
-D ENABLE_FAST_MATH=ON \
-D CUDA_FAST_MATH=ON \
-D CUDA_ARCH_PTX="" \
-D CUDA_ARCH_BIN="5.3,6.2,7.2" \
-D WITH_CUBLAS=ON \
-D WITH_LIBV4L=ON \
-D WITH_V4L=ON \
-D WITH_QT=OFF \
-D WITH_OPENGL=ON \
-D BUILD_opencv_python3=ON \
-D BUILD_opencv_python2=OFF \
-D BUILD_opencv_java=OFF \
-D WITH_FFMPEG=ON \
-D WITH_GSTREAMER=ON \
-D OPENCV_GENERATE_PKGCONFIG=ON \
-D WITH_TBB=ON \
-D BUILD_TBB=ON \
-D WITH_GTK=ON \
-D BUILD_TESTS=OFF \
-D BUILD_PERF_TESTS=OFF \
-D BUILD_EXAMPLES=ON \
-D OPENCV_ENABLE_NONFREE=ON \
-D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \
..
@tadam98 There are two conversations happening simultaneously in this issue. I am replying to two people. I don't know if you can see this in the mail.
@tadam98 Do this and report what happens (on Jetson Nano):
OPENCV_LOG_LEVEL=INFO
and run the script in the same terminal. Report what you get on the terminal output.As I told earlier, the assertion that fails can only happen when DNN_BACKEND_OPENCV
is being used. We need to figure out why it's happening.
@SaiSandeepKantareddy Do you also have cuDNN 8?
Hi,
Yes, cuDNN 8.0 is installed as part of NVIDIA Jetson JetPack DP 4.4. (DP=Developer pack). I have used sdkmanager in CLI mode to ensure my image is “by the book” and it is. (sdkmanager in gui mode does not come up with the Jetson Nano only with the Jetson Xavier)
cuDNN is installed and found by the OpenCV cmake. It is found after a modification to cmake\FindCUDNN.cmake file because in CUDA 10.2 the cudnn version is not anymore in cudnn.h but moved to cudnn_version.h. The is also a problematic SET command that is not generation the correct version code. I did not dive into it, just changed it to work.
if(CUDNN_INCLUDE_DIR) file(READ "${CUDNN_INCLUDE_DIR}/cudnn_version.h" CUDNN_H_CONTENTS)
set(CUDNN_VERSION "${CUDNN_MAJOR_VERSION}.${CUDNN_MINOR_VERSION}.${CUDNN_PATCH_VERSION}")
Command line parameters (in a runme file): python3 ssd_object_detection.py \ --prototxt MobileNetSSD_deploy.prototxt \ --model MobileNetSSD_deploy.caffemodel \ --input guitar.mp4 --output output.avi \ --display 0 --use-gpu 1
Log level output:
dlinano@dlinano:~/Downloads/pyimagesearch/opencv-dnn-gpu$ export OPENCV_LOG_LEVEL=INFO
dlinano@dlinano:~/Downloads/pyimagesearch/opencv-dnn-gpu$ ./runme
cv2 version= 4.2.0
cv2 path= /usr/local/lib/python3.6/dist-packages/cv2/python-3.6/cv2.cpython-36m-aarch64-linux-gnu.so
Traceback (most recent call last):
File "ssd_object_detection.py", line 43, in
dlinano@dlinano:~/Downloads/pyimagesearch/opencv-dnn-gpu$
Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10
From: Yashas Samaga B Lmailto:notifications@github.com Sent: 28 May 2020 09:04 To: opencv/opencvmailto:opencv@noreply.github.com Cc: tadam98mailto:tadam_98@hotmail.com; Mentionmailto:mention@noreply.github.com Subject: Re: [opencv/opencv] Compiling Opencv 4.2.0 + CUDA on jetson nano board (#16439)
@tadam98https://github.com/tadam98 There are two conversations happening simultaneously in this issue. I am replying to two people. I don't know if you can see this in the mail.
@tadam98https://github.com/tadam98 Do this and report what happens (on Jetson Nano):
As I told earlier, the assertion that fails can only happen when DNN_BACKEND_OPENCV is being used. We need to figure out why it's happening.
@SaiSandeepKantareddyhttps://github.com/SaiSandeepKantareddy Do you also have cuDNN 8?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/opencv/opencv/issues/16439#issuecomment-635124913, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFBMCTZ327BYVXPJUF4QTN3RTX5IBANCNFSM4KLW76EA.
I ran it again from the command line as the export may have not applied when I used the batch file.
dlinano@dlinano:~/Downloads/pyimagesearch/opencv-dnn-gpu$ python3 ssd_object_detection.py \
> --prototxt MobileNetSSD_deploy.prototxt \
> --model MobileNetSSD_deploy.caffemodel \
> --input guitar.mp4 --output output.avi \
> --display 0 --use-gpu 1
cv2 version= 4.2.0
cv2 path= /usr/local/lib/python3.6/dist-packages/cv2/python-3.6/cv2.cpython-36m-aarch64-linux-gnu.so
Traceback (most recent call last):
File "ssd_object_detection.py", line 43, in <module>
net = cv2.dnn.readNetFromTensorflow(args["model"],args["prototxt"])
cv2.error: OpenCV(4.2.0) /home/dlinano/Downloads/opencv/modules/dnn/src/tensorflow/tf_io.cpp:42: error: (-2:Unspecified error) FAILED: ReadProtoFromBinaryFile(param_file, param). Failed to parse GraphDef file: MobileNetSSD_deploy.caffemodel in function 'ReadTFNetParamsFromBinaryFileOrDie'
dlinano@dlinano:~/Downloads/pyimagesearch/opencv-dnn-gpu$
@tadam98 There are two conversations happening simultaneously in this issue. I am replying to two people. I don't know if you can see this in the mail.
@tadam98 Do this and report what happens (on Jetson Nano):
1. export `OPENCV_LOG_LEVEL=INFO` and run the script in the same terminal. Report what you get on the terminal output. 2. What arguments did you pass to the python script?
As I told earlier, the assertion that fails can only happen when
DNN_BACKEND_OPENCV
is being used. We need to figure out why it's happening.@SaiSandeepKantareddy Do you also have cuDNN 8?
I have installed Jetson pack 4.4 and it says it contains cuDNN but I am not able to find, I think @tadam98 has rightly pointed about the error in his previous comments about cudnn_version.h
Correct. You must change OpenCV/cmake/FindCUDNN.cmake as I described in earlier posts. The corrections are needed because NVIDIA changed the location of the header files in cuda 10.2 which is part of Jetpack DP4.4.
Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10
From: SaiSandeepKantareddymailto:notifications@github.com Sent: 28 May 2020 15:36 To: opencv/opencvmailto:opencv@noreply.github.com Cc: tadam98mailto:tadam_98@hotmail.com; Mentionmailto:mention@noreply.github.com Subject: Re: [opencv/opencv] Compiling Opencv 4.2.0 + CUDA on jetson nano board (#16439)
@tadam98https://github.com/tadam98 There are two conversations happening simultaneously in this issue. I am replying to two people. I don't know if you can see this in the mail.
@tadam98https://github.com/tadam98 Do this and report what happens (on Jetson Nano):
export OPENCV_LOG_LEVEL=INFO
and run the script in the same terminal. Report what you get on the terminal output.
What arguments did you pass to the python script?
As I told earlier, the assertion that fails can only happen when DNN_BACKEND_OPENCV is being used. We need to figure out why it's happening.
@SaiSandeepKantareddyhttps://github.com/SaiSandeepKantareddy Do you also have cuDNN 8?
I have installed Jetson pack 4.4 and it says it contains cuDNN but I am not able to find, I think @tadam98https://github.com/tadam98 has rightly pointed about the error in his previous comments about cudnn_version.h
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/opencv/opencv/issues/16439#issuecomment-635323151, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFBMCT7OO23XRR7MIKN74UDRTZLELANCNFSM4KLW76EA.
@SaiSandeepKantareddy Please have a look at #17238. NVIDIA hasn't released the documentation or release notes for cuDNN 8. We don't know for sure how exactly the new cuDNN 8 structures the headers and binaries. The fix might be a bit more complicated based on the comments in the aforementioned PR.
Actually, it is working on jetson pack 4.3
On Thu, 28 May 2020, 18:49 Yashas Samaga B L, notifications@github.com wrote:
@SaiSandeepKantareddy https://github.com/SaiSandeepKantareddy Please have a look at #17238 https://github.com/opencv/opencv/pull/17238. NVIDIA hasn't released the documentation or release notes for cuDNN 8. We don't know for sure how exactly the new cuDNN 8 structures the headers and binaries. The fix might be a bit more complicated based on the comments in the aforementioned PR.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/opencv/opencv/issues/16439#issuecomment-635345054, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD3UKTK5IBCJUOENY7RQ3ILRTZQGNANCNFSM4KLW76EA .
Hi,
I can confirm a successful compilation of OpenCV 4.2.0 with CUDA (10.0) and cuDNN (7.6.3) that come with JetPack 4.3 with my software. Backend support is there and working.
NVIDIA - do something about Jetpack DP4.4 and libcudnn.so.8 and also put OpenCV 4.2.0 rather than old versions compiled without any cuda or cudnn support.
Hi, I have a question about opencv dnn use cuda for forward.
Hey YashasSamaga
I've tried running your script, on the latest Jetson Nano .img release with JP4.4.1, and I am getting an error regarding openGL, saying that it is deprecated. I am not quite sure how to pull that part out of your script.
Best regards ddwnbe
@ddwnbe
-D WITH_OPENGL=ON
sudo patch -N cuda_gl_interop.h $WHEREAMI'/patches/OpenGLHeader.patch'
@YashasSamaga Thanks for you reply, it worked. I apparently removed a line too much of the script, when I initially ran it with those two lines removed
Hi. I have carefully followed the below link in order to install the OpenCV with CUDA support on the jetson nano board. but after a successful compile and I run my yolov3 object detection code BUT the application is still running on CPU only instead of GPU. https://github.com/JetsonHacksNano/buildOpenCV/blob/master/buildOpenCV.sh
Since I am a beginner I was struggling to configure my code to run/use GPU so that I can get better FPS compared to CPU.
please help me, anyone, to get rid of this issue and share the updated procedure to compile OpenCV with CUDA support on jetson nano.
I believe this post will surely help a lot of users since there is no updated information on the internet about compiling the installing OpenCV 4.2.0/master branch version into the jetson nano board.
note: I have run the Gpu graph app to check GPU usage percentage.