前面有同学安装NVIDIA显卡驱动时,使用nvidia-smi命令查看时,显示出错
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver
续U盘安装单系统Ubuntu18.04,下面写一下安装NVIDIA显卡的步骤。
(参考博文史上最详细的UEFI+GTP安装ubuntu18.04LTS全记录,涵盖安装过程中的各种问题,所有的问题都将在这里终结)
步骤一:备份
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
步骤二:编辑源列表
sudo gedit /etc/apt/sources.list
步骤三:换源
将里面内容清空,然后粘贴下列源地址,也可以改成其他地址,如清华源,中科大源等
deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
步骤四:更新软件
更新软件列表:
sudo apt-get update
更新已有软件:
sudo apt-get upgrade
方案一、自动安装版本(推荐使用)
步骤1:删除现有的系统自带N卡驱动以及相关的所有配置文件等:
sudo apt-get --purge remove nvidia*
步骤2:查看显卡设备,并显示系统推荐的驱动版本:
ubuntu-drivers devices
步骤3:安装系统推荐的驱动:
sudo ubuntu-drivers autoinstall
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(方案二、手动安装版本
步骤1:删除现有的系统自带N卡驱动以及相关的所有配置文件等:
sudo apt-get --purge remove nvidia*
步骤2:进入Nvidia选择你的显卡型号,下载Nvidia推荐的最新版:
https://www.nvidia.com/Download/index.aspx
步骤3:然后cd到你保存刚才下载的驱动的目录里如:
cd Downloads/
步骤4:使用该命令进行安装:(换成你下载的驱动名称)
sudo bash NVIDIA-Linux-x86_64-440.bin
)
很多同学上面按照上面步骤安装完成后,以为安好驱动了,当使用
nvidia-smi
查看时,显示
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver
然后 重启
在终端输入
nvidia-smi
进如清华大学镜像站
https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/
步骤一、cd到下载Anaconda的目录:
sudo bash Anaconda3-2020.02-Linux-x86_64.sh
步骤二、更新配置文件:
source ~/.bashrc
步骤三、 终端Terminal输入:
python
发现Python环境已经变为Anaconda了,说明安装成功。
想要继续安装TensorFlow和Pytorch请看我另一篇博客
Ubuntu18.04基于anaconda安tensorflow+keras+pytorch