Make cuDNN test project failure print a message saying exactly why it failed.

This commit is contained in:
Davis King 2020-06-21 08:48:02 -04:00
parent facefa0204
commit b9f4da5522
1 changed files with 12 additions and 4 deletions

View File

@ -687,19 +687,27 @@ if (NOT TARGET dlib)
message(STATUS "*****************************************************************************************************************")
message(STATUS "*** CUDA was found but your compiler failed to compile a simple CUDA program so dlib isn't going to use CUDA. ")
message(STATUS "*** The output of the failed CUDA test compile is shown below: ")
message(STATUS "*** ")
message(STATUS "*** ${try_compile_output_message}")
message(STATUS "*****************************************************************************************************************")
else()
message(STATUS "Checking if you have the right version of cuDNN installed.")
message(STATUS "Building a cuDNN test project to check if you have the right version of cuDNN installed...")
try_compile(cudnn_test_compile_worked
${PROJECT_BINARY_DIR}/cudnn_test_build
${PROJECT_SOURCE_DIR}/cmake_utils/test_for_cudnn cudnn_test
CMAKE_FLAGS ${CUDA_TEST_CMAKE_FLAGS}
OUTPUT_VARIABLE try_compile_output_message
)
if (NOT cudnn_test_compile_worked)
message(STATUS "*** Found cuDNN, but it looks like the wrong version so dlib will not use it. ***")
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. ***")
string(REPLACE "\n" "\n *** " try_compile_output_message "${try_compile_output_message}")
message(STATUS "*****************************************************************************************************")
message(STATUS "*** Found cuDNN, but we failed to compile the dlib/cmake_utils/test_for_cudnn project. ")
message(STATUS "*** You either have an unsupported version of cuDNN or something is wrong with your cudDNN install.")
message(STATUS "*** Since a functional cuDNN is not found DLIB WILL NOT USE CUDA. ")
message(STATUS "*** The output of the failed test_for_cudnn build is: ")
message(STATUS "*** ")
message(STATUS "*** ${try_compile_output_message}")
message(STATUS "*****************************************************************************************************")
endif()
endif()
endif()