前言:
win下安装高版本NVIDIA驱动,在conda环境下可以通过安装cudatoolkit自由切换不同版本的cuda。
但是在Ubuntu上实践时,由于最开始NVIDIA驱动过低,导致conda环境下切换失败,因此本文将首先对NVIDIA驱动进行升级。
安装了NVIDIA驱动,通过nvidia-smi可以查看该驱动最高支持的cuda版本
1. 下载显卡驱动
网址:https://www.nvidia.cn/Download/index.aspx?lang=cn
2. 安装显卡驱动
参考https://blog.csdn.net/feynman233/article/details/79187490中的ppa安装法:
ctrl+alt+F1进入文本模式:
关闭图形界面:
sudo /etc/init.d/lightdm stop
卸载旧的驱动:
sudo apt-get --purge remove nvidia-*
安装新驱动:
sudo sh NVIDIA-Linux-x86_64-xxx.run
最后重启OK
参考:https://www.cnblogs.com/chua-n/p/13208398.html
3. 安装cuda
参考https://blog.csdn.net/feynman233/article/details/79187490和https://blog.csdn.net/yinxingtianxia/article/details/80462892
cuda下载地址:https://developer.nvidia.com/cuda-downloads
选取runfile文件安装方式