參考 TensorRT Open Source Software
參考 Ubuntu 安裝 DeepStream 使用 Docker 部分
在 DeepStream Platform and OS Compatibility 文件中
DS 6.0.1
CUDA 11.4.1
cuDNN 8.2+
TRT 8.0.1
Driver R470.63.01
在 nvcr.io/nvidia/deepstream:6.0.1-devel Docker 中
Deepstream 6.0.1
TensorRT 8.0.1-1 + cuda11.3
替換 nvidia driver,不然會產生錯誤
Failed to establish dbus connection
$ apt list --installed|grep nvidia
$ sudo ubuntu-drivers devices
$ sudo apt-get remove --purge nvidia-driver-495
$ sudo apt-get install nvidia-driver-470
$ sudo reboot
確認 CUDA, TensorRT 安裝的版本
$ dpkg -l | grep -i cuda-cuda
$ dpkg -L cuda-cudart-11-5
$ dpkg -l | grep TensorRT
準備 DeepStream 開發用 Docker
$ docker pull nvcr.io/nvidia/deepstream:6.0.1-devel
$ xhost +
access control disabled, clients can connect from any host
$ sudo docker run --gpus ""device=0"" -it --rm --net=host -v /tmp/.X11-unix:/tmp/.X11-unix -v /etc/localtime:/etc/localtime -e DISPLAY=$DISPLAY -w /opt/nvidia/deepstream/deepstream-6.0 nvcr.io/nvidia/deepstream:6.0.1-devel
# cd samples/configs/deepstream-app
# deepstream-app -c source4_1080p_dec_infer-resnet_tracker_sgie_tiled_display_int8.txt
# cd /opt/nvidia/deepstream/deepstream-6.0/sources/apps/sample_apps
/deepstream-app
# export CUDA_VER=11.4
# make
# exit
準備 TensorRT OSS 編譯環境 Docker
$ git clone -b master https://github.com/nvidia/TensorRT TensorRT_OSS-8.0.1
$ cd TensorRT_OSS-8.0.1
$ git tag -n
$ git checkout 8.0.1
$ git describe --tags
8.0.1
$ git submodule update --init --recursive
$ cat docker/ubuntu-18.04.Dockerfile | grep CUDA_VERSION
ARG CUDA_VERSION=11.3.1
$ ./docker/build.sh --file docker/ubuntu-18.04.Dockerfile --tag tensorrt-ubuntu18.04-cuda11.3.1 --cuda 11.3.1
$ ./docker/launch.sh --tag tensorrt-ubuntu18.04-cuda11.3.1 --gpus all
$ cd TensorRT
$ mkdir -p build && cd build
$ cmake .. -DTRT_LIB_DIR=$TRT_LIBPATH -DTRT_OUT_DIR=`pwd`/out
$ make -j$(nproc)
$ exit
下載主要程式,須注意版本
$ git clone https://github.com/NVIDIA-AI-IOT/deepstream_tao_apps.git
$ sudo apt install gitk
$ git branch -r
$ git checkout release/tao3.0_ds6.0.1
$ git log -1
$ sudo docker run --gpus all -it --rm --net=host \
-v /etc/localtime:/etc/localtime \
-v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY \
-v /your_path_to/Data/TensorRT/TensorRT_OSS-8.0.1:/home/TensorRT \
-v /your_path_to/Data/DeepStream/deepstream_tao_apps:/home/deepstream_tao_apps \
-w /opt/nvidia/deepstream/deepstream-6.0 nvcr.io/nvidia/deepstream:6.0.1-devel
# cd /home/deepstream_tao_apps/
# ./download_models.sh
# export CUDA_VER=11.4
# make
# cp /home/TensorRT/build/out/libnvinfer_plugin.so.8.0.1 /usr/lib/x86_64-linux-gnu/
# ./apps/tao_detection/ds-tao-detection -c configs/frcnn_tao/pgie_frcnn_tao_config.txt -i /opt/nvidia/deepstream/deepstream-6.0/samples/streams/sample_720p.h264 -d
# cd /opt/nvidia/deepstream/deepstream-6.0/sources/gst-plugins/gst-nvdsvideotemplate/
# make
# cp libnvdsgst_videotemplate.so /opt/nvidia/deepstream/deepstream-6.0/lib/gst-plugins/
# rm -rf ~/.cache/gstreamer-1.0/
# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/nvidia/deepstream/deepstream/lib/cvcore_libs
# cd /home/deepstream_tao_apps/apps/tao_others/deepstream-gaze-app
# ./deepstream-gaze-app 3 ../../../configs/facial_tao/sample_faciallandmarks_config.txt $URI ./gazenet
# cd ../deepstream-gesture-app
# ./deepstream-gesture-app 3 3 ../../../configs/bodypose2d_tao/sample_bodypose2d_model_config.txt $URI ./gesture
# cd ../deepstream-bodypose2d-app/
# ./deepstream-bodypose2d-app 3 ../../../configs/bodypose2d_tao/sample_bodypose2d_model_config.txt $URI ./body2dout
# cd ../deepstream-faciallandmark-app/
# ./deepstream-faciallandmark-app 3 ../../../configs/facial_tao/sample_faciallandmarks_config.txt $URI ./landmarks
# cd ../deepstream-emotion-app/
# ./deepstream-emotion-app 3 ../../../configs/facial_tao/sample_faciallandmarks_config.txt $URI ./landmarks
在 Jeston 上測試
$ docker pull nvcr.io/nvidia/l4t-base:r32.4.3
$ xhost +
$ sudo docker run -it --rm --net=host --runtime nvidia -e DISPLAY=$DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix nvcr.io/nvidia/l4t-base:r32.4.3
# export URI=rtsp://user:passwd@192.168.0.108:554/live1s2.sdp
# gst-launch-1.0 uridecodebin uri=$URI name=d d. ! nvvidconv ! nvegltransform ! nveglglessink
# gst-launch-1.0 uridecodebin uri=$URI name=d d. ! nvvidconv ! nvoverlaysink
沒有留言:
張貼留言