赞
踩
详细记录 redhat 8 系统, 从 0 -1 安装 Cuda, Cudnn , Tensorrt 全部过程。
NVIDIA-Linux-x86_64-525.89.02.run
nividia-smi
查询一下。# 不选 driver 和 nvidia-fs
sudo sh ./cuda_11.8.0_520.61.05_linux.run
sudo vim ~/.bashrc
export PATH="/usr/local/cuda-11.8/bin:$PATH"
export LD_LIBRARY_PATH="/usr/local/cuda-11.8/lib64:$LD_LIBRARY_PATH"
source ~/.bashrc
nvcc -V
cd /usr/local/cuda-11.8/samples/1_Utilities/deviceQuery
sudo make
./deviceQuery
cd ../bandwidthTest
sudo make
./bandwidthTest
# 如果这两个测试的最后结果都是Result = PASS,说明CUDA安装成功.
# uninstall cuda
sudo /usr/local/cuda-11.8/bin/cuda-uninstaller
# uninstall nvidia driver
#sudo /usr/bin/nvidia-uninstall
参考: https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html#installcuda
安装
sudo rpm -i cudnn-local-repo-rhel8-8.6.0.163-1.0-1.x86_64.rpm
# Refresh the repository metadata.
sudo yum clean all
# Install the runtime library.
sudo yum install libcudnn8-8.6.0.163-1.cuda11.8 -y
sudo yum install libcudnn8-devel-8.6.0.163-1.cuda11.8 -y
sudo yum install libcudnn8-samples-8.6.0.163-1.cuda11.8 -y
不出意外会出现如下错误
Problem: conflicting requests
- nothing provides libcublas.so.11()(64bit) needed by libcudnn8-8.6.0.163-1.cuda11.8.x86_64
- nothing provides libcublasLt.so.11()(64bit) needed by libcudnn8-8.6.0.163-1.cuda11.8.x86_64
下载先关依赖rpm ,如果还出现什么依赖库问题,去下载相应rpm,应该都能解决.
1. https://rhel.pkgs.org/ , 搜索 cuda-toolkit-config-common-11.8.89-1.noarch.rpm
cuda-toolkit-11-config-common-11.8.89-1.noarch.rpm
cuda-toolkit-11-8-config-common-11.8.89-1.noarch.rpm
libcublas-11-8-11.11.3.6-1.x86_64.rpm
libcublas-devel-11-8-11.11.3.6-1.x86_64.rpm
2. https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/ , 搜索 cuda-cudart-devel-11-8-11.8.89-1.x86_64.rpm
# install
sudo yum install cuda-toolkit-config-common-11.8.89-1.noarch.rpm -y
sudo yum install cuda-toolkit-11-config-common-11.8.89-1.noarch.rpm -y
sudo yum install cuda-toolkit-11-8-config-common-11.8.89-1.noarch.rpm -y
sudo yum install libcublas-11-8-11.11.3.6-1.x86_64.rpm -y
sudo yum install libcublas-devel-11-8-11.11.3.6-1.x86_64.rpm -y
验证
cd /usr/src/cudnn_samples_v8/mnistCUDNN
make clean && make
./mnistCUDNN
Test passed!
不出意外还会出现错误,fatal error: FreeImage.h: No such file or directory.
按照网上的办法都是安装 freeimage
和 freeimage-devel
, 但我安装会出现 not match… 错误, 所以还是老套路,本地下载包安装。
wget https://download-ib01.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/j/jxrlib-1.1-1.el8.x86_64.rpm
sudo yum install jxrlib-1.1-1.el8.x86_64.rpm
wget https://download-ib01.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/f/freeimage-3.17.0-5.el8.x86_64.rpm
sudo yum install freeimage
wget https://download-ib01.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/f/freeimage-devel-3.17.0-5.el8.x86_64.rpm
sudo yum install freeimage-devel
后悔药
sudo yum erase "cudnn-local-repo*" -y
sudo yum erase "libcudnn*"
安装 https://docs.nvidia.com/deeplearning/tensorrt/install-guide/index.html#installing
os="rhelx"
tag="cudax.x-trt8.x.x.x-ga-yyyymmdd"
sudo rpm -Uvh nv-tensorrt-repo-${os}-${tag}-1-1.x86_64.rpm
sudo yum clean expire-cache
sudo yum install tensorrt
按照官方教程安装,还是会提示缺少依赖,也不知道那里有问题。有大佬知道,麻烦指导下,好人一生平安啊。 最后还是老套路,下载相应依赖。
wget https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-cccl-11-8-11.8.89-1.x86_64.rpm
sudo yum install cuda-cccl-11-8-11.8.89-1.x86_64.rpm -y
wget https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-nvcc-11-8-11.8.89-1.x86_64.rpm
sudo yum install cuda-nvcc-11-8-11.8.89-1.x86_64.rpm -y
wget https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-cudart-11-8-11.8.89-1.x86_64.rpm
sudo yum install cuda-cudart-11-8-11.8.89-1.x86_64.rpm -y
wget https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-cudart-devel-11-8-11.8.89-1.x86_64.rpm
sudo yum install cuda-cudart-devel-11-8-11.8.89-1.x86_64.rpm -y
sudo yum install tensorrt
验证
rpm -qa | grep tensorrt
# You should see something similar to the following:
tensorrt-8.5.3.x-1.cuda11.8.x86_64
后悔药
sudo yum erase "libnvinfer*" -y
sudo yum erase "nv-tensorrt-repo*" -y
sudo yum erase "nv-tensorrt-local-repo*" -y
sudo yum erase graphsurgeon-tf onnx-graphsurgeon -y
sudo yum erase uff-converter-tf -y
sudo yum autoremove -y
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。