【无标题】

发布时间:2023年12月18日

# 安装
$ ubuntu-drivers devices
 
$ sudo apt-get install nvidia-driver-470-server  # 推荐是server,都可以。

#delelt
sudo apt --purge remove nvidia-*

CUDA Toolkit 11.3 Downloads | NVIDIA Developericon-default.png?t=N7T8https://developer.nvidia.com/cuda-11.3.0-download-archive

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/11.3.0/local_installers/cuda-repo-ubuntu2004-11-3-local_11.3.0-465.19.01-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu2004-11-3-local_11.3.0-465.19.01-1_amd64.deb
sudo apt-key add /var/cuda-repo-ubuntu2004-11-3-local/7fa2af80.pub
sudo apt-get update
sudo apt-get -y install cuda

?

cd /usr/local/cuda-xx.x/bin/
sudo ./cuda-uninstaller
sudo rm -rf /usr/local/cuda-xx.x


sudo /usr/local/cuda-11.0/bin/cuda-uninstaller  # 卸载cuda
 
# 卸载显卡驱动,后面还要再做一边
# (1)卸载现有的显卡驱动
sudo apt-get purge nvidia*
 
# (2)如果是离线安装的
卸载驱动和安装一样,首先ctrl+Alt+F2进入命令行状态,然后停止lightdm
sudo service lightdm stop
或者
sudo /etc/init.d/lightdm stop
 
# 卸载
sudo /usr/bin/nvidia-uninstall
 
也可以
sudo apt-get install autoremove --purge nvidia*

卸载前请把环境删除 vim ~/.bashrc sudo vi ~/.bashrc

cuDNN Archive | NVIDIA Developericon-default.png?t=N7T8https://developer.nvidia.com/rdp/cudnn-archive

wget

Log in | NVIDIA Developericon-default.png?t=N7T8https://developer.nvidia.com/downloads/compute/cudnn/secure/8.9.6/local_installers/11.x/cudnn-local-repo-ubuntu2004-8.9.6.50_1.0-1_amd64.deb/

安装运行环境

sudo dpkg -i libcudnn7_7.6.0.64-1+cuda10.0_amd64.deb

安装开发包

sudo dpkg -i libcudnn7-dev_7.6.0.64-1+cuda10.0_amd64.deb

安装示例

sudo dpkg -i libcudnn7-doc_7.6.0.64-1+cuda10.0_amd64.deb

拷贝文件到环境配置的Home路径下

cp -r /usr/src/cudnn_samples_v7/ $HOME 

Log in | NVIDIA Developericon-default.png?t=N7T8https://developer.nvidia.com/nvidia-tensorrt-8x-download

?https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/secure/8.6.1/local_repos/nv-tensorrt-local-repo-ubuntu2004-8.6.1-cuda-11.8_1.0-1_amd64.debicon-default.png?t=N7T8https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/secure/8.6.1/local_repos/nv-tensorrt-local-repo-ubuntu2004-8.6.1-cuda-11.8_1.0-1_amd64.deb

sudo dpkg -i nv-tensorrt-repo-ubuntu1804-cuda10.0-trt7.0.0.11-ga-20191216_1-1_amd64.deb
sudo apt-key add /var/nv-tensorrt-repo-cuda10.0-trt7.0.0.11-ga-20191216/7fa2af80.pub
sudo apt-get update
sudo apt-get install tensorrt

  1. uname -a // 查看ubuntu发行版本信息
  2. ls -l /usr/local/ | grep cuda // 查看cuda版本
  3. cat /usr/local/cuda/include/cudnn_version.h | grep CUDNN_MAJOR -A 2 // 查看cudnn版本
  4. cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2 // 查看cudnn版本
文章来源:https://blog.csdn.net/ttyttytty12/article/details/135073365
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。