ubantu18.04 安装TensorRT
时间: 2024-10-15 10:01:47 浏览: 31
在Ubuntu 18.04上安装TensorRT(NVIDIA Deep Learning SDK的一部分),你需要先确保系统已更新并有 NVIDIA GPU支持。以下是安装步骤:
1. **更新软件包列表**:
```sh
sudo apt-get update
```
2. **安装依赖项** (如果你的显卡不是NVIDIA,可能需要安装CUDA和cuDNN):
```sh
sudo apt-get install -y curl software-properties-common
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
sudo apt-get install nvidia-driver nvidia-cuda-toolkit cudnn
```
或者根据你的GPU型号选择合适的驱动。
3. **访问TensorRT的官方发布页面**:
```
cd /tmp
wget https://developer.nvidia.com/compute/machine-learning/tensorrt/secure/GPG_KEY
wget https://developer.nvidia.com/compute/machine-learning/tensorrt/secure/tensorrt-repo_ubuntu18.04.tar.gz
tar xvf tensorrt-repo_ubuntu18.04.tar.gz
```
4. **添加TensorRT的apt源**:
```sh
sudo dpkg -i ./tensorrt-repo-*.deb
```
5. **更新并安装TensorRT**:
```sh
sudo apt-get update
sudo apt-get install libnvinfer7 libnvinfer-dev
```
6. **检查安装**:
```sh
tensorrt --version
```
阅读全文