在 Linux 中,如何正确配置多个 GPU(Intel 和 nVidia)上的多个显示器的显示几何?

在 Linux 中,如何正确配置多个 GPU(Intel 和 nVidia)上的多个显示器的显示几何?

我希望三重显示器设置能够正常工作。

我的设置如下:

  • Linux Mint 16 x64
  • 英特尔酷睿 i5-2500k
  • GeForce GTX 560 Ti Cu II
  • 最右边的显示器连接到主板(i5 上的集成显卡)
  • 连接到显卡的中央显示器
  • 最左边的显示器连接到显卡

我正在使用以下 xorg.config

Section "ServerFlags"
    Option "DefaultServerLayout" "PrimaryLayout"
    Option "Xinerama" "off"
EndSection

Section "Module"
    Load "glx"
EndSection

Section "InputDevice"
    Identifier     "Mouse"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    Identifier     "Keyboard"
    Driver         "kbd"
EndSection

Section "Device"
    Identifier "Intel HD Graphics 3000"
    Driver     "intel"
EndSection

Section "Device"
    Identifier     "Geforce GTX 560 Ti"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    Screen 0
EndSection

Section "Monitor"
    Identifier "AOC"
    Option "Primary" "true"
EndSection

Section "Monitor"
    Identifier "Samsung"
EndSection

Section "Monitor"
    Identifier "ViewSonic"
EndSection

Section "Screen"
    Identifier "Samsung"
    Device "Intel HD Graphics 3000"
    Monitor "Samsung"
    SubSection "Display"
        Depth 24
    EndSubSection
EndSection

Section "Screen"
    Identifier "AOC"
    Device "Geforce GTX 560 Ti"
    Monitor "AOC"
    SubSection "Display"
        Depth 24
    EndSubSection
EndSection

Section "Screen"
    Identifier "ViewSonic"
    Device "Geforce GTX 560 Ti"
    Monitor "ViewSonic"
    SubSection "Display"
        Depth 24
    EndSubSection
EndSection

Section "ServerLayout"
    Identifier    "PrimaryLayout"
    Screen        "AOC" 0 0 
    Screen        "ViewSonic" LeftOf "AOC"
    Screen        "Samsung" RightOf "AOC"
    InputDevice   "Keyboard" "CoreKeyboard"
    InputDevice   "Mouse" "CorePointer"
EndSection

Section "ServerLayout"
    Identifier "SingleLayout"
    Screen "AOC" 0 0
    InputDevice "Keyboard" "CoreKeyboard"
    InputDevice "Mouse" "CorePointer"
EndSection

其效果如下:

  • 最右边的显示器不工作
  • 中央和左侧显示器工作正常

更多信息:

  • 我在内核3.11.0-12-generic
  • 我正在使用 nvidia 专有驱动程序版本331.67

答案1

当我在学习 Slackware 时,有一份关于安装、配置和维护发行版的优秀新手指南。多年来,它有所变化,可能看起来与 Debian & Co. 无关,但我仍然认为SlackBook是一份很好的介绍材料。

不作任何(我认为应该的)判断,但人们似乎完全忽略了 xorg 手册。也许是因为他们被灌输了这样的观念:Xorg 会“自行配置”,就像人们在 Windows 中习惯的那样。但事实并非总是如此,关于如何设置双显示器的信息也很多。我在这个网站上回答过至少两个类似的问题,它们都与一个非常相似的问题有关。

那么说到点子上了;

man xorg.conf

SERVERLAYOUT SECTION
(...)
Screen  screen-num "screen-id" position-information
(...)

详细信息请参阅手册页。您需要的内容如下:

Section "ServerLayout"
    Identifier      "Three monitors"
    Screen  0       "Screen0" 0 0
    Screen  1       "Screen1" RightOf "Screen0"
    Screen  2       "Screen2" RightOf "Screen1"
EndSection

清单:

  • 屏幕使用正确的设备和监视器标识符
  • 屏幕至少有一个显示子部分,具有分辨率和深度
  • 为使用的设备加载驱动程序

笔记:

双头视频卡(设备部分)可能需要特殊选项,如总线和显示模式。ATI 卡过去常常将输出“复制”到两个头。通过在设备部分传递某些选项可以防止这种情况。使用 xorg 驱动程序的手册页。

使用最新版本的 Xorg,xrandr可用于配置和启用多个监视器并将它们相互定位。配置多个监视器的 xorg.config 并不是必需的,但可能更方便。

相关内容