Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I am posting an "answer" to this, although I ended up building opencv with Cuda 9.0 instead of Cuda 8.0.

The main problem I had was an incomplete install of Cuda 8.0 which was evidenced by my not having the nppi libraries. Thus, when invoking cmake, the CUDA_npp_LIBRARY variable was not being set causing HAVE_CUDA = 0.

I uninstalled Cuda 8.0 and installed Cuda 9.0.

I then ran into the following errors: Problem 1: In Cuda 9.0 the nppi library has been split into many different libraries: nppial nppicc nppicom etc. Solution 1: Hack the FindCuda.cmake script so that the CUDA_nppi_LIBRARY variable is set to a semicolon separated string of the nppi* libraries

Problem 2: Compiling fails due to: nvcc fatal : Unsupported gpu architecture 'compute_20' Solution 2: Cuda 9.0 no longer supports the arch_20 architecture. Run cmake with CUDA_GENERATION set to your target architecture.

Problem 3: saturate_cast.hpp(277): error: identifier "__half2float" is undefined. Solution 3: Cuda 9.0 probably changed their header files. But this function is declared in cuda_fp16.h. I included <cuda_fp16.h> at the top of opencv2/cudev/common.h.

OpenCV 3.3.0 now builds and runs successfully with Cuda 9.0 for me.

I am posting an "answer" to this, although I ended up building opencv with Cuda 9.0 instead of Cuda 8.0.

The main problem I had was an incomplete install of Cuda 8.0 which was evidenced by my not having the nppi libraries. Thus, when invoking cmake, the CUDA_npp_LIBRARY variable was not being set causing HAVE_CUDA = 0.

I uninstalled Cuda 8.0 and installed Cuda 9.0.

I then ran into the following errors: errors:

Problem 1: In Cuda 9.0 the nppi library has been split into many different libraries: nppial nppicc nppicom etc.
Solution 1: Hack the FindCuda.cmake script so that the CUDA_nppi_LIBRARY variable is set to a semicolon separated string of the nppi* libraries

libraries

Problem 2: Compiling fails due to: nvcc fatal : Unsupported gpu architecture 'compute_20'
Solution 2: Cuda 9.0 no longer supports the arch_20 architecture.  Run cmake with CUDA_GENERATION set to your target architecture.

architecture.

Problem 3: saturate_cast.hpp(277): error: identifier "__half2float" is undefined.
Solution 3: Cuda 9.0 probably changed their header files.  But this function is declared in cuda_fp16.h. I included <cuda_fp16.h> at the top of opencv2/cudev/common.h.

opencv2/cudev/common.h.

OpenCV 3.3.0 now builds and runs successfully with Cuda 9.0 for me.

I am posting an "answer" to this, although I ended up building opencv with Cuda 9.0 instead of Cuda 8.0.

The main problem I had was an incomplete install of Cuda 8.0 which was evidenced by my not having the nppi libraries. Thus, when invoking cmake, the CUDA_npp_LIBRARY variable was not being set causing HAVE_CUDA = 0.

I uninstalled Cuda 8.0 and installed Cuda 9.0.

I then ran into the following errors:

Problem 1: In Cuda 9.0 the nppi library has been split into many different libraries: nppial nppicc nppicom etc.
Solution 1: Hack the FindCuda.cmake script so that the CUDA_nppi_LIBRARY variable is set to a semicolon separated string of the nppi* libraries
Problem 2: Compiling fails due to: nvcc fatal : Unsupported gpu architecture 'compute_20'
Solution 2: Cuda 9.0 no longer supports the arch_20 architecture.  Run cmake with CUDA_GENERATION set to your target architecture.
Problem 3: saturate_cast.hpp(277): error: identifier "__half2float" is undefined.
Solution 3: Cuda 9.0 probably changed their header files.  But this function is declared in cuda_fp16.h. I included <cuda_fp16.h> at the top of opencv2/cudev/common.h.
opencv2/cudev/common.hpp.

OpenCV 3.3.0 now builds and runs successfully with Cuda 9.0 for me.