Sunday, November 6, 2011

How to 3 monitors 2 graphics cards ubuntu xorg.conf

What a pain! After three days of frustration I finally was able to setup my three monitors to work on ubuntu.

Here is my xorg.conf:

# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings: version 285.05.09 (buildmeister@swio-display-x86-rhel47-02.nvidia.com) Fri Sep 23 17:55:42 PDT 2011

Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0" 0 0
Screen 1 "Screen1" Absolute 1600 900 #Location of first screen
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
Option "Xinerama" "1" #Use this to stich monitors together so windows can be moved
EndSection

Section "Files"
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 "kbd"
EndSection

Section "Monitor"
# HorizSync source: edid, VertRefresh source: edid
Identifier "Monitor0"
VendorName "Unknown"
ModelName "HP S2031"
HorizSync 24.0 - 83.0
VertRefresh 50.0 - 76.0
Option "DPMS"
EndSection

Section "Monitor"
# HorizSync source: edid, VertRefresh source: edid
Identifier "Monitor1"
VendorName "Unknown"
ModelName "HP S2031"
HorizSync 24.0 - 83.0
VertRefresh 50.0 - 76.0
Option "DPMS"
EndSection

Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "GeForce GTX 480"
BusID "PCI:1:0:0"
Option "RandRRotation" "on"
EndSection

Section "Device"
Identifier "Device1"
Driver "radeon"
VendorName "ATI Technologies"
BoardName "AMD Radeon HD 6500"
BusID "PCI:2:0:0"
EndSection

Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
Option "TwinView" "1"
Option "TwinViewXineramaInfoOrder" "DFP-0"
Option "metamodes" "DFP-0: nvidia-auto-select +0+0, DFP-2: nvidia-auto-select +0+900"
SubSection "Display"
Depth 24
EndSubSection
EndSection

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


Important points:
Make sure binary drivers are installed for your graphics cards.
Use nvidia-settings to create and test your xorg.conf files. I noticed it was a lot easier to start with one screen, get each one working individually and then combine.

Backup, backup, backup your working xorg.conf. I screwed this up >10xs and it was nice to have a backup. Also alt-ctrl-backspace came in very handy so I could quickly retest my xorg.conf by restarting.

Option "Xinerama" "1" was needed so I could pass windows between my screens. I had issues using this if compiz effects were enabled, so I just turned off all, looks like it is an issue specific to 11.04, not older versions.

Also lspci |grep VGA was helpful to see my card info, this was needed in the xorg.conf file. I had issues with the relative screen positioning so I used absolute positioning which I would recommend.

Please post comments with any questions or feedback.

2 comments:

phreakincool said...

I only see 2 Monitors defined here. Just saying.

mahasiswa teladan said...

hi..Im student from Informatics engineering, this article is very informative, thanks for sharing :)