diff --git a/cmake/cudnn.cmake b/cmake/cudnn.cmake index 842b94d47e75b4bab577a1150cb3d198eb42ebaf..c0cb4ccea67cd493a30a6be43ee6ee48f70c36bf 100644 --- a/cmake/cudnn.cmake +++ b/cmake/cudnn.cmake @@ -26,7 +26,8 @@ list(APPEND CUDNN_CHECK_LIBRARY_DIRS ${CUDNN_ROOT}/lib64 ${CUDNN_ROOT}/lib ${CUDNN_ROOT}/lib/${TARGET_ARCH}-linux-gnu - ${CUDNN_ROOT}/local/cuda-${CUDA_VERSION}/targets/${TARGET_ARCH}-linux/lib/ + /usr/local/cuda-${CUDA_VERSION}/targets/${TARGET_ARCH}-linux/lib/ + /usr/lib/${TARGET_ARCH}-linux-gnu/ $ENV{CUDNN_ROOT} $ENV{CUDNN_ROOT}/lib64 $ENV{CUDNN_ROOT}/lib diff --git a/lite/kernels/cuda/concat_compute.cu b/lite/kernels/cuda/concat_compute.cu index 9ec693667252e76a99f305bc3ec9d6062cc2e840..72d0af459b26b6864dd308fece7131224b212a05 100644 --- a/lite/kernels/cuda/concat_compute.cu +++ b/lite/kernels/cuda/concat_compute.cu @@ -51,9 +51,9 @@ void ConcatCompute::Run() { Tensor* output = param.output; auto* output_data = output->mutable_data(TARGET(kCUDA)); int axis = param.axis; - auto* axis_tensor = param.axis_tensor; + Tensor* axis_tensor = param.axis_tensor; if (axis_tensor != nullptr) { - auto* axis_tensor_data = axis_tensor->data(); + const int* axis_tensor_data = axis_tensor->data(); axis = axis_tensor_data[0]; } int inner_size = 1; diff --git a/lite/tools/ci_build.sh b/lite/tools/ci_build.sh index 6c3750e69fa6eb1ecc36a1fc7e42fe32bead377a..8b5741a7a68bee3e783dff68e4bd4a8fc7cd8527 100755 --- a/lite/tools/ci_build.sh +++ b/lite/tools/ci_build.sh @@ -1,9 +1,10 @@ #!/bin/bash +# The git version of CI is 2.7.4. This script is not compatible with git version 1.7.1. set -ex TESTS_FILE="./lite_tests.txt" LIBS_FILE="./lite_libs.txt" - +CUDNN_ROOT="/usr/local/cudnn" readonly ADB_WORK_DIR="/data/local/tmp" readonly common_flags="-DWITH_LITE=ON -DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK=OFF -DWITH_PYTHON=OFF -DWITH_TESTING=ON -DLITE_WITH_ARM=OFF" @@ -162,6 +163,12 @@ function cmake_x86_for_CI { # make test_generated_code -j$NUM_CORES_FOR_COMPILE } +function cmake_cuda_for_CI { + prepare_workspace # fake an empty __generated_code__.cc to pass cmake. + cmake .. -DLITE_WITH_CUDA=ON -DWITH_MKLDNN=OFF -DLITE_WITH_X86=OFF ${common_flags} -DLITE_WITH_PROFILE=ON -DWITH_MKL=OFF \ + -DLITE_BUILD_EXTRA=ON -DCUDNN_ROOT=${CUDNN_ROOT} +} + function cmake_gpu { prepare_workspace cmake .. " -DWITH_GPU=ON {common_flags} -DLITE_WITH_GPU=ON" @@ -226,6 +233,16 @@ function build_test_server { test_model_optimize_tool_compile } +# The CUDA version of CI is cuda_10.1.243_418.87.00_linux. +# The cuDNN version is cudnn-10.1-linux-x64-v7.5.0.56. +function build_test_cuda_server { + mkdir -p ./build + cd ./build + export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PWD/third_party/install/mklml/lib" + cmake_cuda_for_CI + build +} + function build_test_train { mkdir -p ./build cd ./build @@ -950,6 +967,10 @@ function main { test_arm_android $TEST_NAME $ARM_PORT shift ;; + build_test_cuda_server) + build_test_cuda_server + shift + ;; build_test_server) build_test_server shift