1、先确认显卡型号,笔者的是GeForce GTX 750 Ti
到网站下载驱动 https://www.nvidia.cn/Download/index.aspx
1)打开终端,先删除旧的驱动:
sudo apt-get purge nvidia*
2)禁用自带的 nouveau nvidia驱动
创建一个文件通过命令 sudo vim /etc/modprobe.d/blacklist-nouveau.conf
并添加如下内容:
blacklist nouveau
options nouveau modeset=0
再更新一下
sudo update-initramfs -u
修改后需要重启系统。确认下Nouveau是已经被你干掉,使用命令: lsmod | grep nouveau
3)重启系统至init 3(文本模式),也可先进入图形桌面再运行init 3进入文本模式,再安装下载的驱动就无问题,
首先我们需要结束x-window的服务,否则驱动将无法正常安装
关闭X-Window,很简单:sudo service lightdm stop,然后切换tty1控制台:Ctrl+Alt+F1即可
4)接下来就是最关键的一步了:sudo./NVIDIA-Linux-x86_64-440.44.run开始安装,安装过程比较快,根据提示选择即可最后安装完毕后,
重新启动X-Window:sudo service lightdm start,然后Ctrl+Alt+F7进入图形界面;
最后测试一下是否安装成功
nvidia-smi
nvidia-settings
Fri Dec 27 15:24:12 2019 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 440.44 Driver Version: 440.44 CUDA Version: 10.2 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | |===============================+======================+======================| | 0 GeForce GTX 750 Ti Off | 00000000:01:00.0 On | N/A | | 40% 22C P8 1W / 58W | 198MiB / 2000MiB | 0% Default | +-------------------------------+----------------------+----------------------+ +-----------------------------------------------------------------------------+ | Processes: GPU Memory | | GPU PID Type Process name Usage | |=============================================================================| | 0 11727 G /usr/lib/xorg/Xorg 138MiB | | 0 12178 G compiz 48MiB | | 0 12731 G /usr/lib/firefox/firefox 1MiB | | 0 12877 G /usr/lib/firefox/firefox 1MiB | | 0 13250 G /usr/lib/firefox/firefox 1MiB | | 0 13335 G /usr/lib/firefox/firefox 1MiB | +-----------------------------------------------------------------------------+
笔者NVIDIA驱动版本是440,以上是367
再次运行命令,结果如下
ubuntu@ubuntu-B85-D3V:~$ lspci | grep VGA 01:00.0 VGA compatible controller: NVIDIA Corporation GM107 [GeForce GTX 750 Ti] (rev a2)
再次执行以下命令,如果没结果说明默认显卡驱动卸载了,N卡驱动安装成功
ubuntu@ubuntu-B85-D3V:~$ lsmod | grep nouveau ubuntu@ubuntu-B85-D3V:~$
https://blog.csdn.net/weixin_43846196/article/details/89086050
转载自:https://blog.csdn.net/u014682691/article/details/80605201