CMake Error: CUDA_cublas_LIBRARY (ADVANCED)

3k Views Asked by At

I am installing Opencv 4.4 from source. I am running into following error.

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CUDA_cublas_LIBRARY (ADVANCED)

I am passing the following parameters. I am using ubuntu-18.04 and CUDA = 10.1

cmake -D CMAKE_BUILD_TYPE=Release \
-D CMAKE_INSTALL_PREFIX=/usr/local 
-D INSTALL_PYTHON_EXAMPLES=ON 
-D INSTALL_C_EXAMPLES=OFF 
-D OPENCV_ENABLE_NONFREE=ON 
-D WITH_CUDA=ON 
-D WITH_CUDNN=ON 
-D OPENCV_DNN_CUDA=ON 
-D ENABLE_FAST_MATH=1 
-D CUDA_FAST_MATH=1 
-D CUDA_ARCH_BIN=7.5 
-D WITH_CUBLAS=1 
-D OPENCV_EXTRA_MODULES_PATH=/home/aniruddha/openCV_DNN/opencv_contrib/modules 
-D HAVE_opencv_python3=ON 
-D PYTHON_EXECUTABLE=~/.virtualenvs/opencv_cuda/bin/python 
-D BUILD_EXAMPLES=ON ..
2

There are 2 best solutions below

1
On

I was able to resolve this. It was simple path mismatch issue. setting proper path to cublas libraries did the trick.

0
On

I solved this by setting:

WITH_CUBLAS=0

And the opencv works well.