Linux 显卡驱动安装 双显示器配置及问题解决

驱动安装:

一:下载nvidia显卡驱动,从nvidia的官方网站根据显卡的型号下载相应的驱动文件

二:在字符界面下(运行级3)运行驱动安装程序,在Centos6 (RHEL6)上因为Nouveau的关系会出现下面的错误
[root@rhel6 ~]# sh NVIDIA-Linux-x86_64-275.09.07.run 
Verifying archive integrity... OK
Uncompressing NVIDIA Accelerated Graphics Driver for Linux-x86_64 275.09.07...................................................................................
Please read the following LICENSE and then select either "Accept" to accept the license and continue with the installation, or select "Do Not Accept" to abort the installation.

   Accept                     Do Not Accept 

ERROR: The Nouveau kernel driver is currently in use by your system.  This driver is incompatible with the NVIDIA driver, and must bedisabled before proceeding.  Please consult the NVIDIA driver README and your Linux distribution's documentation for details on how to correctly disable the Nouveau kernel driver. 

因此需要将该模块禁用掉:
[root@rhel6 ~]# lsmod  |grep nouveau
nouveau               537914  1 
ttm                    46942  1 nouveau
drm_kms_helper         32113  1 nouveau
drm                   200778  3 nouveau,ttm,drm_kms_helper
i2c_algo_bit            5664  1 nouveau
video                  20966  1 nouveau
i2c_core               31274  5 i2c_nforce2,nouveau,drm_kms_helper,drm,i2c_algo_bit

将该模块加入黑名单:
[root@rhel6 ~]# tail -1 /etc/modprobe.d/blacklist.conf 
blacklist nouveau

备份原先的初始化内存文件系统
[root@rhel6 ~]# mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.bak

使用dracut命令重新生成initramfs文件,并重启

[root@rhel6 ~]# dracut -v /boot/initramfs-$(uname -r).img $(uname -r) 
[root@rhel6 ~]# reboot

 

如果重启后发现该模块依然被加载
[root@rhel6 ~]# lsmod |grep nouveau
nouveau               537914  1 
ttm                    46942  1 nouveau
drm_kms_helper         32113  1 nouveau
drm                   200778  3 nouveau,ttm,drm_kms_helper
i2c_algo_bit            5664  1 nouveau
video                  20966  1 nouveau
powernow_k8            16298  0 
freq_table              4847  2 cpufreq_ondemand,powernow_k8
i2c_core               31274  5 nouveau,drm_kms_helper,drm,i2c_algo_bit,i2c_nforce2

在grub.conf文件中将改模块加入黑名单
[root@rhel6 ~]# grep -1 default  /etc/grub.conf 
rdblacklist=nouveau
default=1
timeout=1
将nouveau.ko内核对象文件移除
[root@rhel6 ~]# mv /lib/modules/2.6.32-71.el6.x86_64/kernel/drivers/gpu/drm/nouveau/nouveau.ko  /tmp

 

重启后发现该模块已经没有被加载了
[root@rhel6 ~]# reboot
[root@rhel6 ~]# lsmod |grep no
powernow_k8            16298  0 
freq_table              4847  2 cpufreq_ondemand,powernow_k8

接下来就可以在字符界面一路回车将显卡驱动装好了,但移除nouveau.ko文件后,RHEL6启动界面将会变成进度条形式,原来的光圈启动将会消失!

 

 

双显示器设置:

 

PS:安装完驱动重启再进入图形界面,如果显示器已经识别就不用修改文件了,如果未识别,按下述介绍操作。

 

1.安装完驱动!

2. 进入CentOS系统字符界面。

3. cd 到/etc/X11目录 

[root@CentOS5 ~]# cd /etc/X11  

[root@CentOS5 X11]# vi xorg.conf  

在Section "Screen" 下面添加如下内容  

Option   "TwinView Orientation" "RightOf"  

Option    "TwinView" "1" 

 

4. 把Section "Device"  的Driver项改为"nvidia"

 

5.重启X  

 字符界面输入init 5 或输入startx ,重启X。两台显示器此时会被同事点亮 

 

6. 接着要在 xorg.conf 中设置主显示器,和附显示器的相对位置等等,这个工作可以用 Nvidia 显卡驱动附带的 nvidia-settings 设置程序来完成。 

以root用户登录CentOS在X界面打开shell命令窗口,输入nvidia-settings 命令调出nvidia显卡设置工具。 

[root@CentOS5 ~]# nvidia-settings 

设置完成后,点击"Apply",并点击 "Save to X configuration File" 把设置保存到 xorg.conf 中。

 

双屏显示问题:

有时,使用 nvidia-settings 配置双显示器会遇到一个问题:没法为第二个显示器设置高于640x480的分辨率。这是 /etc/X11/xorg.conf 中默认的显示器水平同步设置导致的。

要提高第二个显示器的分辨率,您就得提高水平同步频率。

 

为此,请执行下列操作:

1.在 nvidia-settings 中,将有问题的显示器的分辨率调到最高,比如640x480。千万不要设置成自动调整(Auto)。这一步骤可以在您编辑 / etc/X11/xorg.conf 文件的时帮助您识别出正确的显示器。保存到 xorg.conf 并退出。

2. 打开 /etc/X11/xorg.conf 并找到下面这个部分(一些细节可能有些微不同):

Section "Screen"

Monitor "Monitor0"

Option "metamode" "CRT: 640x680 +1280+0, DFP: 1280x1024 +0+0"

EndSection

3. 把分辨率设置成您想要的大小。

4. 找到对应的显示器的区块(一些细节可能有些微不同):

Section "Monitor"

Identifier "Monitor0"

HorizSync 28.0 - 33.0

EndSection

5.将 "-" 右边的值改为65.0(如果重启 X 之后仍然存在问题,可以再调到更高的数值)。

6. 保存文件并重启 X server。

7. 如果第二显示器仍然不显示,重复步骤4到7,把水平同步频率调到65.0以上。

转载于:https://www.cnblogs.com/opsarno/p/3670622.html

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值