ubuntu使用TensorRT配置
一、更新、安装基础依赖
sudo apt update && \
sudo apt upgrade -y && \
sudo apt install -y build-essential
二、准备文件
1.新建目录
mkdir TensorRT
2.下载文件
(1)TensorRT-8.4.3.1
网址
https://developer.nvidia.com/tensorrt
依次点击
(1)“Download now”(点击后需要登陆)
(2)“TensorRT 8”
(3)“I Agree To the Terms of the NVIDIA TensorRT License Agreement”
(4)“TensorRT 8.4 GA Update 2”
(5)“TensorRT 8.4 GA Update 2 for Linux x86_64 and CUDA 11.0, 11.1, 11.2, 11.3, 11.4, 11.5, 11.6 and 11.7 TAR Package”
下载文件:TensorRT-8.4.3.1.Linux.x86_64-gnu.cuda-11.6.cudnn8.4.tar.gz
下载后将文件放到新建的TensorRT目录中
三、解压文件
进入TensorRT目录
cd 你的具体目录/TensorRT
tar -xvf TensorRT-8.4.3.1.Linux.x86_64-gnu.cuda-11.6.cudnn8.4.tar.gz
四、配置环境
1.环境变量设置与更新
打开文件
sudo gedit /etc/profile
写入
export LD_LIBRARY_PATH=/home/heqingchun/soft/TensorRT/TensorRT-8.4.3.1/lib:$LD_LIBRARY_PATH
export PATH=/home/heqingchun/soft/TensorRT/TensorRT-8.4.3.1/bin:$PATH
更新
source /etc/profile
TensorRT-8.5.3.1
export LD_LIBRARY_PATH=/home/heqingchun/soft/TensorRT/TensorRT-8.5.3.1/lib:$LD_LIBRARY_PATH
export PATH=/home/heqingchun/soft/TensorRT/TensorRT-8.5.3.1/bin:$PATH
更新
source /etc/profile
TensorRT安装完毕