保存后,然后执行:
sudo updata-initramfs -u sudo reboot重启后,Ctrl+Alt+F1切换到tty界面,关闭lightdm(如果没有则不用管):
sudo service lightdm stop然后更新一下apt源以及看一下系统推荐的NVIDIA驱动版本:
sudo add-apt-repository ppa:graphics-drivers/ppa sudo apt-get update ubuntu-drivers devices根据推荐的驱动版本,安装NVIDIA驱动:
sudo apt-get install nvidia-driver-460如果嫌慢,可以添加阿里或者清华源:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bcakup sudo gedit /etc/apt/sources.list备份之后打开文件,添加以下源即可:
# 阿里云源 deb bionic main restricted universe multiverse deb bionic-security main restricted universe multiverse deb bionic-updates main restricted universe multiverse deb bionic-backports main restricted universe multiverse ##測試版源 deb bionic-proposed main restricted universe multiverse # 源碼 deb-src bionic main restricted universe multiverse deb-src bionic-security main restricted universe multiverse deb-src bionic-updates main restricted universe multiverse deb-src bionic-backports main restricted universe multiverse ##測試版源 deb-src bionic-proposed main restricted universe multiverse # 清华大学源 deb bionic main restricted universe multiverse deb bionic-security main restricted universe multiverse deb bionic-updates main restricted universe multiverse deb bionic-backports main restricted universe multiverse ##測試版源 deb bionic-proposed main restricted universe multiverse # 源碼 deb-src bionic main restricted universe multiverse deb-src bionic-security main restricted universe multiverse deb-src bionic-updates main restricted universe multiverse deb-src bionic-backports main restricted universe multiverse ##測試版源 deb-src bionic-proposed main restricted universe multiverse别忘了添加之后,进行更新二连:
sudo apt-get update sudo apt-get upgrade这样就可以顺利的安装NVIDIA驱动了。
然后下载好以下三个深度学习伴侣:
开始安装吧!
安装Cuda、CudnnCuda当然是必须要装的。
找到下载好的11.1cuda环境包(现在出来11.2了),然后执行:
sudo sh cuda_11.1.0_455.23.05_linux.run会出来一堆blabla的选项:
1、确保你环境里头是否有旧的cuda,有的话建议删除
2、同意条款..
3、确认是否要安装驱动、安装demo...以及安装位置确定
4、开始安装ing
对于老潘来说,上一步中已经安装了cuda驱动,不需要再装旧版的(新版驱动兼容旧版驱动匹配的cuda),所以这里就把驱动选项去掉,其他的安装按照我的需求按部就班来就好。
注意
如果你没有root权限,无法使用sudo,想要安装cuda也是可以的。只要自定义好安装位置即可,运行如下命令即可将cuda安装到当前home下的software文件夹内:
不论咋样安装好之后会显示: