Skip to content

Commit 17da113

Browse files
authored
Merge pull request #12693 from luotao1/anakin_bug
fix specific cudnn include and library path
2 parents 317e18a + 9f37899 commit 17da113

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,12 @@ include(external/snappy) # download snappy
204204
include(external/snappystream)
205205
include(external/threadpool)
206206

207-
set(WITH_ANAKIN OFF CACHE STRING "Disable Anakin first, will add it later." FORCE)
208207
if(WITH_GPU)
209208
include(cuda)
210209
include(tensorrt)
211210
include(external/anakin)
211+
elseif()
212+
set(WITH_ANAKIN OFF CACHE STRING "Anakin is used in GPU only now." FORCE)
212213
endif()
213214

214215
include(cudnn) # set cudnn libraries, must before configure

cmake/configure.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ if(WITH_GPU)
104104
if(${CUDNN_MAJOR_VERSION} VERSION_LESS 7)
105105
message(FATAL_ERROR "Anakin needs CUDNN >= 7.0 to compile")
106106
endif()
107+
set(ENV{CUDNN_INCLUDE_DIR} ${CUDNN_INCLUDE_DIR})
108+
set(ENV{CUDNN_LIBRARY} ${CUDNN_LIBRARY})
109+
message(STATUS "cudnn include header is ${CUDNN_INCLUDE_DIR}/cudnn.h")
110+
message(STATUS "cudnn library is ${CUDNN_LIBRARY}")
107111
endif()
108112
elseif(WITH_AMD_GPU)
109113
add_definitions(-DPADDLE_WITH_HIP)

cmake/external/anakin.cmake

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ set(ANAKIN_COMPILE_EXTRA_FLAGS
3535
ExternalProject_Add(
3636
extern_anakin
3737
${EXTERNAL_PROJECT_LOG_ARGS}
38-
# TODO(luotao): use PaddlePaddle/Anakin later
39-
GIT_REPOSITORY "https://github.com/luotao1/Anakin"
40-
GIT_TAG "3957ae9263eaa0b1986758dac60a88852afb09be"
38+
GIT_REPOSITORY "https://github.com/PaddlePaddle/Anakin"
39+
GIT_TAG "04256ba78fa3da0beb74e8036c8efd68c12824d6"
4140
PREFIX ${ANAKIN_SOURCE_DIR}
4241
UPDATE_COMMAND ""
4342
CMAKE_ARGS -DUSE_GPU_PLACE=YES

paddle/fluid/inference/api/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ cc_library(paddle_inference_tensorrt_subgraph_engine
6060
inference_api_test(test_api_tensorrt_subgraph_engine SRC api_tensorrt_subgraph_engine_tester.cc ARGS test_word2vec)
6161
endif()
6262

63-
if (WITH_ANAKIN) # only needed in CI
63+
if (WITH_ANAKIN AND WITH_GPU) # only needed in CI
6464
# compile the libinference_anakin_api.a and anakin.so.
6565
nv_library(inference_anakin_api SRCS api.cc api_anakin_engine.cc DEPS anakin_shared anakin_saber)
6666
#nv_library(inference_anakin_api_shared SHARED SRCS api.cc api_anakin_engine.cc DEPS anakin)

0 commit comments

Comments
 (0)