我有一台原始分辨率为 1680x1050 的显示器,但无法检测到,因此无法通过 nvidia 驱动程序进行设置。我尝试使用 xrandr 强制设置分辨率,但没有结果,正如官方 ubuntu 文档中所建议的那样: https://wiki.ubuntu.com/X/Config/Resolution#Adding_undetected_resolutions 因此,我尝试通过 /etc/X11 中手动生成的 xorg.conf 文件来设置分辨率,如同一官方页面末尾所建议的那样。
我设法创建了一个自定义 xorg.conf 来设置原始分辨率,正如我在 xorg 日志(/var/log/xorg.0.log)中看到的那样,xorg.conf 配置文件正在加载,但自定义分辨率 1680x1050 被丢弃,因为它未在“EDID”中列出: https://en.wikipedia.org/wiki/Extended_Display_Identification_Data
如何覆盖 Xorg 步骤,该步骤将自定义分辨率与 EDID 列出的配置进行比较,并丢弃未列出的原始分辨率?有什么想法吗?
这是 xorg.0.log 的相关部分:
**[ 3448.936] (==) Using config file: "/etc/X11/xorg.conf"**
[ 3448.936] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[ 3448.936] (==) ServerLayout "Layout0"
[ 3448.936] (**) |-->Screen "Screen0" (0)
[ 3448.936] (**) | |-->Monitor "Monitor0"
[ 3448.936] (**) | |-->Device "Device0"
[ 3448.936] (**) |-->Input Device "Keyboard0"
..........
..............
3448.959] (II) Loading /usr/lib/xorg/modules/libwfb.so
[ 3448.959] (II) Module wfb: vendor="X.Org Foundation"
[ 3448.959] compiled for 1.18.3, module version = 1.0.0
[ 3448.959] ABI class: X.Org ANSI C Emulation, version 0.4
[ 3448.959] (II) Loading sub module "ramdac"
[ 3448.959] (II) LoadModule: "ramdac"
[ 3448.959] (II) Module "ramdac" already built-in
[ 3448.959] (**) NVIDIA(0): Depth 24, (--) framebuffer bpp 32
[ 3448.959] (==) NVIDIA(0): RGB weight 888
[ 3448.959] (==) NVIDIA(0): Default visual is TrueColor
[ 3448.959] (==) NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0)
[ 3448.960] (**) NVIDIA(0): Option "NoLogo" "True"
**[ 3448.960] (**) NVIDIA(0): Option "MetaModes" "1680x1050_60 +0+0"**
[ 3448.960] (**) NVIDIA(0): Enabling 2D acceleration
[ 3449.310] (II) NVIDIA(GPU-0): Display (Samsung SyncMaster (CRT-0)) does not support NVIDIA
[ 3449.310] (II) NVIDIA(GPU-0): 3D Vision stereo.
[ 3449.311] (II) NVIDIA(0): NVIDIA GPU GeForce 7050 PV / nForce 630a (C68) at PCI:0:18:0
[ 3449.311] (II) NVIDIA(0): (GPU-0)
[ 3449.311] (--) NVIDIA(0): Memory: 524288 kBytes
[ 3449.311] (--) NVIDIA(0): VideoBIOS: 05.67.32.26.00
[ 3449.311] (--) NVIDIA(0): Interlaced video modes are supported on this GPU
[ 3449.311] (--) NVIDIA(0): Valid display device(s) on GeForce 7050 PV / nForce 630a at PCI:0:18:0
[ 3449.311] (--) NVIDIA(0): Samsung SyncMaster (CRT-0) (connected)
[ 3449.311] (--) NVIDIA(0): DFP-0
[ 3449.311] (--) NVIDIA(0): Samsung SyncMaster (CRT-0): 350.0 MHz maximum pixel clock
[ 3449.311] (--) NVIDIA(0): DFP-0: 155.0 MHz maximum pixel clock
[ 3449.311] (--) NVIDIA(0): DFP-0: Internal Single Link TMDS
[ 3449.311] (**) NVIDIA(0): Using HorizSync/VertRefresh ranges from the EDID for display
[ 3449.311] (**) NVIDIA(0): device Samsung SyncMaster (CRT-0) (Using EDID frequencies
[ 3449.311] (**) NVIDIA(0): has been enabled on all display devices.)
**[ 3449.312] (WW) NVIDIA(0): No valid modes for "1680x1050_60+0+0"; removing.**
**[ 3449.312] (WW) NVIDIA(0): Unable to validate any modes; falling back to the default mode
[ 3449.312] (WW) NVIDIA(0): "nvidia-auto-select".**
[ 3449.312] (WW) NVIDIA(0):
[ 3449.312] (II) NVIDIA(0): Validated MetaModes:
[ 3449.312] (II) NVIDIA(0): "CRT-0:nvidia-auto-select"
[ 3449.312] (II) NVIDIA(0): Virtual screen size determined to be 1600 x 1200
[ 3449.313] (WW) NVIDIA(0): Unable to support custom viewPortOut 1600 x 900 +0 +150
[ 3449.313] (WW) NVIDIA(0): Unable to support custom viewPortOut 1600 x 900 +0 +150
[ 3449.313] (--) NVIDIA(0): DPI set to (99, 98); computed from "UseEdidDpi" X config
[ 3449.313] (--) NVIDIA(0): option
[ 3449.313] (--) Depth 24 pixmap format is 32 bpp
[ 3449.318] (II) NVIDIA(0): Setting mode "CRT-0:nvidia-auto-select"
答案1
覆盖 xorg.conf 中 EDID 定义的配置的方法是在“设备”部分添加此行:
Option "UseEdid" "False"
因此,仍然可以通过创建和自定义 XOrg 的配置文件来设置 Ubuntu 中的本机显示分辨率。以下是分步指南:
1)创建一个新的 xorg.conf 文件,将其放入配置文件夹“/etc/X11”中。如果您没有设置此文件,网络上有很多示例,但如果您有 nvidia 驱动程序,它会附带一个生成工具。只需运行
sudo nvidia-xconfig
2)编辑此新文件 xorg.conf,使用显示器的原始分辨率设置自定义“屏幕”和“监视器”部分。您应该在终端中运行“sudo gedit”,以便能够将更改保存在 /etc/X11 系统文件夹中。如果您在网上搜索一些示例和显示器的特定选项(例如水平和垂直刷新率),会更容易。我建议搜索“1680x1050”(或您的原始分辨率)和“xorg.conf”。以下是 Syncmaster 2043NWX 的“监视器”部分的示例:
Section "Monitor"
Identifier "Monitor0"
VendorName "Unknown"
ModelName "Samsung SyncMaster"
HorizSync 30.0 - 81.0
VertRefresh 56.0 - 75.0
Option "DPMS"
EndSection
3)添加一行以覆盖 EDID,因为您的本机配置未列在您的驱动程序从显示器检索到的 EDID 数据中,并且您将通过 xorg.conf 强制使用此分辨率。这是此答案中写的第一行。
4)保存文件并注销。确保将 xorg.conf 保存在 /etc/X11 中,然后注销您的 ubuntu 会话。如果一切正常,注销后,原始分辨率应该已设置并正常工作,即使是登录屏幕也是如此,因为 X-Window 每次启动或重新启动时都会读取 /etc/X11/xorg.conf。如果出现问题,您可以暂时将 /etc/X11/xorg.conf 重命名为 /etc/X11/_xorg.conf,然后您应该能够使用默认分辨率登录。您可以检查 /var/log/xorg.0.log 上的 X-window 日志,以尝试找出您的设置出了什么问题。
以下是 xorg.conf 的示例,由 nvidia-xconfig 生成,并定制为设置 SyncMaster2043nwx 的原始分辨率:
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig: version 304.131 (buildmeister@swio-display-x64-rhel04-16) Sun Nov 8 22:48:17 PST 2015
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0" 0 0
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
EndSection
Section "Files"
EndSection
Section "InputDevice"
# generated from default
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/psaux"
Option "Emulate3Buttons" "no"
Option "ZAxisMapping" "4 5"
EndSection
Section "InputDevice"
# generated from default
Identifier "Keyboard0"
Driver "kbd"
EndSection
Section "Monitor"
Identifier "Monitor0"
VendorName "Unknown"
ModelName "Samsung SyncMaster"
HorizSync 30.0 - 81.0
VertRefresh 56.0 - 75.0
Option "DPMS"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
Option "metamodes" "1680x1050_60 +0+0"
Option "NoLogo" "True"
SubSection "Display"
Depth 24
EndSubSection
EndSection
Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "GeForce 7050 PV 7 nForce 630a"
Option "UseEDID" "FALSE"
EndSection
我要感谢整个 Ubuntu 社区通过许多不同的帖子帮助我弄清楚这一切。