Hi everyone, I have a Jetson Orin Nano Developement kit 8GB with following configurations:
I am using the following Cmake command to build opencv with CUDA support
cmake -D WITH_CUDA=ON -D WITH_CUDNN=ON -D CUDA_ARCH_BIN="8.7" -D OPENCV_GENERATE_PKGCONFIG=ON -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules -D WITH_GSTREAMER=ON -D WITH_LIBV4L=ON -D BUILD_opencv_python3=ON -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_EXAMPLES=OFF -D CMAKE_BUILD_TYPE=RELEASE -DCUDA_STANDARD=14.0 -DCUDNN_VERSION=8.9.4 -DL4T_VERSION=36.2 -DPYTHON3_EXECUTABLE=/usr/bin/python3.10 -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -D CMAKE_INSTALL_PREFIX=/usr/local ..
(PS: I am not very confident of the make tags myself)
I am getting the folllowing error while performing make:
Dumping the Cmake and make logs below
cmake_log.txt (32.0 KB)
make_log.txt (44.2 KB)
Please guide me. Thanks.
Hi,
We have an automatic script that can build OpenCV with CUDA support:
#!/bin/bash
#
# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA Corporation and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA Corporation is strictly prohibited.
#
version="4.6.0"
folder="workspace"
set -e
for (( ; ; ))
do
echo "Do you want to remove the default OpenCV (yes/no)?"
read rm_old
This file has been truncated. show original
Could you check if this works for you?
Thanks.
Hi, thanks for the response.
Nope, still getting the same make error
However , I made some edits to the scripts, changed opencv version to 4.8.0 and updates some obsolete packages
python-dev to python3-dev
libdc1394-22-dev to libdc1394-dev (depreciated after ubuntu 21)
omitted v4l2ucp (depreciated)
omitted python-numpy (python3-numpy available)
I hope none of these changes are causing the issue. (From what I can understand it seem like some error in the C++11 library)
Can you please take a look at the make error again.
Thank you.
Hi,
Thanks for the testing.
We will give it a try and update.
Hi,
It looks like you are facing the same issue as below:
opened 07:34PM - 18 Mar 23 UTC
closed 12:46PM - 22 Mar 23 UTC
bug
category: build/install
### System Information
OpenCV version: 4.7.0
Operating System / Platform: Ub… untu 22.04
Compiler & compiler version: GCC 11.3.0
nvidia-driver: 510
cuda-version: 11.6
cudnn: 8.7
### Detailed description
HI , I got this error while compiling the opencv with gpu
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_CUDA=ON -D WITH_CUDNN=ON -D WITH_CUBLAS=ON -D WITH_TBB=ON -D OPENCV_DNN_CUDA=ON -D OPENCV_ENABLE_NONFREE=ON -D CUDA_ARCH_BIN=7.5 -D OPENCV_EXTRA_MODULES_PATH=$HOME/opencv_contrib/modules -D BUILD_EXAMPLES=OFF -D HAVE_opencv_python3=ON ..
CMake Error at cuda_compile_1_generated_gpu_mat.cu.o.RELEASE.cmake:282 (message):
Error generating file
/home/ahmed/opencv/opencv-4.7.0/build/modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/./cuda_compile_1_generated_gpu_mat.cu.o
### Steps to reproduce
CMake Error at cuda_compile_1_generated_gpu_mat.cu.o.RELEASE.cmake:282 (message):
Error generating file
/home/ahmed/opencv/opencv-4.7.0/build/modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/./cuda_compile_1_generated_gpu_mat.cu.o
c)
Could you check if the WAR also works for you (degrade to G++10) ?
Thanks.
1 Like
Yes! this definitely works.
Successfully built OpenCV with CUDA
Thank you so much for your help.
aieng
March 14, 2024, 10:08pm
8
Hi @sanidhya3009
Were you building these binaries bare metal or within a docker container? If it’s a docker container, can you let me know what base image/docker run command you are using?
I am trying the same process within a docker container and using the python:3.8.18-slim-bullseye
image as the base. However even after running the container with --runtime nvidia
, it is not copying the cuda and cuDNN files into /usr/local/cuda, /usr/lib/aarch64-linux-gnu or /usr/include/aarch64-linux-gnu.
@AastaLLL your script builds fine within the container (I am using an Orin NX - Jetpack 5.1.1) but on execution of my code, it says that opencv was not built with CUDA. I tried volume mounting these directories directly into the container but it still does not work.
Any guidance would be great! Thank you.
Hi, @aieng
Since your container doesn’t build on the top of the l4t (linux4tegra) branch, it doesn’t contain the iGPU driver.
Since you don’t have GPU access within the container, the script doesn’t build OpenCV with CUDA since cmake cannot find it.
Thanks.
1 Like
system
Closed
April 10, 2024, 5:31am
11
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.