如何在openEuler-22.03-LTS版本上安装TensorRT?

1.安装cuda,根据nvidia-smi显卡驱动上面的提示安装小于该版本号的cuda。

2.安装TensorRT:
下载对应的版本TensorRT:
https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/secure/8.6.1/tars/TensorRT-8.6.1.6.Linux.x86_64-gnu.cuda-12.0.tar.gz

2.解压安装包到安装位置:
$tar xvf TensorRT-8.6.1.6.Linux.x86_64-gnu.cuda-12.0.tar.gz

3.编译测试用例:
$cd /home/storage/TensorRT/TensorRT-8.6.1.6/samples
$make

4.添加库到LD_LIBRARY_PATH环境变量中:
$export LD_LIBRARY_PATH=/home/storage/TensorRT/TensorRT-8.6.1.6/targets/x86_64-linux-gnu/lib:$LD_LIBRARY_PATH

5.执行测试用例验证安装是否成功:
$cd /home/storage/TensorRT/TensorRT-8.6.1.6/targets/x86_64-linux-gnu/bin
$./sample_onnx_mnist

1 Like