在上一篇文章中,我们成功安装了英伟达的显卡驱动。但当同一显卡外接两台不同分辨率的显示器的时候,第二台显示器的分辨率只有640x480与320x240两个选项。本文将解决这个问题。
首先,安装好英伟达显卡驱动后,在终端敲入
sudo nvidia-settings
可以打开英伟达控制中心。如下图
如果在这里可以更改分辨率,那么很幸运,文章到此结束。
如果不能更改,那么需要用到另一条命令也就是xrandr。
在终端中输入
xrandr
可以查看当前外接显示器位于那个插口,数据大致如下:
Screen 0: minimum 8 x 8, current 3360 x 1080, maximum 16384 x 16384
DVI-I-0 connected 1440x900+1920+0 (normal left inverted right x axis y axis) 0mm x 0mm
640x480 59.94
512x384 70.07 60.00
400x300 72.19
320x240 60.05
VGA-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 476mm x 268mm
1920x1080 60.00*+
1680x1050 59.95
640x480 75.00 72.81 59.94
DVI-I-1 disconnected (normal left inverted right x axis y axis)
HDMI-0 disconnected (normal left inverted right x axis y axis)
可以看到外接显示器位于DVI-I-0口,现在我们输入想添加的分辨率
cvt 1440 900
cvt
命令的意思是calculate VESA cvt mode lines。大体就是输入分辨率,然后按照VESA(Video Eletronics Standard Association,视频电子标准协会)的标准计算该输出的modeline(扫描频率)。
我们得到了
# 1440x900 59.89 Hz (CVT 1.30MA) hsync: 55.93 kHz; pclk: 106.50 MHz
Modeline "1440x900_60.00" 106.50 1440 1528 1672 1904 900 903 909 934 -hsync +vsync
不懂是什么意思,不过不重要,我们复制Modeline后面的一堆东西。
"1440x900_60.00" 106.50 1440 1528 1672 1904 900 903 909 934 -hsync +vsync
然后在终端中新建这个mode。
xrandr --newmode "1440x900_60.00" 106.50 1440 1528 1672 1904 900 903 909 934 -hsync +vsync
按照linux的设计理念(道听途说),没有返回值就是成功了。
第一步中看到了外接显示器位于DVI-I-0口,所以输入命令
xrandr --addmode DVI-I-0 "1440X900_60.00"
此时此刻进入系统设置里就可以调节第二个显示器的分辨率了。
如果输出为一段错误信息,类似于
X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 153 (RANDR).
Minor opcode of failed request: 18 (RRAddOutputMode).
Serial number of failed request: 29.
Current serial number in output stream: 30
就要修改一下配置文件了,这里用gedit,vim同理。
sudo gedit /etc/X11/xorg.conf
找到
Section "Monitor"
Identifier "Monitor0"
VendorName "Unknown"
ModelName "CRT-0"
HorizSync 28.0 - 82.0
VertRefresh 43.0 - 72.0
Option "DPMS"
EndSection
把
HorizSync 28.0 - 82.0
VertRefresh 43.0 - 72.0
改的范围大一点,我这个是改过的。
重启,然后应该就可以了,有问题欢迎留言共同探讨。