After a fresh install of jetpack on my tk1 board I found myself unable to use opencv’s gpu calls. I’m using opencv 2.4.12
OpenCV Error: Gpu API call (CUDA driver version is insufficient for CUDA runtime version) in copy, file /hdd/buildbot/slave_jetson_tx_2/35-O4T-L4T-Jetson-L/opencv/modules/dynamicuda/include/opencv2/dynamicuda/dynamicuda.hpp, line 877
Error: /hdd/buildbot/slave_jetson_tx_2/35-O4T-L4T-Jetson-L/opencv/modules/dynamicuda/include/opencv2/dynamicuda/dynamicuda.hpp:877: error: (-217) CUDA driver version is insufficient for CUDA runtime version in function copy
nvcc -V
ubuntu@tegra-ubuntu:~$ nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2014 NVIDIA Corporation
Built on Wed_Nov_12_15:57:57_CST_2014
Cuda compilation tools, release 6.5, V6.5.30
.bashrc
# Add CUDA bin & library paths:
export PATH=/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
# Add CUDA bin & library paths:
export PATH=/usr/local/cuda/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
export LD_LIBRARY_PATH=/usr/local/cuda/lib:
NOTE: I installed cuda 7.0 before and without installing it I simply installed the deb file with the 6.5. The nvcc -V shows I’m using 6.5 but could it possibly still be using the 7.0?
Here is what I’m trying to compile
#include <iostream>
#include "opencv2/opencv.hpp"
#include "opencv2/gpu/gpu.hpp"
int main (int argc, char* argv[])
{
try
{
cv::Mat src_host = cv::imread("file.png", CV_LOAD_IMAGE_GRAYSCALE);
cv::gpu::GpuMat dst, src;
src.upload(src_host);
cv::gpu::threshold(src, dst, 128.0, 255.0, CV_THRESH_BINARY);
cv::Mat result_host(dst);
cv::imshow("Result", result_host);
cv::waitKey();
}
catch(const cv::Exception& ex)
{
std::cout << "Error: " << ex.what() << std::endl;
}
return 0;
}