PaddlePaddle / FastDeploy

⚡️An Easy-to-use and Fast Deep Learning Model Deployment Toolkit for ☁️Cloud 📱Mobile and 📹Edge. Including Image, Video, Text and Audio 20+ main stream scenarios and 150+ SOTA models with end-to-end optimization, multi-platform and multi-framework support.
https://www.paddlepaddle.org.cn/fastdeploy
Apache License 2.0
2.83k stars 444 forks source link

FastDeploy Streamer 容器内编译时报错 #2164

Open BingerOne opened 11 months ago

BingerOne commented 11 months ago

环境

文档进行编译报错

©°©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©´
    ©¦                 ? MobaXterm Personal Edition v22.1 ?                 ©¦
    ©¦               (SSH client, X server and network tools)               ©¦
    ©¦                                                                      ©¦
    ©¦ ? Linux distribution: ¬³Ubuntu-20.04                                 ©¦
    ©¦ ? Windows drives are mounted into /mnt path (by default)             ©¦
    ©¦ ? WSL DISPLAY is automatically redirected to Windows desktop         ©¦
    ©¦ ? WSL filesystem is accessible in the sidebar browser                ©¦
    ©¦ ? For more info, ctrl+click on help or visit our website.            ©¦
    ©¸©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¤©¼

root@DESKTOP-Q6I8OIT:~# docker pull nvcr.io/nvidia/deepstream:6.1.1-devel
6.1.1-devel: Pulling from nvidia/deepstream
3b65ec22a9e9: Pull complete
9bfa49b064c8: Pull complete
cde16ef91ac2: Pull complete
978ea3dcd5fb: Pull complete
6c10428f3e1b: Pull complete
25e1b86ea3b6: Pull complete
ab995ea0d0d0: Pull complete
25c7edfc13eb: Pull complete
daf4a0e65bea: Pull complete
de971f9d549d: Pull complete
50dab9e483e1: Pull complete
de899c7862b6: Pull complete
8fe477dfad89: Pull complete
a261481bfaab: Pull complete
7b029a04870b: Pull complete
4b0e8b21c6bd: Pull complete
9e45c75de592: Pull complete
cb09c3fa7d9b: Pull complete
f7aa1cebe3e3: Pull complete
e1241e0526e4: Pull complete
f7eb22717653: Pull complete
2fe53a7e46c3: Pull complete
6413c7c07022: Pull complete
576f2c7da8dc: Pull complete
85dfa125f287: Pull complete
2fcbf0777988: Pull complete
b0528175e25b: Pull complete
8da62e68245e: Pull complete
ff3153ab1387: Pull complete
5af267027073: Pull complete
213a2dc2d850: Pull complete
287570f14f24: Pull complete
9a420b8e7945: Pull complete
1c6a323a9e2f: Pull complete
3c007dfa45bb: Pull complete
1de3849df1aa: Pull complete
f71cb0b15ba2: Pull complete
d35a829e8cbf: Pull complete
b46163547405: Pull complete
818b7d5c4db7: Pull complete
fdda6666feb6: Pull complete
60bf999d8bfb: Pull complete
Digest: sha256:6aac2e6cd547192b6e16202cef72c3625e5cde0feddb285566433d649081caaa
Status: Downloaded newer image for nvcr.io/nvidia/deepstream:6.1.1-devel
nvcr.io/nvidia/deepstream:6.1.1-devel
root@DESKTOP-Q6I8OIT:~# xhost +

Command 'xhost' not found, but can be installed with:

apt install x11-xserver-utils

root@DESKTOP-Q6I8OIT:~# apt install ^C
root@DESKTOP-Q6I8OIT:~# apt install x11-xserver-utils
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  cpp cpp-9 gcc-9-base libisl22 libmpc3 libxcursor1
Suggested packages:
  cpp-doc gcc-9-locales nickle cairo-5c xorg-docs-core
The following NEW packages will be installed:
  cpp cpp-9 gcc-9-base libisl22 libmpc3 libxcursor1 x11-xserver-utils
0 upgraded, 7 newly installed, 0 to remove and 58 not upgraded.
Need to get 8362 kB of archives.
After this operation, 29.9 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 gcc-9-base amd64 9.4.0-1ubuntu1~20.04.1 [19.4 kB]
Get:2 http://archive.ubuntu.com/ubuntu focal/main amd64 libisl22 amd64 0.22.1-1 [592 kB]
Get:3 http://archive.ubuntu.com/ubuntu focal/main amd64 libmpc3 amd64 1.1.0-1 [40.8 kB]
Get:4 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 cpp-9 amd64 9.4.0-1ubuntu1~20.04.1 [7500 kB]
Get:5 http://archive.ubuntu.com/ubuntu focal/main amd64 cpp amd64 4:9.3.0-1ubuntu2 [27.6 kB]
Get:6 http://archive.ubuntu.com/ubuntu focal/main amd64 libxcursor1 amd64 1:1.2.0-2 [20.1 kB]
Get:7 http://archive.ubuntu.com/ubuntu focal/main amd64 x11-xserver-utils amd64 7.7+8 [162 kB]
Fetched 8362 kB in 4s (1993 kB/s)
Selecting previously unselected package gcc-9-base:amd64.
(Reading database ... 33089 files and directories currently installed.)
Preparing to unpack .../0-gcc-9-base_9.4.0-1ubuntu1~20.04.1_amd64.deb ...
Unpacking gcc-9-base:amd64 (9.4.0-1ubuntu1~20.04.1) ...
Selecting previously unselected package libisl22:amd64.
Preparing to unpack .../1-libisl22_0.22.1-1_amd64.deb ...
Unpacking libisl22:amd64 (0.22.1-1) ...
Selecting previously unselected package libmpc3:amd64.
Preparing to unpack .../2-libmpc3_1.1.0-1_amd64.deb ...
Unpacking libmpc3:amd64 (1.1.0-1) ...
Selecting previously unselected package cpp-9.
Preparing to unpack .../3-cpp-9_9.4.0-1ubuntu1~20.04.1_amd64.deb ...
Unpacking cpp-9 (9.4.0-1ubuntu1~20.04.1) ...
Selecting previously unselected package cpp.
Preparing to unpack .../4-cpp_4%3a9.3.0-1ubuntu2_amd64.deb ...
Unpacking cpp (4:9.3.0-1ubuntu2) ...
Selecting previously unselected package libxcursor1:amd64.
Preparing to unpack .../5-libxcursor1_1%3a1.2.0-2_amd64.deb ...
Unpacking libxcursor1:amd64 (1:1.2.0-2) ...
Selecting previously unselected package x11-xserver-utils.
Preparing to unpack .../6-x11-xserver-utils_7.7+8_amd64.deb ...
Unpacking x11-xserver-utils (7.7+8) ...
Setting up libxcursor1:amd64 (1:1.2.0-2) ...
Setting up libmpc3:amd64 (1.1.0-1) ...
Setting up libisl22:amd64 (0.22.1-1) ...
Setting up gcc-9-base:amd64 (9.4.0-1ubuntu1~20.04.1) ...
Setting up cpp-9 (9.4.0-1ubuntu1~20.04.1) ...
Setting up cpp (4:9.3.0-1ubuntu2) ...
Setting up x11-xserver-utils (7.7+8) ...
Processing triggers for libc-bin (2.31-0ubuntu9.9) ...
/sbin/ldconfig.real: Can't link /usr/lib/wsl/lib/libnvoptix_loader.so.1 to libnvoptix.so.1
/sbin/ldconfig.real: /usr/lib/wsl/lib/libcuda.so.1 is not a symbolic link

Processing triggers for man-db (2.9.1-1) ...
root@DESKTOP-Q6I8OIT:~# xhost +
access control disabled, clients can connect from any host
root@DESKTOP-Q6I8OIT:~# docker run --gpus all -it --rm --net=host --privileged -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY -w /opt/nvidia/deepstream/deepstream-6.1.1-devel nvcr.io/nvidia/deepstream:6.1.1-devel
root@docker-desktop:/opt/nvidia/deepstream/deepstream-6.1.1-devel# cd ~
root@docker-desktop:~# pwd
/root
root@docker-desktop:~# ls
top
root@docker-desktop:~# git clone -b release/1.0.7 https://github.com/PaddlePaddle/FastDeploy
Cloning into 'FastDeploy'...
remote: Enumerating objects: 40787, done.
remote: Counting objects: 100% (7030/7030), done.
remote: Compressing objects: 100% (1732/1732), done.
remote: Total 40787 (delta 5571), reused 5771 (delta 5278), pack-reused 33757
Receiving objects: 100% (40787/40787), 37.75 MiB | 537.00 KiB/s, done.
Resolving deltas: 100% (21353/21353), done.
root@docker-desktop:~# cd FastDeploy/streamer/
root@docker-desktop:~/FastDeploy/streamer# mkdir build && cd build/
root@docker-desktop:~/FastDeploy/streamer/build# python -V
Python 2.7.18
root@docker-desktop:~/FastDeploy/streamer/build# python3 -V
Python 3.8.10
root@docker-desktop:~/FastDeploy/streamer/build# pip list
Package             Version
------------------- --------------------
certifi             2019.11.28
chardet             3.0.4
dbus-python         1.2.16
distro-info         0.23ubuntu1
graphsurgeon        0.4.6
idna                2.8
meson               0.53.2
pip                 20.0.2
PyGObject           3.36.0
python-apt          2.0.0+ubuntu0.20.4.7
python-dbusmock     0.19
PyYAML              6.0
requests            2.22.0
requests-unixsocket 0.2.0
setuptools          45.2.0
six                 1.14.0
tensorrt            8.4.1.5
uff                 0.6.9
unattended-upgrades 0.1
urllib3             1.25.8
wheel               0.34.2
root@docker-desktop:~/FastDeploy/streamer/build# wget https://bj.bcebos.com/fastdeploy/release/cpp/fastdeploy-linux-x64-1.0.7.tgz
--2023-08-16 05:46:37--  https://bj.bcebos.com/fastdeploy/release/cpp/fastdeploy-linux-x64-1.0.7.tgz
Resolving bj.bcebos.com (bj.bcebos.com)... 36.110.192.178, 36.110.192.178, 2409:8c04:1001:1002:0:ff:b001:368a, ...
Connecting to bj.bcebos.com (bj.bcebos.com)|36.110.192.178|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 188450981 (180M) [application/octet-stream]
Saving to: 'fastdeploy-linux-x64-1.0.7.tgz'

fastdeploy-linux-x64-1.0.7.tgz                    100%[==========================================================================================================>] 179.72M  40.6MB/s    in 4.6s

2023-08-16 05:46:42 (38.9 MB/s) - 'fastdeploy-linux-x64-1.0.7.tgz' saved [188450981/188450981]
root@docker-desktop:~/FastDeploy/streamer/build# tar xvf fastdeploy-linux-x64-1.0.7.tgz
...
root@docker-desktop:~/FastDeploy/streamer/build# pwd
/root/FastDeploy/streamer/build
root@docker-desktop:~/FastDeploy/streamer/build# cmake .. -DFASTDEPLOY_INSTALL_DIR=${PWD}/fastdeploy-linux-x64-1.0.7
-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.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
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- Checking for modules 'gstreamer-app-1.0;gstreamer-video-1.0'
--   Found gstreamer-app-1.0, version 1.16.3
--   Found gstreamer-video-1.0, version 1.16.3
-- The path of ONNXRuntime is /root/FastDeploy/streamer/build/fastdeploy-linux-x64-1.0.7/third_libs/install/onnxruntime/lib.
-- OPENVINO_LIBS = /root/FastDeploy/streamer/build/fastdeploy-linux-x64-1.0.7/third_libs/install/openvino/runtime/lib/libopenvino.so;TBB::tbb;TBB::tbbmalloc;TBB::tbbmalloc_proxy
-- The path of OpenCV is /root/FastDeploy/streamer/build/fastdeploy-linux-x64-1.0.7/third_libs/install/opencv.
-- Found OpenCV: /root/FastDeploy/streamer/build/fastdeploy-linux-x64-1.0.7/third_libs/install/opencv (found version "3.4.16")
--
-- *************FastDeploy Building Summary**********
--   CMake version             : 3.15.2
--   CMake command             : /usr/local/bin/cmake
--   System                    : Linux
--   C++ compiler              : /usr/bin/c++
--   C++ compiler version      : 9.4.0
--   CXX flags                 : -Wno-format
--   EXE linker flags          :
--   Shared linker flags       :
--   Build type                :
--   Compile definitions       : _GLIBCXX_USE_CXX11_ABI=1
--   CMAKE_PREFIX_PATH         :
--   CMAKE_INSTALL_PREFIX      : /usr/local
--   CMAKE_MODULE_PATH         :
--
--   FastDeploy version        : 1.0.7
--   ENABLE_ORT_BACKEND        : ON
--   ENABLE_RKNPU2_BACKEND     : OFF
--   ENABLE_HORIZON_BACKEND    : OFF
--   ENABLE_SOPHGO_BACKEND     : OFF
--   ENABLE_PADDLE_BACKEND     : ON
--   ENABLE_LITE_BACKEND       : OFF
--   ENABLE_POROS_BACKEND      : OFF
--   ENABLE_TRT_BACKEND        : OFF
--   ENABLE_OPENVINO_BACKEND   : ON
--   ENABLE_BENCHMARK          : OFF
--   ENABLE_VISION             : ON
--   ENABLE_TEXT               : ON
--   ENABLE_ENCRYPTION         : OFF
--   ENABLE_FLYCV              : OFF
--   ENABLE_CVCUDA             : OFF
--   WITH_GPU                  : OFF
--   WITH_IPU                  : OFF
--   WITH_OPENCL               : OFF
--   WITH_TESTING              : OFF
--   WITH_ASCEND               : OFF
--   WITH_DIRECTML             : OFF
--   WITH_TIMVX                : OFF
--   WITH_KUNLUNXIN            : OFF
--   WITH_CAPI                 : ON
--   WITH_CSHARPAPI            : OFF
--   ONNXRuntime version       :
--   Paddle Inference version  : 0.0.0.660f781b77
--   OpenVINO version          : dev.2023.03.2
--   DEPENDENCY_LIBS           : /root/FastDeploy/streamer/build/fastdeploy-linux-x64-1.0.7/lib/libfastdeploy.so;/root/FastDeploy/streamer/build/fastdeploy-linux-x64-1.0.7/third_libs/install/onnxruntime/lib/libonnxruntime.so;/root/FastDeploy/streamer/build/fastdeploy-linux-x64-1.0.7/third_libs/install/paddle_inference/paddle/lib/libpaddle_inference.so;/root/FastDeploy/streamer/build/fastdeploy-linux-x64-1.0.7/third_libs/install/paddle_inference/third_party/install/mkldnn/lib/libmkldnn.so.0;/root/FastDeploy/streamer/build/fastdeploy-linux-x64-1.0.7/third_libs/install/paddle_inference/third_party/install/mklml/lib/libiomp5.so;/root/FastDeploy/streamer/build/fastdeploy-linux-x64-1.0.7/third_libs/install/openvino/runtime/lib/libopenvino.so;TBB::tbb;TBB::tbbmalloc;TBB::tbbmalloc_proxy;opencv_calib3d;opencv_core;opencv_dnn;opencv_features2d;opencv_flann;opencv_highgui;opencv_imgcodecs;opencv_imgproc;opencv_ml;opencv_objdetect;opencv_photo;opencv_shape;opencv_stitching;opencv_superres;opencv_video;opencv_videoio;opencv_videostab;/root/FastDeploy/streamer/build/fastdeploy-linux-x64-1.0.7/third_libs/install/fast_tokenizer/lib/libcore_tokenizers.so;/root/FastDeploy/streamer/build/fastdeploy-linux-x64-1.0.7/third_libs/install/paddle2onnx/lib/libpaddle2onnx.so
-- Configuring done
-- Generating done
-- Build files have been written to: /root/FastDeploy/streamer/build
root@docker-desktop:~/FastDeploy/streamer/build# make -j
Scanning dependencies of target fd_streamer
Scanning dependencies of target gstfdmeta
Scanning dependencies of target gstfdtracker
[  4%] Building CXX object src/gstreamer/meta/CMakeFiles/gstfdmeta.dir/meta.cc.o
[  9%] Building CXX object src/gstreamer/plugin/fdtracker/CMakeFiles/gstfdtracker.dir/gstfdtracker.cc.o
[ 14%] Building CXX object src/gstreamer/plugin/fdtracker/CMakeFiles/gstfdtracker.dir/src/kalmantracker.cpp.o
[ 19%] Building CXX object src/gstreamer/plugin/fdtracker/CMakeFiles/gstfdtracker.dir/src/ocsort.cpp.o
[ 23%] Building CXX object src/gstreamer/plugin/fdtracker/CMakeFiles/gstfdtracker.dir/src/lapjv.cpp.o
[ 28%] Building CXX object src/gstreamer/plugin/fdtracker/CMakeFiles/gstfdtracker.dir/src/trajectory.cpp.o
[ 33%] Building CXX object CMakeFiles/fd_streamer.dir/src/app/base_app.cc.o
[ 38%] Building CXX object CMakeFiles/fd_streamer.dir/src/app/video_analytics.cc.o
[ 42%] Building CXX object CMakeFiles/fd_streamer.dir/src/app/video_decoder.cc.o
[ 52%] Building CXX object CMakeFiles/fd_streamer.dir/src/app/yaml_parser.cc.o
[ 52%] Building CXX object CMakeFiles/fd_streamer.dir/src/fd_streamer.cc.o
[ 57%] Building CXX object CMakeFiles/fd_streamer.dir/src/gstreamer/perf.cc.o
[ 61%] Building CXX object CMakeFiles/fd_streamer.dir/src/gstreamer/meta/meta.cc.o
[ 66%] Building CXX object CMakeFiles/fd_streamer.dir/src/gstreamer/utils.cc.o
[ 71%] Building CXX object CMakeFiles/fd_streamer.dir/src/deepstream/bbox_parser.cc.o
In file included from /usr/include/x86_64-linux-gnu/NvInferLegacyDims.h:16,
                 from /usr/include/x86_64-linux-gnu/NvInfer.h:16,
                 from /usr/include/x86_64-linux-gnu/NvCaffeParser.h:16,
                 from /opt/nvidia/deepstream/deepstream/sources/includes/nvdsinfer_custom_impl.h:126,
                 from /root/FastDeploy/streamer/src/deepstream/bbox_parser.cc:15:
/usr/include/x86_64-linux-gnu/NvInferRuntimeCommon.h:19:10: fatal error: cuda_runtime_api.h: No such file or directory
   19 | #include <cuda_runtime_api.h>
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/fd_streamer.dir/build.make:167: CMakeFiles/fd_streamer.dir/src/deepstream/bbox_parser.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 76%] Linking CXX shared library libgstfdmeta.so
[ 76%] Built target gstfdmeta
Scanning dependencies of target gstfdinfer
[ 80%] Building CXX object src/gstreamer/plugin/fdinfer/CMakeFiles/gstfdinfer.dir/fdinfer.cc.o
[ 85%] Building CXX object src/gstreamer/plugin/fdinfer/CMakeFiles/gstfdinfer.dir/fdmodel.cc.o
make[1]: *** [CMakeFiles/Makefile2:112: CMakeFiles/fd_streamer.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 90%] Linking CXX shared library libgstfdtracker.so
[ 90%] Built target gstfdtracker
[ 95%] Linking CXX shared library libgstfdinfer.so
[ 95%] Built target gstfdinfer
make: *** [Makefile:84: all] Error 2
root@docker-desktop:~/FastDeploy/streamer/build#
rainyfly commented 5 months ago

感觉是容器内的cuda环境没有配置好,找不到include需要的头文件