LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   How to use 2 different GPUs simultaneously under Linux? (https://www.linuxquestions.org/questions/linux-desktop-74/how-to-use-2-different-gpus-simultaneously-under-linux-4175463658/)

Lenry 05-27-2013 05:16 PM

How to use 2 different GPUs simultaneously under Linux?
 
I have this problem for quite a long time, asking about it in the forums of my actual distros, but nobody could answer. Maybe the good people here can...

I have two monitors, and a TV. Monitors on the discrete graph card (NVIDIA GeForce GTX460), TV is on the CPU's integrated GPU (Intel HD3000 in a Core-i7 2600K).

On Windows I can use all three displays in a big expanded desktop

How can I achieve something similar under Linux?

I use nouveau driver for the GeForce, as I can load the i915 Intel driver with it simultaneously, this cannot be done with the proprietary NVIDIA driver.

lspci sees both GPUs, but nothing else does, I can't expand the desktop to the TV. Fedora's bootscreen appears there, but after boot I can't use it anymore.

Previously I used Arch Linux, and there, with Xorg.conf I managed to activate all of the displays, but there was a slight problem: The two monitors appeared as one 2560x1024 desktop in KDE, the TV was a separate desktop. If the mouse was on monitor1, and I draged it to right, it reached monitor2, and after that it should appear in the left side of the TV, but instead it appeared in the 2/3 of it (probably at 1281st pixelcoloumn). After that, the mouse could use the full area of the TV. If I dragged it back to the left, it fully skipped monitor2 and appears at the right side of monitor1. From that I suspect that somehow the area of monitor2 overlaps the top left 1280 by 1024 pixels of the TV.

This was the Xorg.conf, but as you can read, this wasn't really a solution, and as far as I know, xorg.conf is deprecated

Do anyone have any idea? Thank you for your answers

archShade 05-28-2013 01:59 AM

This is a non-trivial problem (as you seem to have found).

One thing that makes this difficult is that you are using 2 diffrent vendors for GPUs, this means that there are no vendor tools that will play nice with both cards. Some of the standard tools may allow you to do this (which one you use depends on your DE).

However I would fall back to using Xorg.conf, I'm not sure why you think Xorg.conf is depreciated in my experiance most tools use the file to save settings. As a rule end users should not have to interact with xorg.conf. Xorg.conf is overly complex, you are beyond standard usage here so its the hard way.

I would attempt to re-implement your Xorg file and see if you get the same incorrect behaviour as before. Then try to work out why you are getting the behaviour you are, you should be able to edit the file to make it correct once you have all 3 screens working.

There are some lmitations about what can be achieved with x due to how it works, the monitors on seprate cards will be regarded compleatley sepratley and you may find situations where the you have to treat the TV as seperate from the the other 2.

Lenry 05-28-2013 02:35 PM

Thanks for the reply
Yes, I realized that this is a non-trivial problem, as it seems that nobody have it before :)

For DE I use KDE, but it helps me nothing in this matter, as in the Display Settings it only sees the 4 ports of the graph.card and the two monitors attached to it.
Before anyone ask it: the GF104 GPU handles only two monitors at any time, so even I have 2 DVI, a D-Sub and an HDMI port, I can only use two of them at the same time

I experienced that less and less programs care of what I write in xorg.conf, that's why I thought it's deprecated, but try it that way :)

The previously linked xorg.conf was based on these two documents published by Intel:
Inside Linux Graphics
Hybrid Multi-Monitor Support

I read them and rewrote my config many times from scratch, to avoid errors, but the overlapping problem remained then.

But today I reached a breakthrough!

Thanks for your advices I run through that old xorg.conf and merged it into the current one, and it works!
It's basically the same as before, but it works. I don't know how or why, but it does :)

It creates a totally separate desktop, I can't directly launch any application there, only with the DISPLAY=":0.1" appname command, but it isn't a problem, as I only want to use it for XBMC, and I can easily modify it's launch command to this.

One new problem occurs though...
The virtual desktop is a little bit bigger than the actual size of the TV, so the edges of it are out of the visible space.

I modified xorg.conf a bit more, added a few data of the TV, according to /var/log/Xorg.0.log

Code:

Section "Monitor"
        Identifier  "Monitor2"
        VendorName  "Panasonic"
        ModelName    "P42S30E"
        DisplaySize    508 285
        Option          "DPI" "96 x 96"
        Option          "DMPS"
        ModeLine        "1920x1080" 148.50 1920 2448 2492 2640 1080 1084 1089 1125 #-HSync +VSync
EndSection

...but it didn't help

So this is where I am now, farer than any other point in the past 17 months, since I have the TV, but not at the finish line.
It worthed to registrate here :)

archShade 05-29-2013 12:12 PM

Well I am glad you found my reply helpful, I'm not entirley sure how - maybe I just got you to revisit a path that you had previously discarded.

Anyway the next issue. I am not sure what is causing this. Maybe if you could answer some questions it could help.

1) When you say the desktop is to big for the monitor what do you mean, Can you pan around or does it just cut off a section?
2) Have you tried without the mode line? - X should be able to work out the correct setting (although I'm guessing this leads to the earlier described problem.
3) More of a comment - DisplaySize is used as well as Option "DPI", as DisplaySized is used to calculate DPI I think it is a bad idea to define both what happens if you remove each (leaving other inplace)?
4) In the mode line -Hsync and +Vsync appear after a hash suggesting there commented out, was this intentional?
5) Once in your x enviroment can you use xrandr to give correct operation?

SilentSam 05-30-2013 04:57 PM

I should have a solution for you. When I get home I'll post a codeblock of how I set up my twinview. You should be able to specify where one monitor ends and the other begins using modelines and identifiers.

Edit:
xorg.conf definitely isn't deprecated either. If the file is missing X runs through autodetection, but if it's there X is set up explicitly through the conf file.

Edit 2:

So here's snippet of my xorg.conf.

The main difference between your setup and mine is that I have the twinview flag enabled. I'm only using the one GPU, so I could use the detected outputs and define my screen positions using those as identifiers under a single screen section.

You may, however, be able to use MetaModes to explicitly define how you want your screens to align (ie: 1280x1024 +0+0 for your left monitor, 1280x1024 +1280+0 for the right monitor, and 1920x1080 +2560+0 for the TV). It may be possible to define these outright under each individual screen section that you have defined.

Edit 3:

You may have to define the positioning in the modelines as opposed to metamodes...

I haven't attempted this, it's really only guesswork.

Code:

Section "Screen"
    Identifier    "Screen0"
    Device        "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option          "UseEDIDFreqs" "FALSE"
    Option            "NoLogo" "TRUE"
    Option        "TwinView" "1"
    Option        "TwinViewXineramaInfoOrder" "DFP-0"
    Option        "metamodes" "CRT: 1920x1080 +0+0, DFP: 1920x1080 +1920+0; DFP: 1920x1080; CRT: 1600x900 +0+0, DFP: 1600x900 +1600+0; DFP: 1600x900; CRT: 1440x1080 +0+0, DFP: 1440x1080 +1440+0; DFP: 1440x1080; CRT: 1280x1024 +0+0, DFP: 1280x1024 +1280+0; DFP: 1280x1024; CRT: 1440x900 +0+0, DFP: 1440x900 +1440+0; DFP: 1440x900; CRT: 1366x768 +0+0, DFP: 1366x768 +1366+0; DFP: 1366x768; CRT: 1280x768 +0+0, DFP: 1280x768 +1280+0; DFP: 1280x768; CRT: 1024x768 +0+0, DFP: 1024x768 +1024+0; DFP: 1024x768; CRT: 1280x720 +0+0, DFP: 1280x720 +1280+0; DFP: 1280x720; CRT: 800x600 +0+0, DFP: 800x600 +800+0; DFP: 800x600; CRT: 640x480 +0+0, DFP: 640x480 +640+0; DFP: 640x480"
    SubSection    "Display"
        Depth      24
    EndSubSection
EndSection


jlinkels 05-30-2013 06:34 PM

Have you tried xrandr?

I am not very experienced using it. I did it just once when I had a VGA adapter which did not came with a utility like NVidia Desktop settings. I was amazed how I was able to play with dissimilar displays in separate and united desktops. Obviously I have not studied xrandr in relation with your challange, but maybe the pointer is useful and you have more time on your hands that I do.

jlinkels


All times are GMT -5. The time now is 04:35 AM.