2

I installed OpenCV 3.1.0 and CUDA 8.0 in Ubuntu 16.04. When I check "nvcc --version" to check the CUDA version, it is 8.0. But when I try to compile a C++ OpenCV program I get the following error:

Could NOT find CUDA: Found unsuitable version "7.5", but required 
is exact version "8.0" (found /usr/local/cuda)

So OpenCV tells it founds version 7.5 when the only installed one is 8.0. Both CUDA and OpenCV work well toguether in python with no error.

Any idea about what is happening?

talonmies
  • 70,661
  • 34
  • 192
  • 269
Raúl Gombru
  • 91
  • 1
  • 8
  • why dont you manually specify the cuda sdk directory in the Cmake config? – Balaji R Oct 14 '16 at 11:12
  • I do it, but even though it reports to find version 7.5. The only CUDA version I have installed since Ubuntu clean installation is 8.0. – Raúl Gombru Oct 14 '16 at 11:19
  • Related thread with my long answer with many solutions: https://stackoverflow.com/questions/63737492/opencv-claims-to-find-wrong-cuda-version/75080353 – Eljas Hyyrynen Jan 11 '23 at 08:50

3 Answers3

2

I had a similar issue after upgrading from CUDA 8.0 to 9.1. When I compiled my code and got error "found unsuitable version (CUDA 8.0)". In my case, it's the problem of previous cmake files. Just deleted previous files generated by cmake and then it worked fine.

Tao Hu
  • 57
  • 1
  • 9
0

Environment Variables As part of the CUDA environment, you should add the following in the .bashrc file of your home folder.

export CUDA_HOME=/usr/local/cuda-7.5 
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64 

PATH=${CUDA_HOME}/bin:${PATH} 
export PATH
Karl Gjertsen
  • 4,690
  • 8
  • 41
  • 64
0

try this:

cd /usr/local
ls -l | grep cuda

if you see something like:

lrwxrwxrwx  1 root root     9  9  4 10:08 cuda -> cuda-7.5/
drwxr-xr-x 13 root root  4096  1  5  2017 cuda-7.5
drwxr-xr-x 14 root root  4096  7 27 17:24 cuda-8.0

then:

sudo rm -rf cuda
ln -s cuda-8.0 cuda