Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Multiple monitors with two GPUs from different vendors
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
PlatinumTrinity
n00b
n00b


Joined: 10 Mar 2020
Posts: 37

PostPosted: Wed Aug 26, 2020 3:00 pm    Post subject: Multiple monitors with two GPUs from different vendors Reply with quote

Hello again,

I would like to run multiple monitors as one xscreen over two GPUs. One GPU is the built in Intel GPU and the other (my primary GPU) is an Nvidia GTX980 using Nvidia's proprietary drivers. In Windows this just works; I can plug one monitor into the iGPU and extend the desktop to it/move windows to and from it. In Gentoo Linux I'm running into the problem of the Nivida X Server settings not seeing the connected monitor for the other GPU.

I've done a lot of searching to see if anyone else has run into a similar problem. I'm not getting very far, the one person with a similar set-up to my own eventually gave up and bought new graphics cards.

Is it possible to share a desktop between GPUs from different vendors or should I just look into buying new hardware? Right now I'm able to plug in the 5th display (a television) and mirror my primary screen to it. The 4th monitor is disconnected automagically until I unplug the 5th monitor. This works but is rather annoying.

The purpose of wanting to do this is simple: I play games on this computer and want to mirror the primary display to the television for when I'm playing local co-op. I used to dual boot into windows for this but recently the main game I play got decent linux support through Proton so I'm hoping to replicate this monitor set-up in Linux and delete the Windows partition.

Not asking to be spoonfed just some pointers in the right direction so I can figure it out myself. Most documentation on this topic is for laptops running two GPUs.
Back to top
View user's profile Send private message
Ralphred
Tux's lil' helper
Tux's lil' helper


Joined: 31 Dec 2013
Posts: 117

PostPosted: Wed Aug 26, 2020 4:14 pm    Post subject: Reply with quote

It's not actually that hard, you just have to default back to the old way of doing things with an xorg.conf file(s).
I was messing about with an old style file recently, you should be able to hack this around to fit your hardware:
Code:
Section "ServerFlags"
        Option "DefaultServerLayout"  "Dual-Monitor"
EndSection

Section "ServerLayout"
        Identifier         "Dual-Monitor"
        Screen          0  "Screen:0" 0 0                        #location of top left corner of monitor
        Screen          1  "Screen:1" RightOf "Screen:0" # can also use Above, Below and LeftOf
        Screen          2  "Screen:2" 0 0
        Screen          3  "Screen:3" RightOf "Screen:2"
        InputDevice        "Mouse0" "CorePointer"
        InputDevice        "Keyboard0" "CoreKeyboard"
        Option             "Xinerama" "True"
        Option             "DisableVidModeExtension"  "True"
EndSection

Section "Module"
        Load  "glx"
EndSection

Section "InputClass"
  Identifier "keyboard"
  MatchIsKeyboard "yes"
  Option            "XkbModel" "pc105"
  Option            "XkbLayout" "gb"
  Option            "XkbOptions" "ctrl:nocaps, terminate:ctrl_alt_bksp, nodeadkeys"
EndSection

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

Section "InputDevice"
        Identifier  "Mouse0"
        Driver      "mouse"
        Option      "Protocol" "auto"
        Option      "Device" "/dev/input/mice"
        Option      "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
        Identifier   "Monitor-Asus"
        VendorName   "Asus"
        ModelName    "VP248QG"
        Modeline     "AsusMode"  170.00  1920 1928 1960 2026  1080 1105 1113 1119 +hsync -vsync
        Modeline     "LGMode"  148.50  1920 2008 2052 2200  1080 1084 1089 1125 +hsync +vsync
        #Option "Primary"
EndSection

Section "Monitor"
        Identifier   "Monitor-LG"
        VendorName   "LG"
        ModelName    "MP2455"
        Modeline     "LGMode"  148.50  1920 2008 2052 2200  1080 1084 1089 1125 +hsync +vsync
EndSection

Section "Device"
        Identifier  "DisplayPort:0"  #This identifier is referenced below, just be aware and change it to make sense
        Driver      "amdgpu"          #### each device section is a physical output from a GPU
        BusID       "PCI:11:0:0"     #### alter the driver, busid and screen to suit
        Screen          0
        Option      "TearFree" "True"
EndSection

Section "Device"
        Identifier  "DisplayPort:1"
        Driver      "amdgpu"
        BusID       "PCI:11:0:0"
        Screen          1
        Option      "TearFree" "True"
EndSection

Section "Device"
        Identifier  "HDMI:0"
        Driver      "amdgpu"
        BusID       "PCI:11:0:0"
        Screen          2
        Option      "TearFree" "True"
EndSection

Section "Device"
        Identifier  "HDMI:1"
        Driver      "amdgpu"
        BusID       "PCI:11:0:0"
        Screen          3
        Option      "TearFree" "True"
EndSection



Section "Screen"
        Identifier "Screen:0"
        Device     "DisplayPort:0"
        Monitor    "Monitor-Asus"
        SubSection "Display"
                Viewport   0 0
                Depth      24
                Modes      "AsusMode"
        EndSubSection
EndSection

Section "Screen"
        Identifier "Screen:1"
        Device     "DisplayPort:1"
        #Monitor    "Monitor-LG"
        SubSection "Display"
                Viewport   0 0
                Depth      24
                Modes      "LGMode"
        EndSubSection
EndSection

Section "Screen"
        Identifier "Screen:2"
        Device     "HDMI:0"
        #Monitor    "Monitor-Asus"
        SubSection "Display"
                Viewport   0 0
                Depth      24
                Modes      "AsusMode"
        EndSubSection
EndSection

Section "Screen"
        Identifier "Screen:3"
        Device     "HDMI:1"
        Monitor    "Monitor-LG"
        SubSection "Display"
                Viewport   0 0
                Depth      24
                Modes      "LGMode"
        EndSubSection
EndSection


You are basically defining outputs from each card, defining monitors, connecting them in the screen sections, then arranging the screens in the serverlayout section.
If stuff isn't working the log file should say why. The documentation from `man xorg.conf` is very complete, if a little overwhelming to the uninitiated.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum