Reputation: 43
I'm trying to install OpenCV 3.3.0 with contrib modules using the newest CUDA 9.0 RC so it is compatible with Microsoft Visual Studio 2017. The CUDA installation was straightforward and successfully integrated into VS 2017. I'm operating according to various instructions online which allowed me to successfully build the contrib modules without CUDA before.
When I run CMake, however (ensuring that I set it to VS 2017 x64, see: CMake: CUDA libraries not found when compiling OpenCV), I get the classic:
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):
linked by target...
This is not the x64 issue as posted above. the CUDA 9.0RC physically does not contain nppi.lib, instead, it appears Nvidia has broken it into several libraries: nppial.lib, nppicc.lib, nppicom.lib, nppidei.lib, nppif.lib, nppig.lib, nppist.lib nppisu.lib and nppitc.lib
In an attempt to resolve this, I added the nppi.lib from CUDA 8.0 straight into the library directory of the CUDA 9.0. This appears to make the configuring for CMake happy, but ultimately when I build the solution in Visual Studio, almost everything fails with some variation of:
5>LINK : fatal error LNK1104: cannot open file '..\..\lib\Release\opencv_core330.lib'
5>Done building project "opencv_ml.vcxproj" -- FAILED.
I also tried going into the CMakeCache file and changing the Path to nppi library to all of the aforementioned files as separated with a semicolon. Result is the same. (As a note, i only changed the library filepath, not every other mention of nppi in the CMakeCache)
I expect that this is probably an issue with CUDA 9.0 RC and may require a patch from CMake. Does anyone have a workaround/am I doing something wrong? I'd appreciate any help you all can provide.
Upvotes: 4
Views: 3380
Reputation: 204
for those having problem generating the nppi.lib as mention by Haotian Wang
1) run step 1 and cd to C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC (if using vs15)
2) vcvarsall.bat x64
then continue with step 2 as above
Upvotes: 0
Reputation: 56
I have solved this problem. I use lib.exe to combine these several libraries into one library.
Upvotes: 4