wsl2-Ubuntu CUDA Tensorrt Deepstream安装配置

目录

    • 一.背景
    • 二.准备
    • 三.环境
    • 四.安装TensorRT
    • 五. 安装deepstream (案例目前无法运行)
    • 六.参考文档

一.背景

新版wsl2下cuda支持变的更好了,想试试cuda、tensorrt、deepstream,这样就不需要双系统了。

二.准备

首先wsl2下安装好ubuntu,cuda,cudnn

可参照一下文章安装:

https://blog.csdn.net/fyz_jkl/article/details/122792853

三.环境

win10 21H2
wsl2-ubuntu 18.04
Nvidia RTX2060
显卡驱动 511.79
cuda 11.6
cudnn 8.3.2
deepstream 6.0.1

四.安装TensorRT

  • 下载tar包

地址:
https://developer.nvidia.com/nvidia-tensorrt-download

  • 解压
 tar -xzvf TensorRT-8.4.0.6.Linux.x86_64-gnu.cuda-11.6.cudnn8.3.tar.gz
  • 添加环境变量
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/mnt/e/ProgramFiles/TensorRT-8.4.0.6/lib
  • 拷贝至系统路径
# TensorRT路径下
sudo cp -r ./lib/* /usr/lib
sudo cp -r ./include/* /usr/include
  • 安装python相关包
cd TensorRT-8.4.0.6/python
conda activate tensorRT
pip install tensorrt-8.4.0.6-cp36-none-linux_x86_64.whl

cd TensorRT-8.4.0.6/graphsurgeon
pip install graphsurgeon-0.4.5-py2.py3-none-any.whl

cd TensorRT-8.4.0.6/onnx_graphsurgeon
pip install onnx_graphsurgeon-0.3.12-py2.py3-none-any.whl
  • 案例测试
cd TensorRT-8.4.0.6/samples/sampleMNIST 
sudo make 
./../../bin/sample_mnist    #运行时占用gpu就说明成功
  • 总结
    上述sampleMNIST 案例运行成功;python中也可import成功。

五. 安装deepstream (案例目前无法运行)

  • 安装依赖
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 libjson-glib-dev
  • 查看gstreamer
dpkg -l | grep gstreamer
  • 下载tar包

下载链接:
https://developer.nvidia.com/deepstream-getting-started

  • 解压安装
sudo tar -jxvf deepstream_sdk_v6.0.1_x86_64.tbz2 -C /
cd /opt/nvidia/deepstream/deepstream-6.0/
sudo ./install.sh
sudo ldconfig
  • 查看是否成功
deepstream-app --version-all
  • 安装librdkafka
git clone https://github.com/edenhill/librdkafka.git
$ cd librdkafka
$ ./configure
$ make
$ sudo make install
$ sudo cp /usr/local/lib/librdkafka* /opt/nvidia/deepstream/deepstream-6.0/lib
  • 报错:/usr/lib/wsl/lib/libcuda.so.1 is not a symbolic

官网可查到解决方案:
https://github.com/microsoft/WSL/issues/5548

  • 未解决报错: Failed to create ‘primary_gie’

  • 未解决报错: Failed to create ‘secondary_gie_0’

  • 总结
    deepstream 安装是成功了,但是启动几个测试案例均报错失败。

六.参考文档

https://blog.csdn.net/fyz_jkl/article/details/122792853
https://blog.csdn.net/qq_34859576/article/details/119108275
https://github.com/microsoft/WSL/issues/5548

你可能感兴趣的:(ubuntu,linux)