Commit 86465e30 authored by Davis King's avatar Davis King

Improved cmake error messages about CUDA support.

parent e9837f70
...@@ -561,7 +561,7 @@ if (NOT TARGET dlib) ...@@ -561,7 +561,7 @@ if (NOT TARGET dlib)
include(cmake_utils/test_for_cudnn/find_cudnn.txt) include(cmake_utils/test_for_cudnn/find_cudnn.txt)
if (cudnn AND NOT DEFINED cuda_test_compile_worked AND NOT DEFINED cudnn_test_compile_worked) if (cudnn AND cudnn_include AND NOT DEFINED cuda_test_compile_worked AND NOT DEFINED cudnn_test_compile_worked)
# make sure cuda is really working by doing a test compile # make sure cuda is really working by doing a test compile
message(STATUS "Building a CUDA test project to see if your compiler is compatible with CUDA...") message(STATUS "Building a CUDA test project to see if your compiler is compatible with CUDA...")
...@@ -585,10 +585,10 @@ if (NOT TARGET dlib) ...@@ -585,10 +585,10 @@ if (NOT TARGET dlib)
${PROJECT_SOURCE_DIR}/cmake_utils/test_for_cudnn cudnn_test ${PROJECT_SOURCE_DIR}/cmake_utils/test_for_cudnn cudnn_test
CMAKE_FLAGS ${CUDA_TEST_CMAKE_FLAGS} CMAKE_FLAGS ${CUDA_TEST_CMAKE_FLAGS}
) )
if (cudnn_test_compile_worked) if (NOT cudnn_test_compile_worked)
message(STATUS "Found cuDNN: " ${cudnn}) message(STATUS "*** Found cuDNN, but it looks like the wrong version so dlib will not use it. ***")
else() message(STATUS "*** Dlib requires cuDNN V5.0 OR GREATER. Since cuDNN is not found DLIB WILL NOT USE CUDA. ***")
message(STATUS "*** Found cuDNN, but it looks like the wrong version so dlib will not use it. ***") message(STATUS "*** If you have cuDNN then set CMAKE_PREFIX_PATH to include cuDNN's folder. ***")
endif() endif()
endif() endif()
endif() endif()
...@@ -632,19 +632,14 @@ if (NOT TARGET dlib) ...@@ -632,19 +632,14 @@ if (NOT TARGET dlib)
${openmp_libarires} ${openmp_libarires}
) )
include_directories(${cudnn_include}) include_directories(${cudnn_include})
message(STATUS "Enabling CUDA support for dlib. DLIB WILL USE CUDA")
else() else()
set(DLIB_USE_CUDA OFF CACHE STRING ${DLIB_USE_BLAS_STR} FORCE ) set(DLIB_USE_CUDA OFF CACHE STRING ${DLIB_USE_BLAS_STR} FORCE )
toggle_preprocessor_switch(DLIB_USE_CUDA) toggle_preprocessor_switch(DLIB_USE_CUDA)
if (NOT USING_OLD_VISUAL_STUDIO_COMPILER) if (USING_OLD_VISUAL_STUDIO_COMPILER)
if (cuda_test_compile_worked)
if (NOT cudnn OR NOT cudnn_include OR NOT cudnn_test_compile_worked)
message(STATUS "*** cuDNN V5.0 OR GREATER NOT FOUND. DLIB WILL NOT USE CUDA. ***")
message(STATUS "*** If you have cuDNN then set CMAKE_PREFIX_PATH to include cuDNN's folder.")
endif()
endif()
else ()
message(STATUS "*** Dlib CUDA support requires C++11 but your compiler doesn't support it. ***") message(STATUS "*** Dlib CUDA support requires C++11 but your compiler doesn't support it. ***")
endif() endif()
message(STATUS "Disabling CUDA support for dlib. DLIB WILL NOT USE CUDA")
endif() endif()
endif() endif()
......
...@@ -14,3 +14,11 @@ find_library(cudnn cudnn ...@@ -14,3 +14,11 @@ find_library(cudnn cudnn
PATH_SUFFIXES lib64 lib x64 PATH_SUFFIXES lib64 lib x64
) )
mark_as_advanced(cudnn cudnn_include) mark_as_advanced(cudnn cudnn_include)
if (cudnn AND cudnn_include)
message(STATUS "Found cuDNN: " ${cudnn})
else()
message(STATUS "*** cuDNN V5.0 OR GREATER NOT FOUND. ***")
message(STATUS "*** Dlib requires cuDNN V5.0 OR GREATER. Since cuDNN is not found DLIB WILL NOT USE CUDA. ***")
message(STATUS "*** If you have cuDNN then set CMAKE_PREFIX_PATH to include cuDNN's folder. ***")
endif()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment