转载自:https://blog.csdn.net/pursuit_zhangyu/article/details/79362128
1、下载GPU显卡驱动
Download这个驱动文件
2、Ctrl+Alt+T打开终端
删除旧的驱动
sudo apt-get purge nvidia*
3.禁用自带的 nouveau nvidia驱动
创建一个文件通过命令
sudo gedit /etc/modprobe.d/blacklist-nouveau.conf
并添加如下内容:
blacklist nouveau
options nouveau modeset=0
再更新一下
sudo update-initramfs -u
修改后需要重启系统。
重启后电脑分辨率会更改,不需要理会,继续以下操作。
确认下Nouveau是已经被禁用
lsmod | grep nouveau
没有输出什么东西,说明已经成功关闭了
4.关闭X-window服务
重启系统至文本模式,也可先进入图形桌面再进入文本模式,再安装下载的驱动就无问题。首先我们需要结束x-window的服务,否则驱动将无法正常安装;关闭X-Window。
sudo service lightdm stop
然后切换到tty1控制台:使用Ctrl+Alt+F1即可。
4.安装
-
cd Downloads/
-
sudo chmod a+x NVIDIA-Linux-x86_64-390.25.run (下载的驱动文件名)
-
sudo ./NVIDIA-Linux-x86_64-390.25.run -no-opengl-files
按照如下步骤安装
(1)Accept
(2)contiuned install
(3) Unable to find a suitable destination to install 32-bit compatibility libraries. Your system may not be set up for 32-bit compatibility. 32-bit compatibility files will not be installed; if you wish to install them, re-run the installation and set a valid directory with the --compat32-libdir option.
然后这里也没什么事,直接继续就可以了,想要解决的话,也可以尝试一下安装下面的东西(没试过)
sudo optitude install ia32-libs
(4)would you like to run the nvidia-xconfig utility to automatically update your X configuration file so that the NVIDIA X driver will be used when you restart X ? Any pre-existing X configuration file will be backed up
直接选择 NO,意思是安装驱动时不检查X服务
(5) Installation of the NVIDIA Accelerated Graphics Driver for Linux-x86_64(version:390.25) is now complete. Please update your XF86Config or xorg.conf file as appropriate;see the file
/usr/share/doc/NVIDIA_GLX-1.0/README.txt for details.
只有一个选项,选择Ok就行了。
然后键入重启
sudo reboot
5.检查
终端运行确认是否正确安装。
nvidia-smi
nvidia-settings
显示东西说明安装成功了