How to Configure Multiple Video Cards in Linux – Xorg and TwinView Setup

linuxmultiple-monitorstwinviewxorg

In Ubuntu Lucid Lynx RC, I got NVidia's TwinView to work with 2 monitors in a single video card. But when I use the same monitors but split them between the video cards I can't make TwinView work and it starts a X server for each monitor.

I want the same effect I had with one video card.

Best Answer

i do not think thats possible with twinview, but i think it is possible with xinerama.

first, read 'Chapter 13. Configuring TwinView'. i do not see anything related to multiple gpus. the "only" reason to use twinview over normal xinerama is that with twinview all displays can show hw-accelerated opengl. so, imho, xinerama is the way to go.

read 'Chapter 15. Configuring Multiple X Screens on One Card' to find out about how to setup multiple 'screens' (a 'screen' is connected to a 'device'[gpu] and a monitor, so basically a 'screen' equals one of your monitors). without any further tuning you will now have one xserver running which shows several 'separated' areas (you can't move windows between them).

Section "Screen" Identifier "left_screen" Device "left_gpu" Monitor "left_monitor" DefaultDepth 24 Subsection "Display" Depth 24 Modes "1600x1200" EndSubsection EndSection

Section "Screen"
    Identifier  "middle_screen"
    Device      "left_gpu"
    Monitor     "middle_monitor"
    DefaultDepth 24
    Subsection "Display"
        Depth       24
        Modes       "1600x1200"
    EndSubsection
EndSection

Section "Screen"
    Identifier  "right_screen"
    Device      "right_gpu"
    Monitor     "right_monitor"
    DefaultDepth 24
    Subsection "Display"
        Depth       24
        Modes       "1600x1200"
    EndSubsection
EndSection

you add up all 'screens' until you are satisfied with your layout (you can have multiple layouts, distinguish them via the Identifier statement):

 Section "ServerLayout"
    ...
    Screen         0 "left_screen" 
    Screen         1 "middle_screen" rightOf "left_screen"
    Screen         2 "right_screen" rightOf "middle_screen"
    ...
EndSection

now read 'Chapter 14. Configuring GLX in Xinerama'. essentially it says: put

Option "Xinerama" "True"

to your Serverflags section.

Related Question