Bug 878605 - systemd-logind: No way to setup multi-seat with two nvidia cards using proprietary drivers
Summary: systemd-logind: No way to setup multi-seat with two nvidia cards using propri...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 17
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-11-20 18:42 UTC by Oleg Samarin
Modified: 2014-05-17 00:38 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-01-11 13:29:29 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
allow systemd-logind to allow to create a seat without a graphic card attached (7.91 KB, patch)
2012-11-20 18:42 UTC, Oleg Samarin
no flags Details | Diff
'Xorg -seat seatXXX' will search ServerLayout with Option "Seat" "SeatXXX" (2.77 KB, patch)
2012-11-20 18:46 UTC, Oleg Samarin
no flags Details | Diff
My xorg.conf - an example of two-seat configuration (2.04 KB, application/x-extension-conf)
2012-11-20 18:47 UTC, Oleg Samarin
no flags Details
The result of 'loginctl seat-status' (4.23 KB, text/plain)
2012-11-20 18:50 UTC, Oleg Samarin
no flags Details
allows systemd-logind to create a seat without a graphic card (7.90 KB, patch)
2012-11-21 19:16 UTC, Oleg Samarin
no flags Details | Diff
Xorg.1.log (22.26 KB, text/plain)
2013-06-24 16:17 UTC, Floris
no flags Details
my xorg.conf.d/01-nvidia.conf (642 bytes, text/plain)
2013-06-24 17:12 UTC, Floris
no flags Details

Description Oleg Samarin 2012-11-20 18:42:38 UTC
Created attachment 648714 [details]
allow systemd-logind to allow to create a seat without a graphic card attached

Description of problem:

I have a Fedora 17 system with two nvidia videocards, two screens, two keyboards and two mouses. I've tried to setup multi-seat on it following this article: http://code.lexarcana.com/blog/2012/06/17/simple-multiseat-setup-on-fedora-17/. But without success.

Version-Release number of selected component (if applicable):

systemd-44-21.fc17.x86_64

How reproducible:
always


Steps to Reproduce:
1. install two nvidia cards, two monitors, two keyboards and two mouses
2. install nvidia proprietary drivers
3. try to setup multi-seat configuration
  
Actual results:
only one monitor shows a gdm login screen

Expected results:
two monitor show two separate gdm login screens

Additional info:

The article propose to create a new seat by attaching a graphic card to it:

loginctl attach seat2 /sys/devices/pci0000:00/0000:00:04.0/0000:02:00.0/drm/card1
loginctl attach seat2 /sys/devices/pci0000:00/0000:00:04.0/0000:02:00.0/graphics/fb1

Unfortunally, there are no any devices whose path end with /drm/card1 or /graphics/fb1 in my system ('loginctl seat-status seat0' does not show any). These paths arrive only after loading the open-source driver (nouveau), but not with Nvidia proprietary driver. 	
Furthermore, the right way of loading graphic driver is after starting X-server, not before it. So logind should inform gdm about new seats before gdm starts X-servers.

My idea is
1. make static configuration of videocards and monitors in xorg.conf
2. dynamically add inputdevices according to the site udev rules

I've managed to implement this successfully by modifying systemd and xorg-x11-server. These patchs are attached.

The first patch - logind-site-without-graphics - introduces the new systemd-logind.conf option: SeatWithoutGraphics with default value "no". But the value "yes" allows logind to create a new seat by attaching any device for it, not only graphics.

The second patch - xserver-1.12.3-xorg-seat-layout - introduces the 
new ServerLayout option - "Seat". If Xorg runs with only "-seat" command line parameter, without "-layout" (gdm starts it in this manner), it tries to find a layout with the value of "Seat" is equal to the value of "-seat" parameter

The way to setup:
1. install the pached packages systemd and xorg-x11-server-Xorg
2. create xorg.conf with several ServerLayout sections and "Seat" options specifying what seat it belongs. It is not necessary to add InputDevices to the layouts.
3. Add "SeatWithoutGraphics=yes" to /etc/systemd/systemd-logind.conf
4. Restart service systemd-logind.service
5. Attach any devices to your seats seat1, seat2 and so on. All the seats will be created by logind
6. Restart gdm (init 3 && init 5)
7. All displays will sho the gdm user-selection screen.

Comment 1 Oleg Samarin 2012-11-20 18:46:11 UTC
Created attachment 648717 [details]
'Xorg -seat seatXXX' will search ServerLayout with Option "Seat" "SeatXXX"

Comment 2 Oleg Samarin 2012-11-20 18:47:43 UTC
Created attachment 648718 [details]
My xorg.conf - an example of two-seat configuration

Comment 3 Oleg Samarin 2012-11-20 18:50:30 UTC
Created attachment 648719 [details]
The result of 'loginctl seat-status'

Comment 4 Michal Schmidt 2012-11-21 13:21:24 UTC
This looks like something to resolve upstream. Could you post the patch to the upstream mailing list?:
systemd-devel.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Comment 5 Oleg Samarin 2012-11-21 19:16:59 UTC
Created attachment 649365 [details]
allows systemd-logind to create a seat without a graphic card

Comment 6 Oleg Samarin 2012-11-21 19:19:35 UTC
(In reply to comment #4)
> This looks like something to resolve upstream. Could you post the patch to
> the upstream mailing list?:
> systemd-devel.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel

I did it. But my post is waiting for moderator approval.

Comment 7 Lennart Poettering 2013-01-11 13:29:29 UTC
This is now fixed upstream. By dropping in a udev rules files you now can make any device a master device for a seat, including binary only NVIDIA driver devices. 

Fixed in Rawhide.

Comment 8 Oli Wade 2013-06-05 06:35:58 UTC
Should this work now in F18, or do I need a later systemd package?

Is it necessary to add "SeatWithoutGraphics=yes" to /etc/systemd/systemd-logind.conf, and/or make a custom udev rule (where can I find an example)?

Comment 9 Lennart Poettering 2013-06-06 10:43:19 UTC
You need to add the udev tag "master-of-seat" to some sysfs device your graphics driver exposes.

Comment 10 Oleg Samarin 2013-06-07 16:15:29 UTC
Or you may asign "master-of-seat" to your USB hub.

Comment 11 Oli Wade 2013-06-12 08:16:02 UTC
Thanks for your replies. I added these udev rules:
----
DEVPATH=="/devices/pci0000:00/0000:00:02.0/0000:01:00.0, TAG+="seat"
DEVPATH=="/devices/pci0000:00/0000:00:0b.0/0000:06:00.0", TAG+="seat"
DEVPATH=="/devices/pci0000:00/0000:00:12.2/usb1/1-4/1-4.4/1-4.4.4/1-4.4.4.1", TAG+="master-of-seat"
----

And can confirm the tags exist on my second graphics card:
----
[ojw23@lnc ~]$ udevadm  info --query=all --path=/sys/devices/pci0000:00/0000:00:0b.0/0000:06:00.0
P: /devices/pci0000:00/0000:00:0b.0/0000:06:00.0
E: DEVPATH=/devices/pci0000:00/0000:00:0b.0/0000:06:00.0
E: DRIVER=nvidia
E: ID_FOR_SEAT=pci-pci-0000_06_00_0
E: ID_MODEL_FROM_DATABASE=GT215 [GeForce GT 240]
E: ID_PATH=pci-0000:06:00.0
E: ID_PATH_TAG=pci-0000_06_00_0
E: ID_PCI_CLASS_FROM_DATABASE=Display controller
E: ID_PCI_INTERFACE_FROM_DATABASE=VGA controller
E: ID_PCI_SUBCLASS_FROM_DATABASE=VGA compatible controller
E: ID_SEAT=seat1
E: ID_VENDOR_FROM_DATABASE=NVIDIA Corporation
E: MODALIAS=pci:v000010DEd00000CA3sv00001458sd000034E2bc03sc00i00
E: PCI_CLASS=30000
E: PCI_ID=10DE:0CA3
E: PCI_SLOT_NAME=0000:06:00.0
E: PCI_SUBSYS_ID=1458:34E2
E: SUBSYSTEM=pci
E: TAGS=:seat:seat1:
E: UDEV_LOG=6
E: USEC_INITIALIZED=4616
----

Then I added the hub and card to seat1:
----
[ojw23@lnc ~]$ loginctl seat-status  seat1
seat1
         Devices:
                  ├─/sys/devices/pci0000:00/0000:00:0b.0/0000:06:00.0
                  │ pci:0000:06:00.0
                  ├─/sys/devices/pci0000:00/0000:00:0b.0/0000:06:00.1/sound/card3
                  │ sound:card3 "NVidia_1"
                  │ ├─/sys/devices/pci0000:00/0000:00:0b.0/0000:06:00.1/sound/card3/input18
                  │ │ input:input18 "HDA NVidia HDMI/DP,pcm=9"
                  │ ├─/sys/devices/pci0000:00/0000:00:0b.0/0000:06:00.1/sound/card3/input19
                  │ │ input:input19 "HDA NVidia HDMI/DP,pcm=8"
                  │ ├─/sys/devices/pci0000:00/0000:00:0b.0/0000:06:00.1/sound/card3/input20
                  │ │ input:input20 "HDA NVidia HDMI/DP,pcm=7"
                  │ └─/sys/devices/pci0000:00/0000:00:0b.0/0000:06:00.1/sound/card3/input21
                  │   input:input21 "HDA NVidia HDMI/DP,pcm=3"
                  └─/sys/devices/pci0000:00/0000:00:12.2/usb1/1-4/1-4.4/1-4.4.4/1-4.4.4.1
                    [MASTER] usb:1-4.4.4.1
                    ├─/sys/devices/pci0000:00/0000:00:12.2/usb1/1-4/1-4.4/1-4.4.4/1-4.4.4.1/1-4.4.4.1.1/1-4.4.4.1.1:1.0/input/input23
                    │ input:input23 "Logitech USB-PS/2 Optical Mouse"
                    ├─/sys/devices/pci0000:00/0000:00:12.2/usb1/1-4/1-4.4/1-4.4.4/1-4.4.4.1/1-4.4.4.1.2/1-4.4.4.1.2:1.0/input/input24
                    │ input:input24 "LITEON Technology USB Multimedia Keyboard"
                    ├─/sys/devices/pci0000:00/0000:00:12.2/usb1/1-4/1-4.4/1-4.4.4/1-4.4.4.1/1-4.4.4.1.2/1-4.4.4.1.2:1.1/input/input25
                    │ input:input25 "LITEON Technology USB Multimedia Keyboard"
                    ├─/sys/devices/pci0000:00/0000:00:12.2/usb1/1-4/1-4.4/1-4.4.4/1-4.4.4.1/1-4.4.4.1.4/1-4.4.4.1.4:1.0/sound/card4
                    │ sound:card4 "Set"
                    └─/sys/devices/pci0000:00/0000:00:12.2/usb1/1-4/1-4.4/1-4.4.4/1-4.4.4.1/1-4.4.4.1.4/1-4.4.4.1.4:1.3/input/input26
                      input:input26 "C-Media USB Headphone Set  "
----

But there is no second gdm:
----
[ojw23@lnc ~]$ ps aux | grep gdm
root       807  0.0  0.0 297632  3108 ?        Ssl  09:03   0:00 /usr/sbin/gdm-binary
root       831  0.0  0.0 392492  3772 ?        Sl   09:03   0:00 /usr/libexec/gdm-simple-slave --display-id /org/gnome/DisplayManager/Displays/_0
root       852  1.8  0.2 224948 39912 tty1     Ss+  09:03   0:12 /usr/bin/Xorg :0 -background none -verbose -auth /var/run/gdm/auth-for-gdm-geYJJH/database -seat seat0 -nolisten tcp vt1
root      1513  0.0  0.0 361232  4360 ?        Sl   09:05   0:00 gdm-session-worker [pam/gdm-password]
ojw23     2183  0.0  0.0 109184   840 pts/0    S+   09:15   0:00 grep --color=auto gdm
----

Do I need to do anything else to activate it?

Comment 12 Oli Wade 2013-06-22 10:38:14 UTC
I am still struggling with this; I can alternately set the graphics card to be master, but there is no second login prompt appearing. I think the Xserver fails to load:
----
[ojw23@lnc log]$ tail Xorg.1.log
[     5.043] (EE) No devices detected.
[     5.043] 
Fatal server error:
[     5.043] no screens found
[     5.043] (EE) 
Please consult the Fedora Project support 
	 at http://wiki.x.org
 for help. 
[     5.043] (EE) Please also check the log file at "/var/log/Xorg.1.log" for additional information.
[     5.043] (EE) 
----

Is there a subnode of the pci device that should rather be tagged?
----
[ojw23@lnc log]$ loginctl seat-status  seat1
seat1
         Devices:
                  ├─/sys/devices/pci0000:00/0000:00:0b.0/0000:06:00.0
                  │ [MASTER] pci:0000:06:00.0
                  └─/sys/devices/pci0000:00/0000:00:12.2/usb1/1-4/1-4.4/1-4.4.4/1-4.4.4.1
                    usb:1-4.4.4.1
                    ├─/sys/devices/pci00...1/1-4/1-4.4/1-4.4.4/1-4.4.4.1/1-4.4.4.1.1/1-4.4.4.1.1:1.0/input/input23
                    │ input:input23 "Logitech USB-PS/2 Optical Mouse"
                    ├─/sys/devices/pci00...1/1-4/1-4.4/1-4.4.4/1-4.4.4.1/1-4.4.4.1.2/1-4.4.4.1.2:1.0/input/input24
                    │ input:input24 "LITEON Technology USB Multimedia Keyboard"
                    ├─/sys/devices/pci00...1/1-4/1-4.4/1-4.4.4/1-4.4.4.1/1-4.4.4.1.2/1-4.4.4.1.2:1.1/input/input25
                    │ input:input25 "LITEON Technology USB Multimedia Keyboard"
                    ├─/sys/devices/pci00...sb1/1-4/1-4.4/1-4.4.4/1-4.4.4.1/1-4.4.4.1.4/1-4.4.4.1.4:1.0/sound/card4
                    │ sound:card4 "Set"
                    └─/sys/devices/pci00...1/1-4/1-4.4/1-4.4.4/1-4.4.4.1/1-4.4.4.1.4/1-4.4.4.1.4:1.3/input/input26
                      input:input26 "C-Media USB Headphone Set  "
----

Or else might this be related:
  https://bugzilla.redhat.com/show_bug.cgi?id=962907

Comment 13 Oli Wade 2013-06-23 16:49:13 UTC
I have read the systemd-devel thread and perhaps I was missing some xorg.conf in order to specify the devices used by the different seats.

So I made something up (like I used to use with static config), and based on the above:
  https://bugzilla.redhat.com/show_bug.cgi?id=878605#c2

I saved it under xorg.conf.d, but it is not clear that the seat "option" is being understood - since the Xorg log suggests it is always going for the "screen0" server layout.

Is the xorg.conf snippet necessary, and/or does it need to have a particular filename to match the seat?

Or do I need to add something to the gdm custom config?

Comment 14 Floris 2013-06-24 16:17:18 UTC
Created attachment 764692 [details]
Xorg.1.log

Comment 15 Floris 2013-06-24 16:28:12 UTC
I try the same as Oli Wade. Gdm start at seat0. When I try to start a second one $ X :1 -layout seat1 -sharevts vt2
(see Xorg.1.log)
The monitor on seat1 detect a signal, but doesn't a gdm login.
$ X :1 -layout seat1 -sharevts -seat seat1 vt2

Xorg.1.log ends with:
...
[ 10990.270] (II) NVIDIA dlloader X Driver  304.88  Wed Mar 27 14:28:14 PDT 2013
[ 10990.270] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
[ 10990.270] (++) using VT number 2

[ 10990.270] (EE) No devices detected.
[ 10990.270]
Fatal server error:
[ 10990.270] no screens found
[ 10990.270] (EE)
Please consult the Fedora Project support
         at http://wiki.x.org
 for help.
[ 10990.270] (EE) Please also check the log file at "/var/log/Xorg.1.log" for additional information.
[ 10990.270] (EE)

Comment 16 Floris 2013-06-24 17:12:29 UTC
Created attachment 764723 [details]
my xorg.conf.d/01-nvidia.conf

Sorry,
I forgot to add my xorg.conf.d/01-nvidia.conf file

Comment 17 Oli Wade 2013-06-26 22:54:19 UTC
Oleg, can you give us a clue where to put/name the xorg.conf?

Comment 18 Floris 2013-07-03 16:05:53 UTC
Maybe this information can be used to solve this bug or it is totally unrelated:

I can start a second X server with:
# /lib/systemd/systemd-multi-seat-x :1 -layout seat1  vt7 -sharevts
Only the X server start. No gdm or any other daemon or server.

While the second X server is running I tried to start a gnome-session

# gnome-session --display=:1
gnome-session[4901]: WARNING: Could not make bus activated clients aware of DISPLAY=:1 environment variable: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
gnome-session[4901]: WARNING: Could not make bus activated clients aware of GNOME_DESKTOP_SESSION_ID=this-is-deprecated environment variable: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
gnome-session[4901]: WARNING: Could not make bus activated clients aware of XDG_MENU_PREFIX=gnome- environment variable: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

This information is also displayed in a error-dialog window on the second monitor. At least a window ;-)
After clicking the "logout" button the next information is given:

7 XSELINUXs still allocated at reset
SCREEN: 0 objects of 344 bytes = 0 total bytes 0 private allocs
COLORMAP: 0 objects of 8 bytes = 0 total bytes 0 private allocs
DEVICE: 0 objects of 96 bytes = 0 total bytes 0 private allocs
CLIENT: 0 objects of 120 bytes = 0 total bytes 0 private allocs
WINDOW: 0 objects of 72 bytes = 0 total bytes 0 private allocs
PIXMAP: 2 objects of 112 bytes = 224 total bytes 0 private allocs
GC: 4 objects of 40 bytes = 160 total bytes 0 private allocs
CURSOR: 0 objects of 8 bytes = 0 total bytes 0 private allocs
DBE_WINDOW: 0 objects of 24 bytes = 0 total bytes 0 private allocs
GLYPH: 0 objects of 24 bytes = 0 total bytes 0 private allocs
PICTURE: 0 objects of 8 bytes = 0 total bytes 0 private allocs
SYNC_FENCE: 0 objects of 8 bytes = 0 total bytes 0 private allocs
TOTAL: 6 objects, 384 bytes, 0 allocs
1 SELECTIONs still allocated at reset
WINDOW: 0 objects of 72 bytes = 0 total bytes 0 private allocs
PIXMAP: 2 objects of 112 bytes = 224 total bytes 0 private allocs
GC: 4 objects of 40 bytes = 160 total bytes 0 private allocs
CURSOR: 0 objects of 8 bytes = 0 total bytes 0 private allocs
DBE_WINDOW: 0 objects of 24 bytes = 0 total bytes 0 private allocs
GLYPH: 0 objects of 24 bytes = 0 total bytes 0 private allocs
PICTURE: 0 objects of 8 bytes = 0 total bytes 0 private allocs
SYNC_FENCE: 0 objects of 8 bytes = 0 total bytes 0 private allocs
TOTAL: 6 objects, 384 bytes, 0 allocs
2 PIXMAPs still allocated at reset
PIXMAP: 2 objects of 112 bytes = 224 total bytes 0 private allocs
GC: 4 objects of 40 bytes = 160 total bytes 0 private allocs
CURSOR: 0 objects of 8 bytes = 0 total bytes 0 private allocs
DBE_WINDOW: 0 objects of 24 bytes = 0 total bytes 0 private allocs
GLYPH: 0 objects of 24 bytes = 0 total bytes 0 private allocs
PICTURE: 0 objects of 8 bytes = 0 total bytes 0 private allocs
SYNC_FENCE: 0 objects of 8 bytes = 0 total bytes 0 private allocs
TOTAL: 6 objects, 384 bytes, 0 allocs
4 GCs still allocated at reset
GC: 4 objects of 40 bytes = 160 total bytes 0 private allocs
CURSOR: 0 objects of 8 bytes = 0 total bytes 0 private allocs
DBE_WINDOW: 0 objects of 24 bytes = 0 total bytes 0 private allocs
GLYPH: 0 objects of 24 bytes = 0 total bytes 0 private allocs
PICTURE: 0 objects of 8 bytes = 0 total bytes 0 private allocs
SYNC_FENCE: 0 objects of 8 bytes = 0 total bytes 0 private allocs
TOTAL: 4 objects, 160 bytes, 0 allocs

Note: the other Xserver is not aware of any udev seat tags. The second mouse also controls the mouse pointer on the first server. When I add the "-seat seat1" option to the Xserver the server dies with:

[ 10990.270] (EE) No devices detected.
[ 10990.270]
Fatal server error:
[ 10990.270] no screens found
[ 10990.270] (EE)
Please consult the Fedora Project support
         at http://wiki.x.org
 for help.
[ 10990.270] (EE) Please also check the log file at "/var/log/Xorg.1.log" for additional information.
[ 10990.270] (EE)

Comment 19 Oli Wade 2013-07-13 09:29:16 UTC
Thanks Floris!

I have given up and changed to ATI graphics; while the seat can be created it seems impossible to actually use it at this time.

I can see some progress with KDE is happening in this bug:
  https://bugzilla.redhat.com/show_bug.cgi?id=975079

Is there a GDM equivalent bug to track the future status of support for the seat/layout options?

Comment 20 Stefan Brüns 2014-05-17 00:38:40 UTC
the "no screens found" error should be fixed with this commit:

http://cgit.freedesktop.org/xorg/xserver/commit/?id=29b1484bb9555e45067669cbfe68a3c40596f4ff

Tested with catalyst/fglrx and patch applied to xserver-1.14


Note You need to log in before you can comment on or make changes to this bug.