DeepStream5.0系列之环境安装

点击查看系列文章目录

在前边的文章《DeepStream4.0系列之环境配置安装》中,我们介绍过deepstream4.0 SDK的安装方法,最近deepstream更新到5.0版本,因此介绍一下5.0的安装方法。

官网介绍SDK的运行环境如下(T4环境),jetson环境下刷完jetpack依赖就都装好了

0 Jetson安装方法

安装依赖

sudo apt install libssl1.0.0  libgstreamer1.0-0 gstreamer1.0-tools gstreamer1.0-plugins-good gstreamer1.0-plugins-bad     gstreamer1.0-plugins-ugly gstreamer1.0-libav libgstrtspserver-1.0-0 libjansson4

sudo apt-get install libgstreamer1.0-0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio libgstrtspserver-1.0-dev gstreamer1.0-rtsp

sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev

sudo apt-get install libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev libgstrtspserver-1.0-dev libx11-dev libgstrtspserver-1.0-dev gstreamer1.0-rtsp ffmpeg

sudo apt-get install libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev libgstrtspserver-1.0-dev libx11-dev libjson-glib-dev

下载jetson对应的SDK,解压到opt目录下

sudo tar -jxvf deepstream_sdk_5.0_jetson.tbz2 -C /
cd /opt/nvidia/deepstream/deepstream-5.0/
sudo ./install.sh
sudo ldconfig

添加环境变量

sudo vim /etc/ld.so.conf
/opt/nvidia/deepstream/deepstream-5.0/lib/       //在文本后边添加该路径
sudo ldconfig    //执行ldconfig立即生效

1 x86安装方法

1.1显卡驱动安装

参考《NVIDIA之显卡驱动安装方法

1.2 下载SDK

官网下载SDK压缩包并解压

sudo tar -jxvf deepstream_sdk_v5.0.0_x86_64.tbz2 -C /

如果之前安装过4.0版本的SDK,则先卸载掉

cd /opt/nvidia/deepstream/deepstream-5.0
sudo vim uninstall.sh 
//打开后,设置PREV_DS_VER=4.0
sudo ./uninstall.sh

安装依赖,同jetson安装部分

1.3 安装cuda10.2

安装方法参考《Linux之cuda、cudnn版本切换》,注意要选对自己需要的版本,我的版本如下

wget http://developer.download.nvidia.com/compute/cuda/10.2/Prod/local_installers/cuda_10.2.89_440.33.01_linux.run
sudo bash cuda_10.2.89_440.33.01_linux.run

安装好cuda10.2后,需要配套安装cudnn7.6,这是tensorrt7.0的需求,同样参考上边链接中的方法安装cudnn。

如果cuda和cudnn安装的有问题,运行时会报错如下

ERROR from sink_sub_bin_encoder1: Device '/dev/nvhost-msenc' failed during initialization
Debug info: gstv4l2object.c(4052): gst_v4l2_object_set_format_full (): /GstPipeline:pipeline/GstBin:processing_bin_0/GstBin:sink_bin/GstBin:sink_sub_bin1/nvv4l2h264enc:sink_sub_bin_encoder1:
Call to S_FMT failed for YM12 @ 1280x720: Unknown error -1

 这个时候检查一下安装是否有问题

1.4 安装tensorrt7.0

安装方法参考《TensorRT安装及使用教程

1.5 安装librdkafka

$ git clone https://github.com/edenhill/librdkafka.git
$ cd librdkafka
$ git reset --hard 7101c2310341ab3f4675fc565f64f0967e135a6a
$ ./configure
$ make
$ sudo make install
$ sudo cp /usr/local/lib/librdkafka* /opt/nvidia/deepstream/deepstream-5.0/lib

1.6 安装opencv

方法参考《DeepStream4.0系列之环境配置安装》中2.4章节,注意替换opencv版本和cuda版本信息

这里只把cmake的内容贴一下,其它的步骤类似

cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr -D BUILD_PNG=OFF -D BUILD_TIFF=OFF -D BUILD_TBB=OFF -D BUILD_JPEG=OFF -D BUILD_JASPER=OFF -D BUILD_ZLIB=OFF -D BUILD_EXAMPLES=OFF -D BUILD_opencv_java=OFF -D BUILD_opencv_python2=ON -D BUILD_opencv_python3=ON -D ENABLE_PRECOMPILED_HEADERS=OFF -D WITH_OPENCL=OFF -D WITH_OPENMP=OFF -D WITH_FFMPEG=ON -D WITH_GSTREAMER=ON -D WITH_CUDA=ON -D WITH_GTK=ON -D WITH_VTK=ON -D WITH_TBB=ON -D WITH_1394=OFF -D WITH_OPENEXR=OFF -D OPENCV_EXTRA_MODULES_PATH=/home/nvidia/opencv3.4.0/opencv_contrib-3.4.0/modules/ -D CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-10.2 -D CUDA_ARCH_BIN=7.5  -D INSTALL_C_EXAMPLES=ON -D INSTALL_TESTS=OFF ..

1.7 安装deepstream

$ cd /opt/nvidia/deepstream/deepstream-5.0/
$ sudo ./install.sh
$ sudo ldconfig

至此deepstream5.0安装完成,输入deepstream-app --version-all 来查看安装的版本,得到输出如下

deepstream-app version 5.0.0
DeepStreamSDK 5.0.0
CUDA Driver Version: 10.2
CUDA Runtime Version: 10.2
TensorRT Version: 7.0
cuDNN Version: 7.6
libNVWarp360 Version: 2.0.1d3

如果运行时报错提示找不到一些库,如libnvdsgst_meta.so,则需要把deepstream-5.0/lib添加到系统lib路径中,如下

sudo vim /etc/ld.so.conf
/opt/nvidia/deepstream/deepstream-5.0/lib/       //在文本后边添加该路径
sudo ldconfig    //执行ldconfig立即生效

然后再执行就可以了

已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 游动-白 设计师:白松林 返回首页