Skip to content

Commit 2e6bce5

Browse files
committed
Add CUDA_VERSION to cudnn location detection
1 parent c4d000a commit 2e6bce5

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

CMakeLists.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,14 @@ include(external/snappy) # download snappy
200200
include(external/snappystream)
201201
include(external/threadpool)
202202

203+
if(WITH_GPU)
204+
include(cuda)
205+
include(tensorrt)
206+
include(external/anakin)
207+
else()
208+
set(WITH_ANAKIN OFF CACHE STRING "Anakin is valid only when GPU is set." FORCE)
209+
endif()
210+
203211
include(cudnn) # set cudnn libraries, must before configure
204212
include(cupti)
205213
include(configure) # add paddle env configuration
@@ -228,14 +236,6 @@ set(EXTERNAL_LIBS
228236
${PYTHON_LIBRARIES}
229237
)
230238

231-
if(WITH_GPU)
232-
include(cuda)
233-
include(tensorrt)
234-
include(external/anakin)
235-
else()
236-
set(WITH_ANAKIN OFF CACHE STRING "Anakin is valid only when GPU is set." FORCE)
237-
endif()
238-
239239
if(WITH_AMD_GPU)
240240
find_package(HIP)
241241
include(hip)

cmake/cudnn.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ list(APPEND CUDNN_CHECK_LIBRARY_DIRS
2121
${CUDNN_ROOT}/lib64
2222
${CUDNN_ROOT}/lib
2323
${CUDNN_ROOT}/lib/${TARGET_ARCH}-linux-gnu
24-
${CUDNN_ROOT}/local/cuda-8.0/targets/${TARGET_ARCH}-linux/lib/
24+
${CUDNN_ROOT}/local/cuda-${CUDA_VERSION}/targets/${TARGET_ARCH}-linux/lib/
2525
$ENV{CUDNN_ROOT}
2626
$ENV{CUDNN_ROOT}/lib64
2727
$ENV{CUDNN_ROOT}/lib

0 commit comments

Comments
 (0)