From 2e6bce597db2c4bc233f50e0eafd5b9960e7a4ed Mon Sep 17 00:00:00 2001 From: minqiyang Date: Thu, 2 Aug 2018 11:47:07 +0800 Subject: [PATCH] Add CUDA_VERSION to cudnn location detection --- CMakeLists.txt | 16 ++++++++-------- cmake/cudnn.cmake | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 231224f9249..bdd48565ede 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -200,6 +200,14 @@ include(external/snappy) # download snappy include(external/snappystream) include(external/threadpool) +if(WITH_GPU) + include(cuda) + include(tensorrt) + include(external/anakin) +else() + set(WITH_ANAKIN OFF CACHE STRING "Anakin is valid only when GPU is set." FORCE) +endif() + include(cudnn) # set cudnn libraries, must before configure include(cupti) include(configure) # add paddle env configuration @@ -228,14 +236,6 @@ set(EXTERNAL_LIBS ${PYTHON_LIBRARIES} ) -if(WITH_GPU) - include(cuda) - include(tensorrt) - include(external/anakin) -else() - set(WITH_ANAKIN OFF CACHE STRING "Anakin is valid only when GPU is set." FORCE) -endif() - if(WITH_AMD_GPU) find_package(HIP) include(hip) diff --git a/cmake/cudnn.cmake b/cmake/cudnn.cmake index 07c26955745..9eebea816cb 100644 --- a/cmake/cudnn.cmake +++ b/cmake/cudnn.cmake @@ -21,7 +21,7 @@ list(APPEND CUDNN_CHECK_LIBRARY_DIRS ${CUDNN_ROOT}/lib64 ${CUDNN_ROOT}/lib ${CUDNN_ROOT}/lib/${TARGET_ARCH}-linux-gnu - ${CUDNN_ROOT}/local/cuda-8.0/targets/${TARGET_ARCH}-linux/lib/ + ${CUDNN_ROOT}/local/cuda-${CUDA_VERSION}/targets/${TARGET_ARCH}-linux/lib/ $ENV{CUDNN_ROOT} $ENV{CUDNN_ROOT}/lib64 $ENV{CUDNN_ROOT}/lib -- GitLab