# 安装
$ ubuntu-drivers devices
$ sudo apt-get install nvidia-driver-470-server # 推荐是server,都可以。
#delelt
sudo apt --purge remove nvidia-*
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 Developerhttps://developer.nvidia.com/rdp/cudnn-archive
wget
安装运行环境
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 Developerhttps://developer.nvidia.com/nvidia-tensorrt-8x-download
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