Throw_no_cuda exception after run a openCV4.1.1 simple program

Dear Support,

I just successfully flashed the JetPack4.3 into the Jetson AGX Xavier. Also did good source build of OpenCV4.1.1 in the Jetson AGX Xavier as well.

But after I try to run a simple OpenCV C++ program, I got following errors.

Please keep in mind, the same program runs very well in the OpenCV3.4 in Jetson TX2.

Could you please give me the suggestions how to solve the problem for OpenCV4.1.1?

Thanks a lot
Jimmy

compile command

nvcc pkg-config --cflags opencv4 08_haar_face_gpu.cpp pkg-config --libs opencv4

error message: after good compile with no error and run a.out

terminate called after throwing an instance of ‘cv::Exception’
what(): OpenCV(4.1.1) /home/jiande/OpenCV/opencv-4.1.1/modules/core/include/opencv2/core/private.cuda.hpp:113: error: (-213:The function/feature is not implemented) The called functionality is disabled for current build or platform in function ‘throw_no_cuda’

08_haar_face_gpu.cpp

#include “opencv2/objdetect/objdetect.hpp”
#include “opencv2/highgui/highgui.hpp”
#include “opencv2/imgproc/imgproc.hpp”
#include “opencv2/cudaobjdetect.hpp”
#include
#include <stdio.h>

using namespace std;
using namespace cv;

int main( )
{
Mat h_image;
h_image = imread(“images/lena_color_512.tif”, 0);
Ptrcuda::CascadeClassifier cascade = cuda::CascadeClassifier::create(“haarcascade_frontalface_alt2.xml”);
cuda::GpuMat d_image;
cuda::GpuMat d_buf;
d_image.upload(h_image);
//cascadeGPU->setMinNeighbors(0);
//cascadeGPU->setScaleFactor(1.01);
cascade->detectMultiScale(d_image, d_buf);
std::vector detections;
cascade->convert(d_buf, detections);
if (detections.empty())
std::cout << “No detection.” << std::endl;
cvtColor(h_image,h_image,COLOR_GRAY2BGR);
for(int i = 0; i < detections.size(); ++i)
{
rectangle(h_image, detections[i], Scalar(0,255,255), 5);
}

imshow("Result image", h_image);

waitKey(0);
return 0;
}

HI jqin2014m7df9,

Have you managed to get issue resolved? Any result can be shared?

Currently I have installed OpenCV3.6 which works very well. I will try 4.11 version again to see.

Thanks

Hi @jqin2014m7df9,

You can refer to the following guide to install OpenCV with CUDA support on Jetson boards. https://developer.ridgerun.com/wiki/index.php?title=Install_OpenCV_with_CUDA_support_on_Jetson_Boards

We have seen some issues when both installations of OpenCV (SDK manager and build from sources) are in the boards. So we recommend to completely remove OpenCV version that was installed via SDK manager.

Regards,
Fabian