当前位置:   article > 正文

Linux下安装CUDA、CUDNN、TensorRT_linux系统安装tensorrt 8.6.1

linux系统安装tensorrt 8.6.1

Nvidia TensorRT support

CUDA

  1. wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
  2. sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
  3. wget https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda-repo-ubuntu2004-11-8-local_11.8.0-520.61.05-1_amd64.deb
  4. sudo dpkg -i cuda-repo-ubuntu2004-11-8-local_11.8.0-520.61.05-1_amd64.deb
  5. sudo cp /var/cuda-repo-ubuntu2004-11-8-local/cuda-*-keyring.gpg /usr/share/keyrings/
  6. sudo apt-get update
  7. sudo apt-get -y install cuda

配置环境变量

sudo gedit ~/.bashrc

在最后加入

  1. export PATH=/usr/local/cuda-11.8/bin${PATH:+:${PATH}}
  2. export LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

验证:

  1. nvidia-smi
  2. #或者
  3. nvcc -V
  4. #不好使重启试试

参考链接: CUDA Toolkit 11.8 Downloads | NVIDIA Developer

CUDNN

cuDNN Archive | NVIDIA Developer

下载需要注册Nvidia Develop账号,这里不再赘述

下载后

  1. sudo dpkg -i cudnn-local-repo-${distro}-8.x.x.x_1.0-1_amd64.deb
  2. sudo cp /var/cudnn-local-repo-*/cudnn-local-*-keyring.gpg /usr/share/keyrings/
  3. sudo apt-get update
  4. sudo apt-get install libcudnn8=8.x.x.x-1+cudaX.Y
  5. sudo apt-get install libcudnn8-dev=8.x.x.x-1+cudaX.Y
  6. sudo apt-get install libcudnn8-samples=8.x.x.x-1+cudaX.Y

(版本号和文件名使用Tab补全) 

如果之后找不到cudnn可以执行

  1. sudo cp cuda/include/cudnn* /usr/local/cuda/include
  2. sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64
  3. sudo chmod a+r /usr/local/cuda/include/cudnn* /usr/local/cuda/lib64/libcudnn*

参考链接:Installation Guide - NVIDIA Docs 

 TensorRT

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

下载需要注册Nvidia Develop账号,这里不再赘述

  1. sudo dpkg -i nv-tensorrt-local-repo-${os}-${tag}_1.0-1_amd64.deb
  2. sudo cp /var/nv-tensorrt-local-repo-${os}-${tag}/*-keyring.gpg /usr/share/keyrings/
  3. sudo apt-get update
  4. sudo apt-get install tensorrt

(版本号和文件名使用Tab补全)

验证:

dpkg -l | grep TensorRT

参考链接: Installation Guide :: NVIDIA Deep Learning TensorRT Documentation

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/128550
推荐阅读
相关标签
  

闽ICP备14008679号