Ubuntu TensorRT安装

文章目录

    • 1.1环境
    • 1.2下载地址
      • 1)操作步骤
      • 2)添加环境变量
      • 3)检查是否安装成功
    • 2.1其它环境

1.1环境

1)Ubuntu20.04

2)cuda111+torch1.8.0+py38

1.2下载地址

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

1)操作步骤

Ubuntu TensorRT安装_第1张图片

conda activate 
cd /home/duduzai/Documents/TensorRT-8.0.1.6
cd python/
pip install tensorrt-8.0.1.6-cp38-none-linux_x86_64.whl 

Ubuntu TensorRT安装_第2张图片

2)添加环境变量

sudo find / -name "libnvinfer.so.*"
gedit ~/.bashrc
export LD_LIBRARY_PATH=/home/duduzai/TensorRT-8.0.1.6/targets/x86_64-linux-gnu/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/lib64:/usr/local/cuda-11.1/targets/x86_64-linux/lib:/home/duduzai/cuda+cudnn/cudnn-11.2-linux-x64-v8.1.1.33/cuda/lib64:$LD_LIBRARY_PATH
source ~/.bashrc

3)检查是否安装成功

import tensorrt as trt

print(trt.__version__)

Ubuntu TensorRT安装_第3张图片

2.1其它环境

pip install opencv-python
pip install tensorboard
pip install open3d

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