PDA

View Full Version : HOWTO: Dual Screen in Ubuntu - Two Video Cards


Spleenie
August 2nd, 2005, 09:50 PM
Here goes:

I wanted to get a dual head (two screen) setup happening in Ubuntu. To date, there is no setup facility to get it going, so it was a matter of setting up xorg.conf to do it for me, which as it turned out was a reasonably simple process. I will relate my process to you, and I hope that if people have managed to do it differently/easier, that they post in this thread. :)

My Setup:

1 x AGP Video Card (NVIDIA GeForce)
1 x PCI Video Card (NVIDIA Riva TNT2)
1 x Samsung SyncMaster 17" monitor (attached to AGP card)
1 x DELL M770 17" monitor (attached to PCI card)
Nothing to lose.

Now if you have the time, you can put each video card in seperately, boot up the machine and when everything loads (probably not running the xserver properly) type the following to setup your X-system.

sudo dpkg-reconfigure xserver-xorg

This will run through the process of setting up your video card and monitor and more importantly, create an xorg.conf with info particular to your setup. Backup this file to something appropriate ie if you tried the agp card 1st:

sudo cp xorg.conf xorg.conf.agp_samsung

Put in the other card and do the same thing, creating something like xorg.conf.pci_dell

For the next bit, I will show my completed xorg.conf file:

# /etc/X11/xorg.conf (xorg X Window System server configuration file)
#
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
#
# Edit this file with caution, and see the /etc/X11/xorg.conf manual page.
# (Type "man /etc/X11/xorg.conf" at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following commands:
#
# cp /etc/X11/xorg.conf /etc/X11/xorg.conf.custom
# sudo sh -c 'md5sum /etc/X11/xorg.conf >/var/lib/xfree86/xorg.conf.md5sum'
# sudo dpkg-reconfigure xserver-xorg

Section "Files"
FontPath "unix/:7100" # local font server
# if the local font server has problems, we can fall back on these
FontPath "/usr/lib/X11/fonts/misc"
FontPath "/usr/lib/X11/fonts/cyrillic"
FontPath "/usr/lib/X11/fonts/100dpi/:unscaled"
FontPath "/usr/lib/X11/fonts/75dpi/:unscaled"
FontPath "/usr/lib/X11/fonts/Type1"
FontPath "/usr/lib/X11/fonts/CID"
FontPath "/usr/lib/X11/fonts/100dpi"
FontPath "/usr/lib/X11/fonts/75dpi"
# paths to defoma fonts
FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/CID"
EndSection

Section "Module"
Load "GLcore"
Load "bitmap"
Load "dbe"
Load "ddc"
Load "dri"
Load "extmod"
Load "freetype"
Load "glx"
Load "int10"
Load "record"
Load "type1"
Load "vbe"
EndSection

Section "InputDevice"
Identifier "Generic Keyboard"
Driver "keyboard"
Option "CoreKeyboard"
Option "XkbRules" "xorg"
Option "XkbModel" "pc104"
Option "XkbLayout" "us"
EndSection

Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ImPS/2"
Option "Emulate3Buttons" "true"
Option "ZAxisMapping" "4 5"
EndSection

Section "Device"
Identifier "NVIDIA Riva PCI"
Driver "nv"
BusID "PCI:0:8:0"
EndSection

Section "Monitor"
Identifier "DELL"
Option "DPMS"
HorizSync 30-70
VertRefresh 50-160
EndSection

Section "Screen"
Identifier "RIGHT SCREEN"
Device "NVIDIA Riva PCI"
Monitor "DELL"
DefaultDepth 16
SubSection "Display"
Depth 1
Modes "1280x1024" "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 4
Modes "1280x1024" "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 8
Modes "1280x1024" "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 15
Modes "1280x1024" "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 16
Modes "1280x1024" "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 24
Modes "1280x1024" "1024x768" "800x600" "640x480"
EndSubSection
EndSection


# Attempt to get the AGP card working

Section "Device"
Identifier "NVIDIA GeForce AGP"
Driver "nv"
BusID "PCI:1:0:0"
EndSection

Section "Monitor"
Identifier "SAMSUNG"
Option "DPMS"
HorizSync 30-65
VertRefresh 50-120
EndSection

Section "Screen"
Identifier "LEFT SCREEN"
Device "NVIDIA GeForce AGP"
Monitor "SAMSUNG"
DefaultDepth 16
SubSection "Display"
Depth 1
Modes "1280x1024" "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 4
Modes "1280x1024" "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 8
Modes "1280x1024" "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 15
Modes "1280x1024" "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 16
Modes "1280x1024" "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 24
Modes "1280x1024" "1024x768" "800x600" "640x480"
EndSubSection
EndSection

Section "ServerLayout"
Identifier "Dual Screen"
Screen 0 "LEFT SCREEN" 0 0
Screen 1 "RIGHT SCREEN" RightOf "LEFT SCREEN"
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
EndSection

Section "DRI"
Mode 0666
EndSection

Section "ServerFlags"
Option "Xinerama" "true"

EndSection

Ok so everything from the start to the InputDevice section should be common to both files you generated, so you could just copy and paste that into a new file, or just use the last xorg.conf you generated and add the other card/monitor/screen info to that.

The next part of the file gives information about the card, the monitor and the screen.

Section "Device"
Identifier "NVIDIA Riva PCI"
Driver "nv"
BusID "PCI:0:8:0"
EndSection

Section "Monitor"
Identifier "DELL"
Option "DPMS"
HorizSync 30-70
VertRefresh 50-160
EndSection

Section "Screen"
Identifier "RIGHT SCREEN"
Device "NVIDIA Riva PCI"
Monitor "DELL"
DefaultDepth 16
SubSection "Display"
Depth 1
Modes "1280x1024" "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 4
Modes "1280x1024" "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 8
Modes "1280x1024" "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 15
Modes "1280x1024" "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 16
Modes "1280x1024" "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 24
Modes "1280x1024" "1024x768" "800x600" "640x480"
EndSubSection
EndSection
The only thing to check here is the busid, which you can find for yourself by typing
lspci

This is the relevant output:

0000:00:08.0 VGA compatible controller: nVidia Corporation NV5M64 [RIVA TNT2 Model 64/Model 64 Pro] (rev 15)

0000:01:00.0 VGA compatible controller: nVidia Corporation NV11 [GeForce2 MX/MX 400] (rev b2)

This tells me that the BusID for my Riva is PCI:0:8:0 and the GeForce is PCI:1:0:0 (Yer even though its AGP ;) )

Also, with the screen setup, I have chosen the Samsung monitor to be the Left screen. I named the screens with this in mind because I am easily confused. You can can call your screens whatever you wish.

Copy and paste the Device, Monitor and Screen information from your other xorg.conf file for the other card/monitor combo.

Then we come to the ServerLayout end of the file.

Section "ServerLayout"
Identifier "Dual Screen"
Screen 0 "LEFT SCREEN" 0 0
Screen 1 "RIGHT SCREEN" RightOf "LEFT SCREEN"
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
EndSection

Ok so "Idenfitier" is just giving it a name. The "Screen" section indicates the geometry of the screens. You can apparently use "RightOf","LeftOf" and there are probably others. Don't forget the 0 0. The "InputDevice" part should be the same in both of your generated xorg.conf files so keep that there too.

This setup "should" set you up with two independant screens on reboot, but you won't be able to drag windows from one screen to the other. To have the two screens act like two halves of one big screen, you need to enable "Xinerama" support.

Section "ServerFlags"
Option "Xinerama" "true"

EndSection

This goes at the end of xorg.conf. Keep in mind that Xinerama kicks up a stink if the different screens are running at different colour depths, so make sure they are both 16 or 24 or whatever

Anyway I hope this helps you out! Please feel free to add comments/better ways of doing it/etc

- Spleenie

andlinux21
August 2nd, 2005, 10:25 PM
Cool HOWTO not that I would try it but its nice info to know...

Quest-Master
August 3rd, 2005, 01:32 AM
Hmm, so you can't do this one video card? I've been misled for a while now then. XD

Spleenie
August 3rd, 2005, 01:55 AM
Hmm, so you can't do this one video card? I've been misled for a while now then. XD

I am certain you can, however I don't have a two-output video card and as such am little qualified to instruct on ones use :)

aaarg
August 3rd, 2005, 09:01 AM
Hmm, so you can't do this one video card? I've been misled for a while now then. XD


Many newer cards that have both DVi and VGA outputs can be utilized for a dual monitor setup, but I must admit I dont know how well if works with Ubuntu since I have never tried it.

animacide
August 3rd, 2005, 02:28 PM
I'm currently using TwinView with my nVidia GeForceFX 5500, and it works very well. I had tried using both Xinerama & MergedFB with my old ATI card, and it just didn't work (no acceptable dual head + DRI acceleration).

aaarg
August 3rd, 2005, 05:32 PM
ive had mixed results as well, depends on the card....just try and see, worst case scenario it doesnt work

Maria_Firewire
July 18th, 2007, 03:24 PM
Hey thanks so much for the HOW-TO! I got it sort of working, haha. My second screen still looks pretty hosed but I think im almost there. Its showing up as a bunch of black and tan (ubuntu background) colored lines. It shouldn't matter if they are two very different cards right? As long as they work individually okay? One is a Nvidia GeForce (AGP) and the other is some super old Matrox P.O.S. (PCI).

I know this is a super old thread but if anybody has any ideas on what i should try checking first, let me know.

Thanks!

Maria

Dr_Snapid
November 10th, 2008, 08:11 AM
Now if you have the time, you can put each video card in seperately, boot up the machine and when everything loads (probably not running the xserver properly) type the following to setup your X-system.

- Spleenie
:guitar: That's a good idea. [slaps self]

I am trying to get three monitors working off 2 cards. (8600GT running 2x19in@1280x1024 plus a 8500GT running a single 24in@1920x1200)

I have however found since 7.04 that dpkg-reconfigure xserver-xorg doesnt do all that it used to.

I now find disabling and re-enabling the nvidia driver using the:
System >Administration> hardware drivers
tool does help to reset me to a working xorg state after I have killed it mucking around.

I will try your idea tomorrow, I already have the 8600GT running both 19in monitors. I will try removing that card and set up to run just the 24inch and then I will use the 2 xorg.conf files to make a single file to run both cards (i hope)