X 在启动时读取监视器和布局配置,但 xrandr 只显示 Screen0

X 在启动时读取监视器和布局配置,但 xrandr 只显示 Screen0

我已经设置 arch linux 几天了 - 大多数情况下很容易取得进展,但我在多头支持方面遇到了真正的问题。

我有一台 Thinkpad X1 Extreme,配备 Intel 和 NVIDIA 视频芯片以及混合显卡

我已经安装了:

  • xf86-视频-英特尔
  • xf86-视频-vesa
  • 熊蜂
  • BB开关
  • 光DM
  • i3wm

这是我正在使用的 xorgconf:

Section "ServerLayout"
    Identifier  "Layout0"
    Screen      0 "Screen0" 0 0
    Screen      1 "Screen1" Above "Screen0"
    InputDevice "Mouse0" "CorePointer"
    InputDevice "Keyboard0" "CoreKeyboard"
EndSection

Section "Module"
    Load           "dbe"
    Load           "extmod"
    Load           "type1"
    Load           "freetype"
    Load           "glx"
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         "keyboard"
EndSection
Section "Device"
    Identifier  "intelgpu0"
    Driver      "intel"
    Screen      0
    Option      "XvMC" "true"
    Option      "UseEvents" "true"
    Option      "AccelMethod" "UXA"
    BusID       "PCI:00:02:0"
EndSection

Section "Device"
    Identifier  "intelgpu1"
    Driver      "intel"
    Screen      1
    Option      "XvMC" "true"
    Option      "UseEvents" "true"
    Option      "AccelMethod" "UXA"
    BusID       "PCI:00:02:0"
EndSection

Section "Device"
    Identifier  "nvidiagpu0"
    Driver      "nvidia"
    BusID       "PCI:01:00:0"
EndSection

Section "Monitor"
    Identifier  "Monitor0"
    Option      "Enable" "true"
EndSection

Section "Monitor"
    Identifier  "Monitor1"
    Option      "Enable" "true"
EndSection

Section "Screen"
    Identifier  "Screen0"
    Device      "intelgpu0"
    Monitor     "Monitor0"
    DefaultDepth    24
    Option      "TwinView" "0"
    SubSection "Display"
        Depth       24
    EndSubSection
EndSection

Section "Screen"
    Identifier  "Screen1"
    Device      "intelgpu1"
    Monitor     "Monitor1"
    DefaultDepth    24
    Option      "TwinView" "0"
    SubSection "Display"
        Depth       24
    EndSubSection
EndSection

这是两个视频设备的 lspci -v 输出:

00:02.0 VGA compatible controller: Intel Corporation Device 3e9b (prog-if 00 [VGA controller])
    Subsystem: Lenovo Device 2267
    Flags: bus master, fast devsel, latency 0, IRQ 171
    Memory at 404a000000 (64-bit, non-prefetchable) [size=16M]
    Memory at 80000000 (64-bit, prefetchable) [size=256M]
    I/O ports at 6000 [size=64]
    [virtual] Expansion ROM at 000c0000 [disabled] [size=128K]
    Capabilities: <access denied>
    Kernel driver in use: i915
    Kernel modules: i915

01:00.0 VGA compatible controller: NVIDIA Corporation GP107M [GeForce GTX 1050 Ti Mobile] (rev a1) (prog-if 00 [VGA controller])
    Subsystem: Lenovo GP107M [GeForce GTX 1050 Ti Mobile]
    Flags: bus master, fast devsel, latency 0, IRQ 16
    Memory at bf000000 (32-bit, non-prefetchable) [size=16M]
    Memory at 60000000 (64-bit, prefetchable) [size=256M]
    Memory at 70000000 (64-bit, prefetchable) [size=32M]
    I/O ports at 5000 [size=128]
    Expansion ROM at c0000000 [disabled] [size=512K]
    Capabilities: <access denied>
    Kernel driver in use: nvidia
    Kernel modules: nouveau, nvidia_drm, nvidia

当我启动时,X 似乎可以正常选择布局和屏幕(之前我很难让它阅读第一个屏幕部分):

[     2.312] (==) Using config directory: "/etc/X11/xorg.conf.d"
[     2.312] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[     2.314] (==) ServerLayout "Layout0"
[     2.314] (**) |-->Screen "Screen0" (0)
[     2.314] (**) |   |-->Monitor "Monitor0"
[     2.315] (**) |   |-->Device "intelgpu0"
[     2.315] (**) |-->Screen "Screen1" (1)
[     2.315] (**) |   |-->Monitor "Monitor1"
[     2.315] (**) |   |-->Device "intelgpu1"
[     2.315] (**) |-->Input Device "Mouse0"
[     2.315] (**) |-->Input Device "Keyboard0"
[     2.315] (==) Automatically adding devices
[     2.315] (==) Automatically enabling devices
[     2.315] (==) Automatically adding GPU devices
[     2.315] (==) Automatically binding GPU devices

整个Xorg.0.log的pastebin

bbswitch 似乎可以识别和管理这两个视频设备,尽管存在某种问题:

[    2.272033] bbswitch: loading out-of-tree module taints kernel.
[    2.272053] bbswitch: module verification failed: signature and/or required key missing - tainting kernel
[    2.272220] bbswitch: version 0.8
[    2.272238] bbswitch: Found integrated VGA device 0000:00:02.0: \_SB_.PCI0.GFX0
[    2.272243] bbswitch: Found discrete VGA device 0000:01:00.0: \_SB_.PCI0.PEG0.PEGP
[    2.272435] bbswitch: detected an Optimus _DSM function
[    2.272526] bbswitch: Succesfully loaded. Discrete card 0000:01:00.0 is on
[    2.276310] bbswitch: disabling discrete graphics

dmesg 整个输出的 Pastebin

xrandr但仍然xrandr --listproviders只显示 1 个屏幕和 1 个提供商:

$ xrandr
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 8192 x 8192
eDP1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
   1920x1080     60.03*+  59.96    59.93    47.99  
   1680x1050     59.95    59.88  
   ...

$ xrandr --listproviders
Providers: number : 1
Provider 0: id: 0x43 cap: 0xb, Source Output, Sink Output, Sink Offload crtcs: 3 outputs: 1 associated providers: 0 name:Intel

我无法使用 xrandr 打开或移动显示器,因为启动后输出不可用(无论是否插入显示器)

答案1

我对此有一个解决方案:

我删除了 xorg conf 文件,这样它们就不会干扰,然后xrandr开始在屏幕 0 上显示虚拟输出。

我运行intel-virtual-output这导致屏幕闪烁,并xrandr显示很多更多的虚拟输出,其中 ( VIRTUAL3) 之一已连接。

之后,我可以设置其模式,显示屏打开并显示工作区。

分辨率非常错误,我无法创建具有正确分辨率的模式,但这是另一个问题。

相关内容