Ask Your Question
0

Fail to build opencv-3.3.0 with opencv_contrib-3.3.0 and CUDA Toolkit 9.0

asked 2017-10-06 11:59:05 -0600

NatanaelGS gravatar image

Hi all,

I just build opencv 3.3 from source with opencv_contrib. When I use CMake, I get this 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_nppi_LIBRARY (ADVANCED)

In the CUDA-directory i can only find : nppial.lib, nppicc.lib, nppicom.lib, nppidei.lib, nppif.lib, nppig.lib, nppist.lib nppisu.lib, nppitc.lib and npps.lib libraries but no nppi as expected.

Could you please help me how to fix this error ! I tried to fix but I was not successful :(

Thank you !

Regards ;)

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
3

answered 2017-10-10 12:12:12 -0600

mfisher gravatar image

updated 2017-10-10 12:43:08 -0600

As you have figured out, Cuda 9.0 separated the nppi library into several: nppial.lib, nppicc.lib, nppicom.lib, nppidei.lib, nppif.lib, nppig.lib, nppist.lib, nppisu.lib, and nppitc.lib.

You'll need to modify the cmake/FindCUDA.cmake file to correctly set the CUDA_nppi_LIBRARY variable to a semicolon separated string of the nppi* libraries.

Open the file and look where this variable is being set. Then add an if/else case for CUDA_VERSION 9.0 to properly set the variable. Here's what I did:

  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}")

After you do this, you will run into a few other issues building: See my post here: link text

edit flag offensive delete link more

Comments

@mfisher can you add a pull request with the suggested changes. This would help users in the future work with CUDA9

StevenPuttemans gravatar imageStevenPuttemans ( 2017-10-11 04:47:42 -0600 )edit
1

@StevenPuttermans Looks like all three issues regarding building with CUDA 9.0 have already been addressed in the main branch.

mfisher gravatar imagemfisher ( 2017-10-11 13:28:14 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-10-06 11:57:16 -0600

Seen: 4,447 times

Last updated: Oct 10 '17