From 3ade55e2c82165e2c69e05658af8888b51253082 Mon Sep 17 00:00:00 2001 From: Pei Yang Date: Fri, 7 Aug 2020 10:45:50 +0800 Subject: [PATCH] [Cherry pick] fix jetson compile and add version info (#26024) * fix cpuid.h not found * fix-jetson-compile-pyramid_hash * add more info to version.txt, test=develop (#24551) --- cmake/cuda.cmake | 1 + cmake/inference_lib.cmake | 5 +++-- paddle/fluid/operators/CMakeLists.txt | 2 +- python/paddle/fluid/tests/unittests/CMakeLists.txt | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cmake/cuda.cmake b/cmake/cuda.cmake index e069c799b4b..90b90fa759d 100644 --- a/cmake/cuda.cmake +++ b/cmake/cuda.cmake @@ -4,6 +4,7 @@ endif() if (WITH_NV_JETSON) + add_definitions(-DWITH_NV_JETSON) set(paddle_known_gpu_archs "53 62 72") set(paddle_known_gpu_archs7 "53") set(paddle_known_gpu_archs8 "53 62") diff --git a/cmake/inference_lib.cmake b/cmake/inference_lib.cmake index 137b13694f2..7e446bfab1b 100644 --- a/cmake/inference_lib.cmake +++ b/cmake/inference_lib.cmake @@ -284,11 +284,12 @@ function(version version_file) if(WITH_GPU) file(APPEND ${version_file} "CUDA version: ${CUDA_VERSION}\n" - "CUDNN version: v${CUDNN_MAJOR_VERSION}\n") + "CUDNN version: v${CUDNN_MAJOR_VERSION}.${CUDNN_MINOR_VERSION}\n") endif() + file(APPEND ${version_file} "CXX compiler version: ${CMAKE_CXX_COMPILER_VERSION}\n") if(TENSORRT_FOUND) file(APPEND ${version_file} - "WITH_TENSORRT: ${TENSORRT_FOUND}\n") + "WITH_TENSORRT: ${TENSORRT_FOUND}\n" "TensorRT version: v${TENSORRT_MAJOR_VERSION}\n") endif() endfunction() diff --git a/paddle/fluid/operators/CMakeLists.txt b/paddle/fluid/operators/CMakeLists.txt index 596eb99e813..4e8c86b3f3f 100644 --- a/paddle/fluid/operators/CMakeLists.txt +++ b/paddle/fluid/operators/CMakeLists.txt @@ -53,7 +53,7 @@ if (NOT WITH_MKL OR NOT WITH_AVX) SET(OP_MKL_DEPS ${OP_MKL_DEPS} match_matrix_tensor_op) SET(OP_MKL_DEPS ${OP_MKL_DEPS} var_conv_2d_op) endif() -if(WITH_COVERAGE OR NOT WITH_AVX OR WIN32) +if(WITH_COVERAGE OR NOT WITH_AVX OR WIN32 OR WITH_NV_JETSON) SET(OP_MKL_DEPS ${OP_MKL_DEPS} pyramid_hash_op) endif() diff --git a/python/paddle/fluid/tests/unittests/CMakeLists.txt b/python/paddle/fluid/tests/unittests/CMakeLists.txt index 22190c05b32..0ae95cad6c4 100644 --- a/python/paddle/fluid/tests/unittests/CMakeLists.txt +++ b/python/paddle/fluid/tests/unittests/CMakeLists.txt @@ -91,7 +91,7 @@ if(NOT WITH_MKL OR NOT WITH_AVX) list(REMOVE_ITEM TEST_OPS test_match_matrix_tensor_op) list(REMOVE_ITEM TEST_OPS test_var_conv_2d) endif() -if(WITH_COVERAGE OR NOT WITH_AVX OR WIN32) +if(WITH_COVERAGE OR NOT WITH_AVX OR WIN32 OR WITH_NV_JETSON) list(REMOVE_ITEM TEST_OPS test_pyramid_hash_op) list(REMOVE_ITEM TEST_OPS test_fleet_pyramid_hash) endif() -- GitLab