Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
X ignores second GPU.
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
Kresp
n00b
n00b


Joined: 17 Oct 2016
Posts: 73

PostPosted: Sat Apr 29, 2017 11:48 am    Post subject: X ignores second GPU. Reply with quote

I'm trying to setup two monitors, each on a separate GPU.

This is config file Xorg -configure made:
Code:

Section "ServerLayout"
   Identifier     "X.org Configured"
   Screen      0  "Screen0" 0 0
   Screen      1  "Screen1" RightOf "Screen0"
   InputDevice    "Mouse0" "CorePointer"
   InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
   ModulePath   "/usr/lib64/xorg/modules"
   FontPath     "/usr/share/fonts/misc/"
   FontPath     "/usr/share/fonts/TTF/"
   FontPath     "/usr/share/fonts/OTF/"
   FontPath     "/usr/share/fonts/Type1/"
   FontPath     "/usr/share/fonts/100dpi/"
   FontPath     "/usr/share/fonts/75dpi/"
EndSection

Section "Module"
   Load  "glx"
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   "Monitor0"
   VendorName   "Monitor Vendor"
   ModelName    "Monitor Model"
EndSection

Section "Monitor"
   Identifier   "Monitor1"
   VendorName   "Monitor Vendor"
   ModelName    "Monitor Model"
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
        ### <percent>: "<f>%"
        ### [arg]: arg optional
        #Option     "SWcursor"              # [<bool>]
        #Option     "kmsdev"                # <str>
        #Option     "ShadowFB"              # [<bool>]
        #Option     "AccelMethod"           # <str>
        #Option     "PageFlip"              # [<bool>]
        #Option     "ZaphodHeads"           # <str>
        #Option     "DoubleShadow"          # [<bool>]
   Identifier  "Card0"
   Driver      "modesetting"
   BusID       "PCI:35:0:0"
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
        ### <percent>: "<f>%"
        ### [arg]: arg optional
        #Option     "SWcursor"              # [<bool>]
        #Option     "kmsdev"                # <str>
        #Option     "ShadowFB"              # [<bool>]
        #Option     "AccelMethod"           # <str>
        #Option     "PageFlip"              # [<bool>]
        #Option     "ZaphodHeads"           # <str>
        #Option     "DoubleShadow"          # [<bool>]
   Identifier  "Card1"
   Driver      "modesetting"
   BusID       "PCI:37:0:0"
EndSection

Section "Screen"
   Identifier "Screen0"
   Device     "Card0"
   Monitor    "Monitor0"
   SubSection "Display"
      Viewport   0 0
      Depth     1
   EndSubSection
   SubSection "Display"
      Viewport   0 0
      Depth     4
   EndSubSection
   SubSection "Display"
      Viewport   0 0
      Depth     8
   EndSubSection
   SubSection "Display"
      Viewport   0 0
      Depth     15
   EndSubSection
   SubSection "Display"
      Viewport   0 0
      Depth     16
   EndSubSection
   SubSection "Display"
      Viewport   0 0
      Depth     24
   EndSubSection
EndSection

Section "Screen"
   Identifier "Screen1"
   Device     "Card1"
   Monitor    "Monitor1"
   SubSection "Display"
      Viewport   0 0
      Depth     1
   EndSubSection
   SubSection "Display"
      Viewport   0 0
      Depth     4
   EndSubSection
   SubSection "Display"
      Viewport   0 0
      Depth     8
   EndSubSection
   SubSection "Display"
      Viewport   0 0
      Depth     15
   EndSubSection
   SubSection "Display"
      Viewport   0 0
      Depth     16
   EndSubSection
   SubSection "Display"
      Viewport   0 0
      Depth     24
   EndSubSection
EndSection



However, when xserver starts, only one monitor (attached to the GPU that goes last in this config) is active. The other one is dark.
If I switch PCI ids, then after restart xserver switches monitors too.

I tried replacing driver option from modesetting to nouveau, but to no avail.

GPUs are GTX960 and GT9800, I use nouveau for both ATM, wm is i3, kernel is 4.10.6.

There's also one weird part - I now have two DISPLAY's - :1.0 and :1.1. But applications launched for them open at the same workspace.
Back to top
View user's profile Send private message
Kresp
n00b
n00b


Joined: 17 Oct 2016
Posts: 73

PostPosted: Sat Apr 29, 2017 12:09 pm    Post subject: Reply with quote

Ah! It actually works, just not every application take DISPLAY variable into account.
Also, i3 handles displays on different GPUs much differently then on the same one - it does not care about them and just handles one "main" one.

You can send output from, let's say, media player to secondary GPU, but there are no workspaces, no ways to manage output size and output just stacks on top of each other. One mpv instance might completely cover the other one, even though both are capable of playback at the same time.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Sat Apr 29, 2017 2:57 pm    Post subject: Reply with quote

Kresp ...

perhap the multi-monitor section of the i3 Users Guide will help, specifically '[assign_workspace]'.

best ... khay
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 6972
Location: Saint Amant, Acadiana

PostPosted: Sat Apr 29, 2017 4:52 pm    Post subject: Reply with quote

Do you have xinerama USE enabled?
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
Kresp
n00b
n00b


Joined: 17 Oct 2016
Posts: 73

PostPosted: Sun Apr 30, 2017 1:12 am    Post subject: Reply with quote

I installed i3-py python bindings for i3, and checked get_outputs() - it only returns video outs available on the main GPU:
Code:

[{'name': 'DVI-I-2', 'active': True, 'primary': True, 'current_workspace': '3', 'rect': {'x': 0, 'height': 1200, 'width': 1920, 'y': 0}}, {'name': 'xroot-0', 'active': False, 'primary': False, 'current_workspace': None, 'rect': {'x': 0, 'height': 1200, 'width': 1920, 'y': 0}}, {'name': 'DP-1', 'active': False, 'primary': False, 'current_workspace': None, 'rect': {'x': 0, 'height': 0, 'width': 0, 'y': 0}}, {'name': 'HDMI-2', 'active': False, 'primary': False, 'current_workspace': None, 'rect': {'x': 0, 'height': 0, 'width': 0, 'y': 0}}, {'name': 'DVI-D-1', 'active': False, 'primary': False, 'current_workspace': None, 'rect': {'x': 0, 'height': 0, 'width': 0, 'y': 0}}]

i3 seems to ignore the second GPU and all monitors attached to it.

If I plug second monitor into first GPU, then it gets workspaces as expected.

I asked on #i3 freenode channel about this behaviour, but only advice I got was to try Xinerama.
Xorg with Xinerama option goes into deadlock. This is strace log I got: https://pastebin.com/KsUMEgWx .
I have not added xinerama USE flag, will try adding it now and reemerging packages.

Edit:
xinerama USE flag does not seem to affect any packages that might relate to this problem.
Code:

$ sudo emerge --ask --newuse --deep --with-bdeps=y --update @world

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] x11-misc/dmenu-4.6  USE="xinerama*"
[ebuild   R    ] media-libs/libsdl2-2.0.4  USE="xinerama*"
[ebuild   R    ] media-libs/libsdl-1.2.15-r9  USE="xinerama*"
[ebuild   R    ] app-text/hunspell-1.3.3  L10N="en*"
[ebuild   R    ] app-office/libreoffice-l10n-5.2.3.3  L10N="en*"
[ebuild   R    ] net-irc/weechat-1.4-r1  USE="-spell*"
[ebuild   R    ] x11-libs/gtk+-3.22.11  USE="xinerama*"
[ebuild   R    ] dev-qt/qtgui-4.8.6-r4  USE="xinerama*"
[ebuild   R    ] app-emulation/wine-2.0  USE="xinerama*"
[ebuild   R    ] media-video/mpv-0.18.0-r1  USE="xinerama*"
[ebuild   R    ] x11-libs/gtk+-2.24.31-r1  USE="xinerama*"
Back to top
View user's profile Send private message
Kresp
n00b
n00b


Joined: 17 Oct 2016
Posts: 73

PostPosted: Sun Apr 30, 2017 6:40 am    Post subject: Reply with quote

Even with xinerama flag xorg just hangs when Xinerama option is enabled.

I looked at i3 log at it seems to just use whatever randr provides it with, and by default it only works on :1.0.


Code:

$ xrandr --listproviders
Providers: number : 1
Provider 0: id: 0x47 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 4 outputs: 4 associated providers: 0 name:modesetting
$ xrandr --listproviders -d :1.0
Providers: number : 1
Provider 0: id: 0x47 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 4 outputs: 4 associated providers: 0 name:modesetting
$ xrandr --listproviders -d :1.1
Providers: number : 1
Provider 0: id: 0x94 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 3 associated providers: 0 name:modesetting


It's possible to invoke i3 on :1.1, but then it's separate instance. You can not transfer windows between those two running on different DISPLAY's, and keeping focus consistent between them is just impossible.
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