From 6d1b8c5261ca83bd59edf78d52a3362d32082dae Mon Sep 17 00:00:00 2001 From: Sing_chan <51314274+betterpig@users.noreply.github.com> Date: Fri, 17 Dec 2021 15:32:34 +0800 Subject: [PATCH] fix bug when build inference lib without tensorrt (#38156) --- paddle/fluid/inference/api/demo_ci/run.sh | 10 +++------- paddle/scripts/paddle_build.bat | 2 +- paddle/scripts/paddle_build.sh | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/paddle/fluid/inference/api/demo_ci/run.sh b/paddle/fluid/inference/api/demo_ci/run.sh index d5452f82d0..5f062e8063 100755 --- a/paddle/fluid/inference/api/demo_ci/run.sh +++ b/paddle/fluid/inference/api/demo_ci/run.sh @@ -19,8 +19,9 @@ PADDLE_ROOT=$1 TURN_ON_MKL=$2 # use MKL or Openblas TEST_GPU_CPU=$3 # test both GPU/CPU mode or only CPU mode DATA_DIR=$4 # dataset -TENSORRT_ROOT_DIR=$5 # TensorRT root dir, default to /usr -MSVC_STATIC_CRT=$6 +USE_TENSORRT=$5 +TENSORRT_ROOT_DIR=$6 # TensorRT root dir, default to /usr +MSVC_STATIC_CRT=$7 inference_install_dir=${PADDLE_ROOT}/build/paddle_inference_install_dir WIN_DETECT=$(echo `uname` | grep "Win") # detect current platform @@ -37,11 +38,6 @@ else use_gpu_list='false' fi -USE_TENSORRT=OFF -if [ -d "$TENSORRT_ROOT_DIR" ]; then - USE_TENSORRT=ON -fi - PREFIX=inference-vis-demos%2F URL_ROOT=http://paddlemodels.bj.bcebos.com/${PREFIX} diff --git a/paddle/scripts/paddle_build.bat b/paddle/scripts/paddle_build.bat index 84e6893ea2..8bb21fa4ef 100644 --- a/paddle/scripts/paddle_build.bat +++ b/paddle/scripts/paddle_build.bat @@ -742,7 +742,7 @@ for /F %%i in ("%libsize%") do ( ) cd /d %work_dir%\paddle\fluid\inference\api\demo_ci -%cache_dir%\tools\busybox64.exe bash run.sh %work_dir:\=/% %WITH_MKL% %WITH_GPU% %cache_dir:\=/%/inference_demo %TENSORRT_ROOT% %MSVC_STATIC_CRT% +%cache_dir%\tools\busybox64.exe bash run.sh %work_dir:\=/% %WITH_MKL% %WITH_GPU% %cache_dir:\=/%/inference_demo %WITH_TENSORRT% %TENSORRT_ROOT% %MSVC_STATIC_CRT% goto:eof :test_inference_error diff --git a/paddle/scripts/paddle_build.sh b/paddle/scripts/paddle_build.sh index 48449e358b..c58c78995e 100755 --- a/paddle/scripts/paddle_build.sh +++ b/paddle/scripts/paddle_build.sh @@ -2244,7 +2244,7 @@ EOF demo_ci_startTime_s=`date +%s` cd ${PADDLE_ROOT}/paddle/fluid/inference/api/demo_ci ./run.sh ${PADDLE_ROOT} ${WITH_MKL:-ON} ${WITH_GPU:-OFF} ${INFERENCE_DEMO_INSTALL_DIR} \ - ${TENSORRT_ROOT_DIR:-/usr} + ${WITH_TENSORRT:-ON} ${TENSORRT_ROOT_DIR:-/usr} DEMO_EXIT_CODE=$? ./clean.sh demo_ci_endTime_s=`date +%s` -- GitLab