OpenCV Error: No GPU support (The library is compiled without CUDA support)

asked 2017-01-08 19:20:41 -0600

LXJ gravatar image

I built Opencv 2.4.13 on my device,Ubuntu 16.04 with CUDA 8.0 ,and I tried to run the sample itself.But it has a new err:

ubuntu@tegra-ubuntu:~/Downloads/opencv-2.4.13/samples/gpu$ g++ hog.cpp -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_calib3d -lopencv_contrib -lopencv_features2d -lopencv_flann -lopencv_gpu -lopencv_legacy -lopencv_ml -lopencv_nonfree -lopencv_objdetect -lopencv_photo -lopencv_stitching -lopencv_superres -lopencv_video -lopencv_videostab -o hog
ubuntu@tegra-ubuntu:~/Downloads/opencv-2.4.13/samples/gpu$ ./hog --video 768x576.avi 
OpenCV Error: No GPU support (The library is compiled without CUDA support) in getDevice, file /build/opencv-1FgmX3/opencv-2.4.9.1+dfsg/modules/dynamicuda/include/opencv2/dynamicuda/dynamicuda.hpp, line 85
error: /build/opencv-1FgmX3/opencv-2.4.9.1+dfsg/modules/dynamicuda/include/opencv2/dynamicuda/dynamicuda.hpp:85: error: (-216) The library is compiled without CUDA support in function getDevice

But before I make it,I have added follow command in cmake:

cmake -D WITH_CUDA=ON -D CUDA_ARCH_BIN="5.3" -D CUDA_ARCH_PTX="" -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=OFF -D CUDA_FAST_MATH=ON ..

Is there any err ? I don't understand. Anyone can help me ?

edit retag flag offensive close merge delete