红联Linux门户
Linux帮助

Linux Mint 18.2双显卡之安装NVIDIA官方闭源驱动

发布时间:2017-07-18 15:52:50来源:linux网站作者:活腿肠
系统:Linux Mint 18.2 Cinnamon 64-bit
硬件:GeForce GT 425M
linux Mint的安装步骤,和Ubuntu一样,网上教程比较多,这里略过.
主要讲一下双显卡如何安装NVIDIA官方闭源驱动,其他的软件都好说,就这个的坑比较多.
 
1)软件”源”很关键
Linux Mint 18.2双显卡之安装NVIDIA官方闭源驱动
首先,使用默认的”源”,改动的可以恢复过来,不然后面会出现各种”依赖”问题,比较麻烦,我们从源头上防止其发生
Linux Mint 18.2双显卡之安装NVIDIA官方闭源驱动
“依赖”问题:
E:无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系。
 
2)干掉Nouveau
Nouveau是由第三方为NVIDIA显卡开发的一个开源3D驱动,也没能得到NVIDIA的认可与支持。虽然Nouveau Gallium3D在游戏速度上还远远无法和NVIDIA官方闭源驱动相提并论,不过确让Linux更容易的应对各种复杂的NVIDIA显卡环境,让用户安装完系统即可进入桌面并且有不错的显示效果,所以,很多Linux发行版默认集成了Nouveau驱动,在遇到NVIDIA显卡时默认安装。企业版的Linux更是如此,几乎所有支持图形界面的企业Linux发行版都将Nouveau收入其中。
不过对于个人桌面用户来说,处于成长阶段的Nouveau并不完美,与企业版不一样,个人用户除了想让正常显示图形界面外很多时候还需要一些3D特效,Nouveau多数时候并不能完成,而用户在安装NVIDIA官方闭源驱动的时候Nouveau又成为了阻碍,不干掉Nouveau安装时总是报错。
 
1.检查nouveau驱动是否被禁用
终端输入:
lsmod | grep nouveau
如果有任何输出信息,表明nouveau驱动被启用。
 
2.禁用nouveau驱动
不用开启终端,直接GUI界面修改
Linux Mint 18.2双显卡之安装NVIDIA官方闭源驱动
Linux Mint 18.2双显卡之安装NVIDIA官方闭源驱动
把nouveau驱动加入黑名单:
编辑 /etc/modprobe.d/blacklist-modem.conf ,在文件后面加入
blacklist nouveau option nouveau modeset=0
3.重新生成kernel initramfs,终端输入:
sudo update-initramfs -u
 
3)nomodeset模式下安装nvidia驱动
关于 nomodeset 的描述一:
Note that this option is sometimes needed for nVidia cards when using the default “nouveau” drivers.
Installing proprietary nvidia drivers usually makes this option no longer necessary, so it may not be needed to make this option permanent, just for one boot until you installed the nvidia drivers.
关于nomodeset的描述二:
The newest kernels have moved the video mode setting into the kernel. So all the programming of the hardware specific clock rates and registers on the video card happen in the kernel rather than in the X driver when the X server starts.. This makes it possible to have high resolution nice looking splash (boot) screens and flicker free transitions from boot splash to login screen. Unfortunately, on some cards this doesn’t work properly and you end up with a black screen. Adding the nomodeset parameter instructs the kernel to not load video drivers and use BIOS modes instead until X is loaded.
 
综上,
nomodeset – 告诉内核在系统启动并运行之前不启动视频驱动程序。
 
1.nomodeset模式
这里可以让系统临时进入nomodeset模式,它采用了一种”软显示“模式。
重启系统进入nomodeset模式:
参考:
https://www.linuxmint.com/rel_serena_cinnamon.php里的Solving freezes部分。
Linux Mint 18.2双显卡之安装NVIDIA官方闭源驱动
笔者采用的第三种方式,在GNU界面,按键盘 ’e’键,依照视频操作,
删除quiet和splash,添加上nomodeset参数(如图),按Ctrl+x启动引导,进入系统
 
2.安装官驱
在nomodeset模式下,先按2)步骤1检查nouveau驱动是否被禁用,确保其禁用。再安装nvidia驱动,如下图所示:
Linux Mint 18.2双显卡之安装NVIDIA官方闭源驱动
笔者,因为系统推荐的375,所以选择这个,大家可以依个人喜好,选上驱动后,点击右下角的应用更改,下载软件包,安装…..
 
3.验证nvidia驱动安装成功
重启后终端输入:
cat /proc/driver/nvidia/version
输出版本号,说明nvidia驱动安装成功。
 
本文永久更新地址:http://www.linuxdiyf.com/linux/32024.html