Ubuntu系统下Tensorrt环境配置
1. 官网下载安装包,最好拿别人下好的,没有梯子会很慢。
https://developer.nvidia.com/nvidia-tensorrt-download
2. 复制到/usr/local下并解压
sudo cp TensorRT-8.2.2.1.Linux.x86_64-gnu.cuda-11.4.cudnn8.2.tar.gz /usr/local
sudo tar -zxvf TensorRT-8.2.2.1.Linux.x86_64-gnu.cuda-11.4.cudnn8.2.tar.gz
3. 添加环境变量
vim ~/.bashrc
export LD_LIBRARY_PATH=/home/liguiyuan/software/TensorRT-7.0.0.11/lib:$LD_LIBRARY_PATH
source ~/.bashrc
/.profile 也可以加,理论上放profile下会更加合理。
4. profile 和 bashrc 的区别
~/.profile : 当用户登录时,该文件仅仅执行一次。默认情况下,他设置一些环境变量,执行用户的.bashrc文件。
~/.bashrc : 该文件包含专用于你的bash shell的bash信息,当登录时以及每次打开新的shell时,该该文件被读取。