Ask Your Question
0

Cmake - Compile problem for "Cuda" libraries

asked 2017-12-07 03:57:31 -0500

esconda gravatar image

updated 2017-12-07 04:34:48 -0500

I have developed a program using opencv 3.0 with Visual studio 2013 and nowadays I would like to convert it to Gpu based applications with Cuda.

So, I tried to compile Cmake with Cuda support.But unfortunately it does not accept specified file for Cuda.I have checke the cuda file and libraries which is available in opencv.They are all available in " C:/opencv1/opencv/sources/modules/" direction but Cmake does not see it.

Here is the 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_cufft_LIBRARY (ADVANCED)

linked by target "opencv_hal" in directory C:/opencv1/opencv/sources/modules/hal
linked by target "opencv_cudev" in directory C:/opencv1/opencv/sources/modules/cudev
linked by target "opencv_test_cudev" in directory C:/opencv1/opencv/sources/modules/cudev/test
linked by target "opencv_core" in directory C:/opencv1/opencv/sources/modules/core
linked by target "opencv_perf_core" in directory C:/opencv1/opencv/sources/modules/core
linked by target "opencv_test_core" in directory C:/opencv1/opencv/sources/modules/core
linked by target "opencv_cudaarithm" in directory C:/opencv1/opencv/sources/modules/cudaarithm
linked by target "opencv_cudaarithm" in directory C:/opencv1/opencv/sources/modules/cudaarithm
linked by target "opencv_test_cudaarithm" in directory C:/opencv1/opencv/sources/modules/cudaarithm
linked by target "opencv_perf_cudaarithm" in directory C:/opencv1/opencv/sources/modules/cudaarithm
linked by target "opencv_flann" in directory C:/opencv1/opencv/sources/modules/flann
linked by target "opencv_test_flann" in directory C:/opencv1/opencv/sources/modules/flann
linked by target "opencv_imgproc" in directory C:/opencv1/opencv/sources/modules/imgproc
linked by target "opencv_perf_imgproc" in directory C:/opencv1/opencv/sources/modules/imgproc
linked by target "opencv_test_imgproc" in directory C:/opencv1/opencv/sources/modules/imgproc
linked by target "opencv_ml" in directory C:/opencv1/opencv/sources/modules/ml
linked by target "opencv_test_ml" in directory C:/opencv1/opencv/sources/modules/ml
linked by target "opencv_video" in directory C:/opencv1/opencv/sources/modules/video
linked by target "opencv_perf_video" in directory C:/opencv1/opencv/sources/modules/video
linked by target "opencv_test_video" in directory C:/opencv1/opencv/sources/modules/video

Here is the cuda file in source direction:

image description

As you see , all cuda files are available in "C:/opencv1/opencv/sources/modules/" direction.

Any help will be appreciated.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2017-12-20 07:51:28 -0500

esconda gravatar image

updated 2017-12-20 08:00:00 -0500

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_cufft_LIBRARY (ADVANCED)

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_nppi_LIBRARY (ADVANCED)

According to given error I solved this problem changing library names of FindCuda.cmake(which is available in C:\opencv\sources\cmake\FindCUDA.cmake) for Nvdia Cuda 9.1 in related field "if (CUDA VERSION VERSION_GREATER "5.0")" as ;

find_cuda_helper_libs(nppc)
  find_cuda_helper_libs(nppial)
  find_cuda_helper_libs(nppicc)
  find_cuda_helper_libs(nppicom)
  find_cuda_helper_libs(nppidei)
  find_cuda_helper_libs(nppif)
  find_cuda_helper_libs(nppig)
  find_cuda_helper_libs(nppim)
  find_cuda_helper_libs(nppist)
  find_cuda_helper_libs(nppisu)
  find_cuda_helper_libs(nppitc)    
  set(CUDA_nppi_LIBRARY "${CUDA_nppial_LIBRARY};${CUDA_nppicc_LIBRARY};${CUDA_nppicom_LIBRARY};${CUDA_n
ppidei_LIBRARY};${CUDA_nppif_LIBRARY};${CUDA_nppig_LIBRARY};${CUDA_nppim_LIBRARY};${CUDA_nppist_LIBRARY
};${CUDA_nppisu_LIBRARY};${CUDA_nppitc_LIBRARY}")

Finally Cmake does not indicate any error related to CUDA_nppi_LIBRARY and configurations will be done succesfully.

Best regards.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2017-12-07 03:57:31 -0500

Seen: 581 times

Last updated: Dec 20 '17