I have seen some posts and some old information about multiseat configurations. I have successfully configured everything with google-fu and some luck. I wanted to give back to the community, just in case somebody is in my position. If this is not the good place to post this, or I should follow some other style, please tell me so. I have been a lurker and maybe I have a lot to learn.
My current hardware setup:
- 2x NVIDIA GTX 750 Ti LP (Low Power was a plus for my build, and low budget too)
- Intel i7 6700
On the software point of view:
- Ubuntu Gnome 16.04
- NVIDIA drivers 361.42 (installed through Additional drivers Ubuntu utility)
- Xorg > 1.16. It is already included in 16.04, but this seems important because some features regarding multiseat where added in that version.
Note that Ubuntu Gnome uses gdm (instead of lightdm, as in Ubuntu). This should not affect, as both are quite automagical in they behaviour, or so I am told. I do not mess with any desktop manager settings. If you want to achieve, say, different auto-login in the different seats, then you will be forced to play around the config files.
First step: Master of Seat
This step is required for the 361.42 driver, but I am told that version 364 does this automatically. To check that, call loginctl seat-status and see if the NVIDIA card has already the MASTER qualifier, which means that is a Master of Seat. If it already is, jump to the next step.
Otherwise:
First we need to assign some “master-of-seat” tag to the graphical devices. The easiest way for NVIDIA cards is to create /etc/udev/rules.d/99-seats.rules and put the following:
SUBSYSTEM=="drm", KERNEL=="card[0-9]*", ATTRS{vendor}=="0x10de", DRIVERS=="nvidia", TAG+="master-of-seat"
This will ensure that the card* device will qualify as a seat-forming configuration.
Seat devices
[Not sure if a reboot, or an equivalent udevadm trigger command, are needed before going on. It does no harm…]
Use loginctl tool to assign the card and also additional devices (keyboard, mouse, usb, soundcards…) to the seats according to your desired setup:
$ # Basic command:
$ loginctl attach seat-1 /sys/devices/pci...
$ # Rinse and repeat, for all your devices (should start for the master-of-seat card)
$ # ...
$ # Check that everything is as expected:
$ loginctl seat-status seat0
$ loginctl seat-status seat-1
Instead of using the loginctl command you can manually add rules to the folder /etc/udev/rules.d/. Do whatever you are most comfortable with. It should be equivalent, as loginctl command ends up creating some files named /etc/udev/rules.d/72*.conf. If you do it by hand, you will be able to add comments change the setup more cleanly.
Remember that you can add individual devices or full USB hubs. This may be interesting to allow a small “hotplug pool of [non-attached] devices”, by connecting them to previously attached hubs, in addition to cherry-picked “persistent/static” devices like keyboard and mouses which are likely to not be moved around. At least, that is my plan for my multi-seat.
Enabling Xorg
If you are comfortable using the nouveau drivers, you can jump to the “Reboot and profit” step. Otherwise, the seat-1 will not start the desktop manager at all. I have not (extensively) looked at logs to see the problem. However, I solved the issue.
The minimal(?) configuration that works with the proprietary drivers can be achieved through the following configuration in /etc/X11/xorg.conf.d/. Create the folder if it is not present. You can put everything in one single file, multiple files, or arrange them in another fashion:
01-gpu_separation.conf
# 01-gpu_separation.conf
Section "ServerFlags"
Option "AutoAddGPU" "off"
EndSection
10-gpu-seat0.conf
# 10-gpu-seat0.conf
Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
Option "GLXVBlank" "true"
BoardName "GeForce GTX 750Ti"
Option "NoLogo" "1"
BusId "PCI:1:0:0"
Option "ProbeAllGpus" "false"
MatchSeat "seat0"
EndSection
10-gpu-seat-1.conf
# 10-gpu-seat-1.conf
Section "Device"
Identifier "Device1"
Driver "nvidia"
VendorName "NVIDIA Corporation"
Option "GLXVBlank" "true"
BoardName "GeForce GTX 750Ti"
Option "NoLogo" "1"
BusId "PCI:2:0:0"
Option "ProbeAllGpus" "false"
MatchSeat "seat-1"
EndSection
Note that you may want to change the seat names or the PCI according to your specific configuration. Also change the BoardName --vanity only, I think.
Reboot and profit
Seriously, if you reboot, it should work.
Afterthoughts
As you may have seen, I have tried to reduce to a minimum the configuration for Xorg (instead of, say, adding two full xorg.conf files and setting there every input / device / monitor / etc.). I like to keep a basic low-level setup (bare minimum as possible), and the graphical display tools are enough for me. I plan to do some more testing to reduce the settings even more, I am not sure what are the completely essential ones, or if those problems between nouveau and nvidia drivers will disappear in newer versions.
Also, I really like the systemd way of doing things. I am sure that some similar stuff can be achieved through carefully assignment of input devices in the xorg.conf, but some more nice behaviour like the sound card assignment, the USB-hub-per-seat features, etc. seems to be a pain to set up without systemd. Maybe I am wrong, feel free to share your experience!
If you are trying something similar, good luck and have patience :)