From 112903c2bdc5854da3fac82cb57bd83dc0a98aef Mon Sep 17 00:00:00 2001 From: Vladislav Vinogradov Date: Wed, 13 Jul 2016 13:02:13 +0300 Subject: [PATCH 1/2] increase minimal supported CUDA toolkit to 6.5 --- cmake/OpenCVMinDepVersions.cmake | 2 +- modules/core/include/opencv2/core/private.cuda.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/OpenCVMinDepVersions.cmake b/cmake/OpenCVMinDepVersions.cmake index e8591e26e2..44dbf6eefe 100644 --- a/cmake/OpenCVMinDepVersions.cmake +++ b/cmake/OpenCVMinDepVersions.cmake @@ -1,5 +1,5 @@ set(MIN_VER_CMAKE 2.8.7) -set(MIN_VER_CUDA 4.2) +set(MIN_VER_CUDA 6.5) set(MIN_VER_PYTHON2 2.6) set(MIN_VER_PYTHON3 3.2) set(MIN_VER_ZLIB 1.2.3) diff --git a/modules/core/include/opencv2/core/private.cuda.hpp b/modules/core/include/opencv2/core/private.cuda.hpp index d676ce8506..c25d7885ed 100644 --- a/modules/core/include/opencv2/core/private.cuda.hpp +++ b/modules/core/include/opencv2/core/private.cuda.hpp @@ -64,7 +64,7 @@ # define NPP_VERSION (NPP_VERSION_MAJOR * 1000 + NPP_VERSION_MINOR * 100 + NPP_VERSION_BUILD) -# define CUDART_MINIMUM_REQUIRED_VERSION 4020 +# define CUDART_MINIMUM_REQUIRED_VERSION 6050 # if (CUDART_VERSION < CUDART_MINIMUM_REQUIRED_VERSION) # error "Insufficient Cuda Runtime library version, please update it." From d76f258aebdf63f979a205cabe6d3e81700a7cd8 Mon Sep 17 00:00:00 2001 From: Vladislav Vinogradov Date: Wed, 13 Jul 2016 13:03:16 +0300 Subject: [PATCH 2/2] update CUDA architecture flags initialization * remove obsolete paths * add Pascal arch support --- cmake/OpenCVDetectCUDA.cmake | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/cmake/OpenCVDetectCUDA.cmake b/cmake/OpenCVDetectCUDA.cmake index 3534754fea..de17cee30c 100644 --- a/cmake/OpenCVDetectCUDA.cmake +++ b/cmake/OpenCVDetectCUDA.cmake @@ -43,7 +43,7 @@ if(CUDA_FOUND) message(STATUS "CUDA detected: " ${CUDA_VERSION}) - set(_generations "Fermi" "Kepler") + set(_generations "Fermi" "Kepler" "Maxwell" "Pascal") if(NOT CMAKE_CROSSCOMPILING) list(APPEND _generations "Auto") endif() @@ -63,13 +63,13 @@ if(CUDA_FOUND) set(__cuda_arch_ptx "") if(CUDA_GENERATION STREQUAL "Fermi") - set(__cuda_arch_bin "2.0 2.1(2.0)") + set(__cuda_arch_bin "2.0") elseif(CUDA_GENERATION STREQUAL "Kepler") - if(${CUDA_VERSION} VERSION_LESS "5.0") - set(__cuda_arch_bin "3.0") - else() - set(__cuda_arch_bin "3.0 3.5") - endif() + set(__cuda_arch_bin "3.0 3.5") + elseif(CUDA_GENERATION STREQUAL "Maxwell") + set(__cuda_arch_bin "5.0") + elseif(CUDA_GENERATION STREQUAL "Pascal") + set(__cuda_arch_bin "6.0") elseif(CUDA_GENERATION STREQUAL "Auto") execute_process( COMMAND "${CUDA_NVCC_EXECUTABLE}" "${OpenCV_SOURCE_DIR}/cmake/checks/OpenCVDetectCudaArch.cu" "--run" WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/" @@ -91,14 +91,12 @@ if(CUDA_FOUND) set(__cuda_arch_bin "5.3") set(__cuda_arch_ptx "") else() - if(${CUDA_VERSION} VERSION_LESS "5.0") - set(__cuda_arch_bin "1.1 1.2 1.3 2.0 2.1(2.0) 3.0") - elseif(${CUDA_VERSION} VERSION_GREATER "6.5") - set(__cuda_arch_bin "2.0 2.1(2.0) 3.0 3.5") + if(${CUDA_VERSION} VERSION_LESS "8.0") + set(__cuda_arch_bin "2.0 3.0 3.5 5.0") else() - set(__cuda_arch_bin "1.1 1.2 1.3 2.0 2.1(2.0) 3.0 3.5") + set(__cuda_arch_bin "2.0 3.0 3.5 5.0 6.0") endif() - set(__cuda_arch_ptx "3.0") + set(__cuda_arch_ptx "") endif() endif()