Two video cards, three X sessions, five monitors: yes, it works

So I wanted a lot of screens for the new system I was building: lots of stuff to monitor, a reasonable amount of deskspace, and a desire to have at least one separate X session to handle fullscreen games without needing multiple profiles.

It wasn’t particularly difficult to set up, but documentation was sparse. To help anyone else who might be looking to do something similar, I’m providing my X config here; chances are, if you’re looking to do something similar, you’ll be able to figure out what needs to be tweaked.

First, the relevant components here are the following:
– nVidia GeForce GTX 660
– nVidia GeForce GT 610
– Three identical 21.5″ monitors
– One 21.5″ monitor (the one on the left)
– One 24″ monitor (the one on the right)

My exact configuration was partially determined by system architecture: my motherboard, like most, only provides PCIe x16 to the primary slot if the secondary is unoccupied; if it is occupied, as would be the case for SLI or ATi’s equivalent (neither of which are known to work well under Linux right now), the primary slot will go down to x8. In practice, this probably wouldn’t have bothered me at all, but I didn’t want to buy a GTX 650 just to drive the primary monitor bank at reduced bandwidth (even though, in retrospect, that might have been a better idea). Anyway, what I ended up doing was having the GT 610 drive the monitor on the left at x1 (which is fine for DVDs and blu-rays and streaming video) and the GTX 660 drive all the rest.

I wanted to have the 24″ monitor on a separate X session for gaming purposes, and the fact that the monitor on the left was on another video card necessitated another X session, making for a total of three. This eliminated Unity (Ubuntu’s default desktop environment) because it doesn’t do multi-X-session setups yet, so after a little experimentation, I decided to go with KDE: several applications, like Konsole and Konqueror, will only spawn windows in the X session the root instance already occupies, so some workarounds have proven necessary, but it’s worked pretty well overall, thus far.

What follows is the X config, exactly as I have it working now.


Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0" 0 0
Screen 1 "Screen1" RightOf "Screen0"
Screen 2 "Screen2" RightOf "Screen1"
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
Option "Xinerama" "0"
EndSection

Section "Files"
EndSection

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

Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
EndSection

Section "Monitor"
Identifier "Monitor0"
VendorName "Unknown"
ModelName "Samsung SyncMaster"
Option "DPMS"
EndSection

Section "Monitor"
Identifier "Monitor1"
VendorName "Unknown"
ModelName "BenQ GW2250"
Option "DPMS"
EndSection

Section "Monitor"
Identifier "Monitor2"
VendorName "Unknown"
ModelName "SCEI Monitor"
Option "DPMS"
EndSection

Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "GeForce GT 610"
BusID "PCI:2:0:0"
EndSection

Section "Device"
Identifier "Device1"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "GeForce GTX 660"
BusID "PCI:1:0:0"
Screen 0
EndSection

Section "Device"
Identifier "Device2"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "GeForce GTX 660"
BusID "PCI:1:0:0"
Screen 1
EndSection

Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
Option "Stereo" "0"
Option "metamodes" "nvidia-auto-select +0+0"
SubSection "Display"
Depth 24
EndSubSection
EndSection

Section "Screen"
Identifier "Screen1"
Device "Device1"
Monitor "Monitor1"
DefaultDepth 24
Option "Stereo" "0"
Option "UseDisplayDevice" "DFP-0, DFP-2, DFP-3"
Option "nvidiaXineramaInfoOrder" "DFP-0, DFP-2, DFP-3"
Option "metamodes" "DFP-0: nvidia-auto-select +3840+0, DFP-2: nvidia-auto-select +0+0, DFP-3: nvidia-auto-select +1920+0"
SubSection "Display"
Depth 24
EndSubSection
EndSection

Section "Screen"
Identifier "Screen2"
Device "Device2"
Monitor "Monitor2"
DefaultDepth 24
Option "Stereo" "0"
Option "UseDisplayDevice" "DFP-1"
Option "metamodes" "nvidia-auto-select +0+0"
SubSection "Display"
Depth 24
EndSubSection
EndSection

So, yeah, nothing particularly complex, but stitching it together took a couple of hours of experimentation. Hopefully this helps someone else save some time.

Leave a Reply

Your email address will not be published. Required fields are marked *