PaddlePaddle / PaddleX

All-in-One Development Tool based on PaddlePaddle(飞桨低代码开发工具)
Apache License 2.0
4.9k stars 958 forks source link

jetson nano构建deploy时候提示No rule to make target '/libcudnn.so' #1079

Open TitansWhale opened 3 years ago

TitansWhale commented 3 years ago

问题类型:模型部署 问题描述
构建deploy时, make[2]: *** No rule to make target '/libcudnn.so', needed by 'demo/batch_infer'. Stop.

========================

构建脚本

# 是否使用GPU(即是否使用 CUDA)
WITH_GPU=ON
# 使用MKL or openblas
WITH_MKL=OFF
# 是否集成 TensorRT(仅WITH_GPU=ON 有效)
WITH_TENSORRT=ON
# TensorRT 的路径,如果需要集成TensorRT,需修改为您实际安装的TensorRT路径
TENSORRT_DIR=/usr/src/tensorrt/
# Paddle 预测库路径, 请修改为您实际安装的预测库路径
PADDLE_DIR=/home/nano/paddle_inference_install_dir
# Paddle 的预测库是否使用静态库来编译
# 使用TensorRT时,Paddle的预测库通常为动态库
WITH_STATIC_LIB=OFF
# CUDA 的 lib 路径
CUDA_LIB=/usr/local/cuda/lib64
# CUDNN 的 lib 路径
CUDNN_LIB= /usr/lib/aarch64-linux-gnu/

# 以下无需改动
rm -rf build
mkdir -p build
cd build
cmake .. \
    -DWITH_GPU=${WITH_GPU} \
    -DWITH_MKL=${WITH_MKL} \
    -DWITH_TENSORRT=${WITH_TENSORRT} \
    -DWITH_ENCRYPTION=${WITH_ENCRYPTION} \
    -DTENSORRT_DIR=${TENSORRT_DIR} \
    -DPADDLE_DIR=${PADDLE_DIR} \
    -DWITH_STATIC_LIB=${WITH_STATIC_LIB} \
    -DCUDA_LIB=${CUDA_LIB} \
    -DCUDNN_LIB=${CUDNN_LIB}

执行的过程

./scripts/jetson_build.sh: line 17: /usr/lib/aarch64-linux-gnu/: Is a directory
-- The CXX compiler identification is GNU 7.5.0
-- The C compiler identification is GNU 7.5.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
OpenCV libs: /usr/lib/aarch64-linux-gnu/libopencv_calib3d.so;/usr/lib/aarch64-linux-gnu/libopencv_core.so;/usr/lib/aarch64-linux-gnu/libopencv_dnn.so;/usr/lib/aarch64-linux-gnu/libopencv_features2d.so;/usr/lib/aarch64-linux-gnu/libopencv_flann.so;/usr/lib/aarch64-linux-gnu/libopencv_gapi.so;/usr/lib/aarch64-linux-gnu/libopencv_highgui.so;/usr/lib/aarch64-linux-gnu/libopencv_imgcodecs.so;/usr/lib/aarch64-linux-gnu/libopencv_imgproc.so;/usr/lib/aarch64-linux-gnu/libopencv_ml.so;/usr/lib/aarch64-linux-gnu/libopencv_objdetect.so;/usr/lib/aarch64-linux-gnu/libopencv_photo.so;/usr/lib/aarch64-linux-gnu/libopencv_stitching.so;/usr/lib/aarch64-linux-gnu/libopencv_video.so;/usr/lib/aarch64-linux-gnu/libopencv_videoio.so
-----DEPS = /usr/lib/aarch64-linux-gnu/libopencv_calib3d.so;/usr/lib/aarch64-linux-gnu/libopencv_core.so;/usr/lib/aarch64-linux-gnu/libopencv_dnn.so;/usr/lib/aarch64-linux-gnu/libopencv_features2d.so;/usr/lib/aarch64-linux-gnu/libopencv_flann.so;/usr/lib/aarch64-linux-gnu/libopencv_gapi.so;/usr/lib/aarch64-linux-gnu/libopencv_highgui.so;/usr/lib/aarch64-linux-gnu/libopencv_imgcodecs.so;/usr/lib/aarch64-linux-gnu/libopencv_imgproc.so;/usr/lib/aarch64-linux-gnu/libopencv_ml.so;/usr/lib/aarch64-linux-gnu/libopencv_objdetect.so;/usr/lib/aarch64-linux-gnu/libopencv_photo.so;/usr/lib/aarch64-linux-gnu/libopencv_stitching.so;/usr/lib/aarch64-linux-gnu/libopencv_video.so;/usr/lib/aarch64-linux-gnu/libopencv_vid
eoio.so;-ldl -lrt -lgomp -lz -lm -lpthread;/home/nano/paddle_inference_install_dir/paddle/lib/libpaddle_inference.so;glog;gflags;protobuf;xxhash;cryptopp;yaml-cpp;/home/nano/paddle_inference_install_dir/third_party/install/openblas/lib/libopenblas.a;/usr/local/cuda/lib64/libcudart.so;/libcudnn.so
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    WITH_TENSORRT

-- Build files have been written to: /home/nano/project/PaddleX/deploy/cpp/build
Scanning dependencies of target ext-yaml-cpp
[  1%] Creating directories for 'ext-yaml-cpp'
[  3%] Performing download step (download, verify and extract) for 'ext-yaml-cpp'
-- ext-yaml-cpp download command succeeded.  See also /home/nano/project/PaddleX/deploy/cpp/build/ext/yaml-cpp/src/ext-yaml-cpp-stamp/ext-yaml-cpp-download-*.log
[  4%] No update step for 'ext-yaml-cpp'
[  6%] No patch step for 'ext-yaml-cpp'
[  7%] Performing configure step for 'ext-yaml-cpp'
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test FLAG_WEXTRA
-- Performing Test FLAG_WEXTRA - Success
-- Configuring done
-- Generating done
-- Build files have been written to: /home/nano/project/PaddleX/deploy/cpp/build/ext/yaml-cpp/src/ext-yaml-cpp-build
[  9%] Performing build step for 'ext-yaml-cpp'
-- ext-yaml-cpp build command succeeded.  See also /home/nano/project/PaddleX/deploy/cpp/build/ext/yaml-cpp/src/ext-yaml-cpp-stamp/ext-yaml-cpp-build-*.log
[ 10%] No install step for 'ext-yaml-cpp'
[ 12%] Completed 'ext-yaml-cpp'
[ 12%] Built target ext-yaml-cpp
Scanning dependencies of target multi_gpu_model_infer
Scanning dependencies of target model_infer
Scanning dependencies of target batch_infer
[ 15%] Building CXX object demo/CMakeFiles/multi_gpu_model_infer.dir/multi_gpu_model_infer.cpp.o
[ 15%] Building CXX object demo/CMakeFiles/model_infer.dir/__/model_deploy/common/src/base_preprocess.cpp.o
[ 16%] Building CXX object demo/CMakeFiles/batch_infer.dir/batch_infer.cpp.o
[ 18%] Building CXX object demo/CMakeFiles/model_infer.dir/model_infer.cpp.o
[ 20%] Building CXX object demo/CMakeFiles/batch_infer.dir/__/model_deploy/common/src/base_preprocess.cpp.o
[ 21%] Building CXX object demo/CMakeFiles/batch_infer.dir/__/model_deploy/common/src/model_factory.cpp.o
[ 23%] Building CXX object demo/CMakeFiles/model_infer.dir/__/model_deploy/common/src/model_factory.cpp.o
[ 24%] Building CXX object demo/CMakeFiles/multi_gpu_model_infer.dir/__/model_deploy/common/src/base_preprocess.cpp.o
[ 26%] Building CXX object demo/CMakeFiles/batch_infer.dir/__/model_deploy/common/src/paddle_deploy.cpp.o
[ 27%] Building CXX object demo/CMakeFiles/batch_infer.dir/__/model_deploy/common/src/transforms.cpp.o
[ 29%] Building CXX object demo/CMakeFiles/model_infer.dir/__/model_deploy/common/src/paddle_deploy.cpp.o
[ 30%] Building CXX object demo/CMakeFiles/batch_infer.dir/__/model_deploy/engine/src/ppinference_engine.cpp.o
[ 32%] Building CXX object demo/CMakeFiles/multi_gpu_model_infer.dir/__/model_deploy/common/src/model_factory.cpp.o
[ 33%] Building CXX object demo/CMakeFiles/model_infer.dir/__/model_deploy/common/src/transforms.cpp.o
[ 35%] Building CXX object demo/CMakeFiles/batch_infer.dir/__/model_deploy/ppdet/src/det_model.cpp.o
[ 36%] Building CXX object demo/CMakeFiles/multi_gpu_model_infer.dir/__/model_deploy/common/src/paddle_deploy.cpp.o
[ 38%] Building CXX object demo/CMakeFiles/batch_infer.dir/__/model_deploy/ppdet/src/det_postprocess.cpp.o
[ 40%] Building CXX object demo/CMakeFiles/model_infer.dir/__/model_deploy/engine/src/ppinference_engine.cpp.o
[ 41%] Building CXX object demo/CMakeFiles/batch_infer.dir/__/model_deploy/ppdet/src/det_preprocess.cpp.o
[ 43%] Building CXX object demo/CMakeFiles/multi_gpu_model_infer.dir/__/model_deploy/common/src/transforms.cpp.o
[ 44%] Building CXX object demo/CMakeFiles/batch_infer.dir/__/model_deploy/ppseg/src/seg_model.cpp.o
[ 46%] Building CXX object demo/CMakeFiles/model_infer.dir/__/model_deploy/ppdet/src/det_model.cpp.o
[ 47%] Building CXX object demo/CMakeFiles/batch_infer.dir/__/model_deploy/ppseg/src/seg_postprocess.cpp.o
[ 49%] Building CXX object demo/CMakeFiles/multi_gpu_model_infer.dir/__/model_deploy/engine/src/ppinference_engine.cpp.o
[ 50%] Building CXX object demo/CMakeFiles/batch_infer.dir/__/model_deploy/ppseg/src/seg_preprocess.cpp.o
[ 52%] Building CXX object demo/CMakeFiles/model_infer.dir/__/model_deploy/ppdet/src/det_postprocess.cpp.o
[ 53%] Building CXX object demo/CMakeFiles/model_infer.dir/__/model_deploy/ppdet/src/det_preprocess.cpp.o
[ 55%] Building CXX object demo/CMakeFiles/multi_gpu_model_infer.dir/__/model_deploy/ppdet/src/det_model.cpp.o
[ 56%] Building CXX object demo/CMakeFiles/batch_infer.dir/__/model_deploy/ppclas/src/clas_model.cpp.o
[ 58%] Building CXX object demo/CMakeFiles/model_infer.dir/__/model_deploy/ppseg/src/seg_model.cpp.o
[ 60%] Building CXX object demo/CMakeFiles/model_infer.dir/__/model_deploy/ppseg/src/seg_postprocess.cpp.o
[ 61%] Building CXX object demo/CMakeFiles/multi_gpu_model_infer.dir/__/model_deploy/ppdet/src/det_postprocess.cpp.o
[ 63%] Building CXX object demo/CMakeFiles/batch_infer.dir/__/model_deploy/ppclas/src/clas_postprocess.cpp.o
[ 64%] Building CXX object demo/CMakeFiles/model_infer.dir/__/model_deploy/ppseg/src/seg_preprocess.cpp.o
[ 66%] Building CXX object demo/CMakeFiles/model_infer.dir/__/model_deploy/ppclas/src/clas_model.cpp.o
[ 67%] Building CXX object demo/CMakeFiles/batch_infer.dir/__/model_deploy/ppclas/src/clas_preprocess.cpp.o
[ 69%] Building CXX object demo/CMakeFiles/multi_gpu_model_infer.dir/__/model_deploy/ppdet/src/det_preprocess.cpp.o
[ 70%] Building CXX object demo/CMakeFiles/model_infer.dir/__/model_deploy/ppclas/src/clas_postprocess.cpp.o
[ 72%] Building CXX object demo/CMakeFiles/model_infer.dir/__/model_deploy/ppclas/src/clas_preprocess.cpp.o
[ 73%] Building CXX object demo/CMakeFiles/batch_infer.dir/__/model_deploy/paddlex/src/x_model.cpp.o
[ 75%] Building CXX object demo/CMakeFiles/multi_gpu_model_infer.dir/__/model_deploy/ppseg/src/seg_model.cpp.o
[ 76%] Building CXX object demo/CMakeFiles/model_infer.dir/__/model_deploy/paddlex/src/x_model.cpp.o
[ 78%] Building CXX object demo/CMakeFiles/model_infer.dir/__/model_deploy/paddlex/src/x_postprocess.cpp.o
[ 80%] Building CXX object demo/CMakeFiles/batch_infer.dir/__/model_deploy/paddlex/src/x_postprocess.cpp.o
[ 81%] Building CXX object demo/CMakeFiles/multi_gpu_model_infer.dir/__/model_deploy/ppseg/src/seg_postprocess.cpp.o
[ 83%] Building CXX object demo/CMakeFiles/multi_gpu_model_infer.dir/__/model_deploy/ppseg/src/seg_preprocess.cpp.o
make[2]: *** No rule to make target '/libcudnn.so', needed by 'demo/model_infer'.  Stop.
make[2]: *** Waiting for unfinished jobs....
[ 84%] Building CXX object demo/CMakeFiles/model_infer.dir/__/model_deploy/paddlex/src/x_preprocess.cpp.o
make[2]: *** No rule to make target '/libcudnn.so', needed by 'demo/batch_infer'.  Stop.
make[2]: *** Waiting for unfinished jobs....
[ 86%] Building CXX object demo/CMakeFiles/batch_infer.dir/__/model_deploy/paddlex/src/x_preprocess.cpp.o
[ 87%] Building CXX object demo/CMakeFiles/multi_gpu_model_infer.dir/__/model_deploy/ppclas/src/clas_model.cpp.o
[ 89%] Building CXX object demo/CMakeFiles/multi_gpu_model_infer.dir/__/model_deploy/ppclas/src/clas_postprocess.cpp.o
CMakeFiles/Makefile2:163: recipe for target 'demo/CMakeFiles/model_infer.dir/all' failed
make[1]: *** [demo/CMakeFiles/model_infer.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 90%] Building CXX object demo/CMakeFiles/multi_gpu_model_infer.dir/__/model_deploy/ppclas/src/clas_preprocess.cpp.o
CMakeFiles/Makefile2:200: recipe for target 'demo/CMakeFiles/batch_infer.dir/all' failed
make[1]: *** [demo/CMakeFiles/batch_infer.dir/all] Error 2
[ 92%] Building CXX object demo/CMakeFiles/multi_gpu_model_infer.dir/__/model_deploy/paddlex/src/x_model.cpp.o
[ 93%] Building CXX object demo/CMakeFiles/multi_gpu_model_infer.dir/__/model_deploy/paddlex/src/x_postprocess.cpp.o
make[2]: *** No rule to make target '/libcudnn.so', needed by 'demo/multi_gpu_model_infer'.  Stop.
make[2]: *** Waiting for unfinished jobs....
[ 95%] Building CXX object demo/CMakeFiles/multi_gpu_model_infer.dir/__/model_deploy/paddlex/src/x_preprocess.cpp.o
CMakeFiles/Makefile2:126: recipe for target 'demo/CMakeFiles/multi_gpu_model_infer.dir/all' failed
make[1]: *** [demo/CMakeFiles/multi_gpu_model_infer.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
FlyingQianMM commented 3 years ago
截屏2021-08-30 上午10 17 14

看下这个路径下有没有libcudnn.so,没有的话,find后填入libcudnn.so所在路径即可

TitansWhale commented 3 years ago
截屏2021-08-30 上午10 17 14

看下这个路径下有没有libcudnn.so,没有的话,find后填入libcudnn.so所在路径即可

构建时候在/usr/lib/aarch64-linux-gnu/是存在libcudnn.so这个文件。

nano@nano-desktop:~/project/PaddleX/deploy/cpp$ find /usr/lib/aarch64-linux-gnu/| grep libcudnn.so
/usr/lib/aarch64-linux-gnu/libcudnn.so.8.0.0
/usr/lib/aarch64-linux-gnu/libcudnn.so
/usr/lib/aarch64-linux-gnu/libcudnn.so.8