Linux – In Linux, how to correctly configure display geometry with multiple monitors on multiple GPUs (Intel and nVidia)

intel graphicslinuxmultiple-monitorsnvidia-graphics-cardxorg.conf

I want a triple monitor setup to work correctly.

My setup is as follows:

  • Linux Mint 16 x64
  • Intel Core i5-2500k
  • GeForce GTX 560 Ti Cu II
  • A monitor on the far right connected to the motherboard (integrated graphics on the i5)
  • A central monitor connected to the graphics card
  • A monitor on the far left connected to the graphics card

I'm using the following 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

Which has the following effect:

  • The far right monitor doesn't work
  • The central and left monitors work as expected

A little bit more info:

  • I'm on kernel 3.11.0-12-generic
  • I'm using nvidia proprietary driver version 331.67

Best Answer

When I was learning the ropes on Slackware, there was this excellent newbie guide to installing, configuring and maintaining the distro. It has changed somewhat over the years, may not seem relevant to Debian & Co., but I still think that the SlackBook is a good piece of introductory material.

Not to pass any (imho due) judgement, but people seem to ignore the xorg manuals entirely. Maybe it's because they are made to believe that Xorg will "configure itself" as one may be accustomed with in Windows. This is not always the case and there is plenty of information out there on how to set up a dual monitor. I've answered at least two similar questions on this site about a very similar problem.

To the point then;

man xorg.conf

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

The details are in the man page. What you want looks something like:

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

Checklist:

  • Screens use correct device and monitor identifiers
  • Screen has at least on Display sub section with a resolution and depth
  • Drivers are loaded for the used devices

Notes:

Dual-head video cards (device section) may need special options such as bus and display mode. ATI cards used to "copy" the output to both heads in the past. This was preventable by passing certain options in the device section. Use the manual page of the xorg driver.

With recent versions of Xorg, xrandr can be used to configure and enable several monitors and to position them relative to each other. Having an xorg.config that configures several monitors is not really necessary, but may be more convenient.

Related Question