最低信息
您将要问一个问题,然后添加此命令生成的链接
sudo apt-get install pastebinit; sudo sh -c "lsb_release -sd; dmidecode -s system-product-name; echo ==; lshw -c display; echo ==; xrandr --verbose; echo ==; cat /etx/X11/xorg.conf" | tee ~/Desktop/ubuntu-graphic-info.txt | pastebinit
故障排除
闲聊
我尝试使用Intel GPU玩了一段时间,这比我想象的要复杂得多xrandr
。有时,我收到意外错误。根据我的经验,这是一个总结。
据我了解,这是一个简化的完整堆栈列表。
xrandr
└─ Xorg (w/ driver specific module)
└─ kernel
└─ driver
│
graphic card
└─ cables (kvm switch/connection adapter)
└─ monitor
故障排除实际上是一个很大的堆栈,使用旧硬件和不断更新的专有驱动程序更新会更加困难,即使DB-15 VGA电缆(或廉价电缆)的针脚接触不良也可能会有所作为。实际上,我在Ask Ubuntu中读到的大多数问题都与显示器中丢失/错误的EDID数据有关,归咎于:电缆(kvm交换机/连接适配器)。您可以从xrandr --verbose
输出中迅速注意到这一点。
在许多情况下,由于显示器的EDID数据不完整/部分错误(制造商的错误),驱动程序限制了某些模式,用户可以通过编写自定义值xorg.conf
来覆盖来克服此问题:模式,HSync和VSync,EDID,DPI ...取决于驱动程序(nvidia
对于示例可以从监视器忽略EDID)
我建议阅读此内容以供高级用户或在此处提供帮助的用户阅读:
注意:
阅读旧文档和提供解决方案的帖子时请务必小心。更好的是,查找正在使用的特定驱动器的文档。
- 验证发布日期,上次编辑日期或软件版本。
modeset
,DRI
或者fb
(帧缓冲区)驱动类型。(请注意,我不是专家)。
- Xorg在自动配置方面做了很多工作,因此
xorg.conf
默认情况下不会创建。即使用户创建了一个,他也不应该创建所有部分,而仅覆盖需要的部分。这是一种动态配置。
我对那些xrandr / X错误的虚假理解
儿子(xrandr
)似乎不知道他父亲有什么能力或同意购买他(所有驾驶员能力),因此他只是去找妈妈(Xorg)并请她向父亲问他想要的东西。因此,以下任何情况都会发生:
- 高比率:儿子→(:)接受)妈妈→(:)接受)爸爸,每个人都快乐!
- 低比率:儿子→(:|接受)妈妈→(XD拒绝)爸爸,有时候生活很艰难!
- 极少数情况:儿子→(X /拒绝)妈妈-x-(:|中立)爸爸,计划B的时间到了!
因此,当Xorg或驱动程序由于以下原因而无法处理或拒绝xrandr请求时,我们将得到这些错误:
- 当前的Xorg设置
- 驱动功能
- 图形适配器功能
- 监控器功能来自EDID
- 其中一个错误包括
xrandr
收集通用图形的调试信息!
为什么?我在这里查看了许多与xrandr
&分辨率相关的问题,它们缺少有关完整堆栈设置的许多信息。认为集合仅提及最后一个失败的命令。甚至,我建议将全部输出放在问题中,以便我们可以寻找相似之处并将相关问题联系起来。
如果未找到EDID数据,请从以下开始:
- 显示器如何物理连接,即是否使用KVM?任何连接适配器,例如 HDMI转VGA?
- 您是否尝试过另一根电缆?
- 显示器的品牌/型号是什么?
这里列出了一些有用的命令
背景资料
sudo dmidecode -s system-product-name
lsb_release -sd
Xorg -version
xrandr -v
sudo lshw -c display
基本信息
xrandr --verbose
cat /etx/X11/xorg.conf
more /var/log/Xorg.0.log
调试命令和选项
sudo apt-get install edid-read
ls /sys/class/drm/*/edid | xargs -i{} sh -c "echo {}; parse-edid < {}"
xrandr --verbose ...
xtrace xrandr --verbose ...
#no need, only to compare between releases for changes, the default driver parameters
sudo sh -c "ls /sys/module/<driver-module-from-lshw>/parameters/ | xargs -L1 -i{} sh -c 'echo -n {} \" \" ; cat /sys/module/<driver-module-from-lshw>/parameters/{}'"
# additional desktop environment setting, for general cases, gnome/unity
cat ~/.config/monitors.xml
cat /etc/gnome-settings-daemon/xrandr/monitors.xml
gsettings list-recursively org.gnome.settings-daemon.plugins.xrandr
高级调试选项
加入Option "ModeDebug" "true"
到Section "Device"
到xorg.conf
,详情见下文NVIDIA调试。
NVIDIA图形的其他调试信息!
cat /proc/driver/nvidia/version
对于精确的版本
激活nvidia调试信息以 /var/log/Xorg.0.log
gksu nvidia-settings
# go to X configuration then export, copy only device section
sudo mkdir /etc/X11/xorg.conf.d/
sudo vim /etc/X11/xorg.conf.d/90_my_nvidia_hacks.conf
# paste the device section
Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "NVS 3100M"
Option "ModeDebug" "true"
EndSection
# add to it this line `Option "ModeDebug" "true"`
完整的文档file:///usr/share/doc/nvidia-*/html/
,请参见,寻找相同的运行版本,可用选项和默认设置有很多更改。
使用英特尔驱动程序的调试测试用例
在这种情况下,我可以重现它,似乎是的错误xrandr
。从xtrace
&可以明显看出Xorg.0.log
,帧缓冲区在第一种组合中未调整大小。
#Seems a bug in xrandr
#Xorg error when changing to bigger resolution without changing a previously defined scale.
#-----------
#system info
$ xrandr --version
xrandr program version 1.4.3
Server reports RandR version 1.4
$ sudo sh -c "lsb_release -dc;echo; uname -a; Xorg -version;echo; lshw -C display"
Description: Ubuntu 15.10
Codename: wily
Linux BlueSkies 4.2.0-25-generic #30-Ubuntu SMP Mon Jan 18 12:31:50 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
X.Org X Server 1.17.2
Release Date: 2015-06-16
X Protocol Version 11, Revision 0
Build Operating System: Linux 3.13.0-68-generic x86_64 Ubuntu
Current Operating System: Linux BlueSkies 4.2.0-25-generic #30-Ubuntu SMP Mon Jan 18 12:31:50 UTC 2016 x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.2.0-25-generic root=UUID=9f0530d5-e0eb-43fa-b99b-000fa742cf10 ro persistent quiet splash vt.handoff=7
Build Date: 12 November 2015 05:33:29PM
xorg-server 2:1.17.2-1ubuntu9.1 (For technical support please see http://www.ubuntu.com/support)
Current version of pixman: 0.32.6
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
*-display
description: VGA compatible controller
product: 3rd Gen Core processor Graphics Controller
vendor: Intel Corporation
physical id: 2
bus info: pci@0000:00:02.0
version: 09
width: 64 bits
clock: 33MHz
capabilities: msi pm vga_controller bus_master cap_list rom
configuration: driver=i915 latency=0
resources: irq:26 memory:f6400000-f67fffff memory:e0000000-efffffff ioport:f000(size=64)
$ sudo sh -c "ls /sys/module/i915/parameters/ | xargs -L1 -i{} sh -c 'echo -n {} \" \" ; cat /sys/module/i915/parameters/{}'"
disable_display N
disable_power_well 1
disable_vtd_wa N
edp_vswing 0
enable_cmd_parser 1
enable_execlists 0
enable_fbc -1
enable_hangcheck Y
enable_ips 1
enable_ppgtt 1
enable_psr 0
enable_rc6 3
fastboot N
invert_brightness 0
load_detect_test N
lvds_channel_mode 0
lvds_downclock 0
lvds_use_ssc -1
mmio_debug 0
modeset -1
nuclear_pageflip N
panel_ignore_lid 1
prefault_disable N
preliminary_hw_support 0
reset Y
semaphores -1
use_mmio_flip 0
vbt_sdvo_panel_type -1
verbose_state_checks Y
$ modinfo i915
filename: /lib/modules/4.2.0-25-generic/kernel/drivers/gpu/drm/i915/i915.ko
license: GPL and additional rights
description: Intel Graphics
author: Intel Corporation
author: Tungsten Graphics, Inc.
firmware: i915/skl_dmc_ver1.bin
srcversion: BB05D6968744E69AEA30DC2
...
depends: drm_kms_helper,drm,video,i2c-algo-bit
intree: Y
vermagic: 4.2.0-25-generic SMP mod_unload modversions
$ xrandr
Screen 0: minimum 8 x 8, current 1726 x 768, maximum 32767 x 32767
LVDS1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 309mm x 173mm
1366x768 60.07*+ 40.02
1360x768 59.80 59.96
1280x720 60.00
1024x768 60.00
1024x576 60.00
960x540 60.00
800x600 60.32 56.25
864x486 60.00
640x480 59.94
720x405 60.00
680x384 60.00
640x360 60.00
DP1 disconnected (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)
DP3 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
HDMI3 disconnected (normal left inverted right x axis y axis)
VGA1 connected 360x200+1366+0 (normal left inverted right x axis y axis) 410mm x 230mm
1366x768 59.79 +
1280x1024 60.02
1280x720 60.00
1024x768 60.00
800x600 60.32
640x480 60.00
720x400 70.08*
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
Other info not collected
$ grep intel /var/log/Xorg.0.log
#-------------------------
#case reproducing & debug
## 1st combination different mode & same scale
$ xrandr --output VGA1 --mode 720x400 --right-of LVDS1 --scale 0.5x0.5
$ xtrace xrandr --verbose --output VGA1 --mode 1366x768 --right-of LVDS1 --scale 0.5x0.5
000:<:0030: 28: RANDR-Request(140,21): SetCrtcConfig crtc=0x00000040 timestamp=0x00000000 config timestamp=0x00010a4d x=0 y=0 mode=0x00000000 rr=Rotate_0 outputs=;
000:>:0030:32: Reply to SetCrtcConfig: status=Success(0x00)
screen 0: 1726x768 453x202 mm 96.57dpi
crtc 1: 720x400 70.08 +1366+0 "VGA1"
000:<:0031: 20: RANDR-Request(140,7): SetScreenSize window=0x000000d9 width=1726 height=768 width[mm]=453 height[mm]=202
000:<:0032: 32: RANDR-Request(140,21): SetCrtcConfig crtc=0x00000040 timestamp=0x00000000 config timestamp=0x00010a4d x=1366 y=0 mode=0x000000fc rr=Rotate_0 outputs=0x0000004a;
000:>:0032:32: Reply to SetCrtcConfig: status=Success(0x00)
screen 0: 2049x768 538x202 mm 96.57dpi
crtc 1: 1366x768 59.79 +1366+0 "VGA1"
000:<:002f: 4: Request(36): GrabServer
000:<:0030: 20: RANDR-Request(140,7): SetScreenSize window=0x000000d9 width=2049 height=768 width[mm]=538 height[mm]=202
000:<:0031: 32: RANDR-Request(140,21): SetCrtcConfig crtc=0x00000040 timestamp=0x00000000 config timestamp=0x00010a4d x=1366 y=0 mode=0x000000f8 rr=Rotate_0 outputs=0x0000004a;
000:>:0030:Error 8=Match: major=140, minor=7, bad=217
000:>:0031:32: Reply to SetCrtcConfig: status=Success(0x00)
X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 140 (RANDR)
Minor opcode of failed request: 7 (RRSetScreenSize)
Serial number of failed request: 48
Current serial number in output stream: 49
## 2nd combination same mode & different scale
$ xtrace xrandr --verbose --output VGA1 --mode 1366x768 --right-of LVDS1 --scale 1x1
$ xtrace xrandr --verbose --output VGA1 --mode 1366x768 --right-of LVDS1 --scale 0.5x0.5
screen 0: 2732x768 718x202 mm 96.57dpi
crtc 1: 1366x768 59.79 +1366+0 "VGA1"
000:<:002f: 4: Request(36): GrabServer
000:<:0030: 20: RANDR-Request(140,7): SetScreenSize window=0x000000d9 width=2732 height=768 width[mm]=718 height[mm]=202
000:<:0031: 56: RANDR-Request(140,26): SetCrtcTransform crtc=0x00000040 transform={matrix=1.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,1.000000;}; filter name='nearest' filter params=;
000:<:0032: 32: RANDR-Request(140,21): SetCrtcConfig crtc=0x00000040 timestamp=0x00000000 config timestamp=0x00010a4d x=1366 y=0 mode=0x000000f8 rr=Rotate_0 outputs=0x0000004a;
000:>:0032:32: Reply to SetCrtcConfig: status=Success(0x00)
000:<:0030: 28: RANDR-Request(140,21): SetCrtcConfig crtc=0x00000040 timestamp=0x00000000 config timestamp=0x00010a4d x=0 y=0 mode=0x00000000 rr=Rotate_0 outputs=;
000:>:0030:32: Reply to SetCrtcConfig: status=Success(0x00)
screen 0: 2049x768 538x202 mm 96.57dpi
crtc 1: 1366x768 59.79 +1366+0 "VGA1"
000:<:0031: 20: RANDR-Request(140,7): SetScreenSize window=0x000000d9 width=2049 height=768 width[mm]=538 height[mm]=202
000:<:0032: 56: RANDR-Request(140,26): SetCrtcTransform crtc=0x00000040 transform={matrix=0.500000,0.000000,0.000000,0.000000,0.500000,0.000000,0.000000,0.000000,1.000000;}; filter name='bilinear' filter params=;
000:<:0033: 32: RANDR-Request(140,21): SetCrtcConfig crtc=0x00000040 timestamp=0x00000000 config timestamp=0x00010a4d x=1366 y=0 mode=0x000000f8 rr=Rotate_0 outputs=0x0000004a;
000:>:0033:32: Reply to SetCrtcConfig: status=Success(0x00)
$ tail /var/log/Xorg.0.log
##1st
[ 6644.557] (II) intel(0): resizing framebuffer to 1726x768
[ 6644.560] (II) intel(0): switch to mode 720x400@70.1 on VGA1 using pipe 1, position (1366, 0), rotation normal, reflection none
[ 6660.882] (II) intel(0): switch to mode 1366x768@59.8 on VGA1 using pipe 1, position (1366, 0), rotation normal, reflection none
##2nd
[ 6804.638] (II) intel(0): resizing framebuffer to 2732x768
[ 6804.647] (II) intel(0): switch to mode 1366x768@59.8 on VGA1 using pipe 1, position (1366, 0), rotation normal, reflection none
[ 6817.753] (II) intel(0): resizing framebuffer to 2049x768
[ 6817.757] (II) intel(0): switch to mode 1366x768@59.8 on VGA1 using pipe 1, position (1366, 0), rotation normal, reflection none
其他问题引人注目的案例
xrandr: Failed to get size of gamma for output default
驱动程序支持或未加载驱动器的问题,这nomodeset
与较旧的图形有关。xrandr
如果没有KMS,则无法正常运行。指标:
sudo lshw -c display
可能是*-display UNCLAIMED
还driver=
空。
maximum 1920 x 1080
缓冲区大小恰好是最小的屏幕大小,现在大多数图形都是 maximum 8192 x 8192
,maximum 16384 x 16384
甚至32Kx32K。
- 没有常规的连接名称
default
!
- 使用OpenGL软件渲染器
glxinfo
,例如Gallium3D/llvmpipe
。
重现类似的问题
在不安装来宾添加项/模块(包括vbox图形驱动程序)的情况下创建Ubuntu虚拟机。这将非常慢,并且在真实计算机上也会发生同样的情况。
X Error of failed request: BadMatch (invalid parameter attributes)
(RRQueryOutputProperty)
与一起使用的属性名称错误xrandr --output .. --set <name> <value>
,用户应该首先使用来检查可用属性xrandr --prop
。相同情况在这里解决:
无法更改笔记本电脑的亮度
可用属性取决于所使用的驱动程序和适配器,因此可能是驱动程序先前问题的结果,因为没有向xrandr声明任何属性。
重现类似的问题
xrandr --output <connection-name> --set whatever 0
X Error of failed request: BadMatch (invalid parameter attributes)
(RRAddOutputMode)
我目前的理论,计划有时间以后再测试。记录在这里。所以我不会忘记,其他人可能会提供一些反馈。
xrandr .. --addmode
由于EDID验证,驱动程序拒绝时产生错误。我注意到nvidia在启用“ ModeDebug”后删除了某些模式。要么:
- 来自监视器的EDID数据并不完美
- 驱动程序在处理EDID方面不够强大
- 生成的模式条目不在EDID中声明的监视器范围内
(1&2)解决方案是对Hsync / Vsync / PixelClock的自定义覆盖或完整的本地EDID文件,某些驱动程序可以忽略EDID。
(3)解决方案是尝试不同的模式进入。注意差异
$ cvt 1280 800 60
# 1280x800 59.81 Hz (CVT 1.02MA) hsync: 49.70 kHz; pclk: 83.50 MHz
Modeline "1280x800_60.00" 83.50 1280 1352 1480 1680 800 803 809 831 -hsync +vsync
$ gtf 1280 800 60
# 1280x800 @ 60.00 Hz (GTF) hsync: 49.68 kHz; pclk: 83.46 MHz
Modeline "1280x800_60.00" 83.46 1280 1344 1480 1680 800 801 804 828 -HSync +Vsync
# reduce mode only for flat monitors
$ cvt -r 1280 800 60
# 1280x800 59.91 Hz (CVT 1.02MA-R) hsync: 49.31 kHz; pclk: 71.00 MHz
Modeline "1280x800R" 71.00 1280 1328 1360 1440 800 803 809 823 +hsync -vsync
例如,某些情况下,只需将vsync降低一些即可解决1280 800 59.80
。