1.remove old deepstream
$ sudo rm -rf /usr/local/deepstream /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstnv* /usr/bin/deepstream* /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libnvdsgst* /usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream* /opt/nvidia/deepstream/deepstream* $ sudo rm -rf /usr/lib/x86_64-linux-gnu/libv41/plugins/libcuvidv4l2_plugin.so
2.install dependencies
$ sudo apt install \ libssl1.1 \ libgstreamer1.0-0 \ gstreamer1.0-tools \ gstreamer1.0-plugins-good \ gstreamer1.0-plugins-bad \ gstreamer1.0-plugins-ugly \ gstreamer1.0-libav \ libgstreamer-plugins-base1.0-dev \ libgstrtspserver-1.0-0 \ libjansson4 \ libyaml-cpp-dev \ gcc \ make \ git \ python3
3.Install CUDA Toolkit 11.7.1 (CUDA 11.7 Update 1) and NVIDIA driver 515.65.01
install driver sudo ./NVIDIA-Linux-x86_64-515.65.01.run install cuda wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600 wget https://developer.download.nvidia.com/compute/cuda/11.7.1/local_installers/cuda-repo-ubuntu2004-11-7-local_11.7.1-515.65.01-1_amd64.deb sudo dpkg -i cuda-repo-ubuntu2004-11-7-local_11.7.1-515.65.01-1_amd64.deb sudo cp /var/cuda-repo-ubuntu2004-11-7-local/cuda-*-keyring.gpg /usr/share/keyrings/ sudo apt-get update sudo apt-get -y install cuda
如果安装cuda错误,重新安装驱动,再次安装cuda即可。
4.install cudnn
wget https://developer.nvidia.com/compute/cudnn/secure/8.4.1/local_installers/11.6/cudnn-local-repo-ubuntu2004-8.4.1.50_1.0-1_amd64.deb sudo dpkg -i cudnn-local-repo-ubuntu2004-8.4.1.50_1.0-1_amd64.deb sudo cp /var/cudnn-local-repo-ubuntu2004-8.4.1.50/cudnn-local-E3EC4A60-keyring.gpg /usr/share/keyrings/ sudo apt-get update sudo apt install libcudnn8=8.4.1.50-1+cuda11.6 libcudnn8-dev=8.4.1.50-1+cuda11.6
5. Install TensorRT 8.4.1.5
wget https://developer.download.nvidia.cn/compute/machine-learning/tensorrt/secure/8.4.1/local_repos/nv-tensorrt-repo-ubuntu2004-cuda11.6-trt8.4.1.5-ga-20220604_1-1_amd64.deb?qEMj7j8bsN2dxWF5GC53FHGJ52vqYMOXbm4N4UcGVRaUC2h5pw6zIV4NxG4QhjngyfzMz_12lmlw-9J47cCrm2lSsRm6Y7H_nzMspcLv-N76K9viO_1lxA3YgA3YlUL6pCuocv7Qv6NRbF59-lLVANPz08VcMp1AoHq3cniPPkb-s3vxlyEQ_IJIb4z0rExAGmXqOLpiV-Rxwzijh1CohG6X5aHFjARUphddlvnoWMTL8ozeZaFYgGi3_fAmWAiPqPFt&t=eyJscyI6ImdzZW8iLCJsc2QiOiJodHRwczpcL1wvd3d3Lmdvb2dsZS5jb21cLyJ9
sudo dpkg -i nv-tensorrt-repo-ubuntu2004-cuda11.6-trt8.4.1.5-ga-20220604_1-1_amd64.deb
sudo apt-key add /var/nv-tensorrt-repo-ubuntu2004-cuda11.6-trt8.4.1.5-ga-20220604/9a60d8bf.pub
sudo apt update
sudo apt-get install libnvinfer8=8.4.1-1+cuda11.6 libnvinfer-plugin8=8.4.1-1+cuda11.6 libnvparsers8=8.4.1-1+cuda11.6 \ libnvonnxparsers8=8.4.1-1+cuda11.6 libnvinfer-bin=8.4.1-1+cuda11.6 libnvinfer-dev=8.4.1-1+cuda11.6 \ libnvinfer-plugin-dev=8.4.1-1+cuda11.6 libnvparsers-dev=8.4.1-1+cuda11.6 libnvonnxparsers-dev=8.4.1-1+cuda11.6 \ libnvinfer-samples=8.4.1-1+cuda11.6 libcudnn8=8.4.1.50-1+cuda11.6 libcudnn8-dev=8.4.1.50-1+cuda11.6 \ python3-libnvinfer=8.4.1-1+cuda11.6 python3-libnvinfer-dev=8.4.1-1+cuda11.6
6. Install librdkafka
sudo apt install python git clone https://github.com/edenhill/librdkafka.git cd librdkafka git reset --hard 7101c2310341ab3f4675fc565f64f0967e135a6a ./configure make sudo make install sudo mkdir -p /opt/nvidia/deepstream/deepstream-6.1/lib sudo cp /usr/local/lib/librdkafka* /opt/nvidia/deepstream/deepstream-6.1/lib
7.Install the DeepStream6.1.1
$wget https://developer.nvidia.com/deepstream-6.1_6.1.1-1_amd64.deb
$ sudo apt-get install ./deepstream-6.1_6.1.1-1_amd64.deb
8.install torch环境
$wget https://download.pytorch.org/whl/cu116/torch-1.12.1%2Bcu116-cp38-cp38-linux_x86_64.whl
$wget https://download.pytorch.org/whl/cu102/torchvision-0.13.1%2Bcu102-cp38-cp38-linux_x86_64.whl$sudo apt install ./torch-1.12.1+cu116-cp38-cp38-linux_x86_64.whl
$sudo apt install ./torchvision-0.13.1+cu102-cp38-cp38-linux_x86_64.whl
9.finish