5

I have setup a machine with two NVidia video cards:

$ lspci
01:00.0 VGA compatible controller: NVIDIA Corporation GK107 [GeForce GT 740] (rev a1)
02:00.0 VGA compatible controller: NVIDIA Corporation GK208 [GeForce GT 730] (rev a1)

I've then used loginctl to assign the GT 730 to seat-1 and left th GT 740 untouched, so it's still assigned to seat0. seat0 has two monitors, seat-1 has only one.

Using nouveau

Using the nouveau XOrg driver, I can use both seats. Both seats display the lightdm login screen and allow login.

Two problems here:

  • seat0 locks up frequently, apparently only when the session is locked. Mouse does still move, but it does not accept keyboard input. Even the clock stops updating.
    • This can be fixed by ssh-ing into the box or logging in on seat-1 and simply restarting lightdm (service lightdm restart), but obviously this logs out both seats, which is inconvenient at best.
    • dmesg | grep nouveau shows a couple messages like nouveau 0000:01:00.0: fifo: SCHED_ERROR 08 [] or nouveau 0000:01:00.0: Xorg[1250]: channel 2 killed!
  • seat-1 display flickers when scrolling, for example in a web page. This might be because of too low a video memory bandwidth according to Nouveau Troubleshooting - Blank monitor, flicker, snow, or other random live image corruption. I've not investigated this yet.

Using proprietary NVidia drivers

When I install the proprietary nvidia drivers (apt install nvidia-384), only the GT 740 (assigned to seat0, equipped with two monitors) is usable. The other display on GT 730 (assigned to seat-1, equipped with one monitor) remains black.

The upside however is that I did not experience any more lockups on seat0 (and obviously no more flicker on seat-1, though this is not really an improvement ;-))

I've also tried to switch to the drivers using Hardware Drivers setting app or ubuntu-drivers on the console. Both of them only list one NVidia card, namely the GT 740:

$ ubuntu-drivers devices
== /sys/devices/pci0000:00/0000:00:02.0/0000:01:00.0 ==
modalias : pci:v000010DEd00000FC8sv00001458sd000036FFbc03sc00i00
vendor   : NVIDIA Corporation
model    : GK107 [GeForce GT 740]
driver   : nvidia-384 - distro non-free recommended
driver   : nvidia-340 - distro non-free
driver   : xserver-xorg-video-nouveau - distro free builtin

== cpu-microcode.py ==
driver   : amd64-microcode - distro non-free

Conclusion

My aim is to have both seats running, not locking up and not flickering. I do not really care whether this is achieved using nouveau or nvidia drivers.

I do not currently have an Xorg.conf or have modified lightdm configuration because I simply didn't know what to put there... I suppose that just making the nvidia driver recognise the second card would do the trick, but I have no idea how to achieve this.

Any ideas?

Thanks in advance, Patrick

  • The Nvidia driver for Linux does not allow that. No solution, I'm afraid, if the open source driver has poor support for the card and can't be used. – user692175 Nov 6 '17 at 20:06
  • @MichaelBay Just didn't want to accept that and finally found a way to make it work with the Nvidia drivers :-) I'll post my solution as an answer to this question. – Patrick Echterbruch Nov 7 '17 at 20:57
  • Brilliant...... – user692175 Nov 7 '17 at 22:24
4

OK, I finally made it work.

general

This section is here as a little "getting started" for others, and as a little "aide-mémoire" for myself... This is not the only and maybe not even the best way to do it, it's just the way I did it.

  1. Get two USB hubs and place one at each of the two seats. Plug them into two USB ports of the machine.
  2. Get a USB sound card (small USB dongle with one mic-in and one line-out connector) and plug it into another USB port of your machine. This assumes that there already is another (on-board) sound device that is to be used on seat0.
  3. Get two USB wireless mouse/keyboard combos and plug one of the USB dongles in each of the two USB hubs.
  4. Assign the hubs to the respective seats (loginctl attach seat1 /dev/...). This automatically assigns the mouse and keyboard which are plugged into the hub.
  5. Assign the USB sound card to seat1
  6. Assign one of the Nvidia cards (all of it, including DRM and Sound devices) to seat1.
  7. If you have any other devices that are not plugged into the already-assigned hub, then assign them as well.
  8. Run loginctl seat-status seat1. This is how it looks here:

    seat1
            Sessions: *c3
             Devices:
                      ├─/sys/devices/pci0000:00/0000:00:03.0/0000:02:00.0/drm/card1
                      │ [MASTER] drm:card1
                      ├─/sys/devices/pci0000:00/0000:00:03.0/0000:02:00.0/drm/renderD129
                      │ drm:renderD129
                      ├─/sys/devices/pci0000:00/0000:00:03.0/0000:02:00.1/sound/card2
                      │ sound:card2 "NVidia"
                      │ ├─/sys/devices/pci0000:00/0000:00:03.0/0000:02:00.1/sound/card2/input20
                      │ │ input:input20 "HDA NVidia HDMI/DP,pcm=3"
                      │ └─/sys/devices/pci0000:00/0000:00:03.0/0000:02:00.1/sound/card2/input21
                      │   input:input21 "HDA NVidia HDMI/DP,pcm=7"
                      ├─/sys/devices/pci0000:00/0000:00:04.0/0000:03:00.0/usb8
                      │ usb:usb8
                      │ ├─/sys/devices/pci0000:00/0000:00:04.0/0000:03:00.0/usb8/8-1
                      │ │ usb:8-1
                      │ │ ├─/sys/devices/pci0000:00/0000:00:04.0/0000:03:00.0/usb8/8-1/8-1.3
                      │ │ │ usb:8-1.3
                      │ │ ├─/sys/devices/pci0000:00/0000:00:04.0/0000:03:00.0/usb8/8-1/8-1.4/8-1.4:1.0/0003:046A:B102.0004/input/input5
                      │ │ │ input:input5 "HOLTEK USB Wireless Device"
                      │ │ └─/sys/devices/pci0000:00/0000:00:04.0/0000:03:00.0/usb8/8-1/8-1.4/8-1.4:1.1/0003:046A:B102.0005/input/input6
                      │ │   input:input6 "HOLTEK USB Wireless Device"
                      │ └─/sys/devices/pci0000:00/0000:00:04.0/0000:03:00.0/usb8/8-2
                      │   usb:8-2
                      │   └─/sys/devices/pci0000:00/0000:00:04.0/0000:03:00.0/usb8/8-2/8-2.3
                      │     usb:8-2.3
                      ├─/sys/devices/pci0000:00/0000:00:04.0/0000:03:00.0/usb9
                      │ usb:usb9
                      │ ├─/sys/devices/pci0000:00/0000:00:04.0/0000:03:00.0/usb9/9-1
                      │ │ usb:9-1
                      │ │ └─/sys/devices/pci0000:00/0000:00:04.0/0000:03:00.0/usb9/9-1/9-1.3
                      │ │   usb:9-1.3
                      │ └─/sys/devices/pci0000:00/0000:00:04.0/0000:03:00.0/usb9/9-2
                      │   usb:9-2
                      │   └─/sys/devices/pci0000:00/0000:00:04.0/0000:03:00.0/usb9/9-2/9-2.3
                      │     usb:9-2.3
                      ├─/sys/devices/pci0000:00/0000:00:12.0/usb4
                      │ usb:usb4
                      │ ├─/sys/devices/pci0000:00/0000:00:12.0/usb4/4-4/4-4:1.0/sound/card5
                      │ │ sound:card5 "Device"
                      │ └─/sys/devices/pci0000:00/0000:00:12.0/usb4/4-4/4-4:1.3/0003:0D8C:0014.0001/input/input2
                      │   input:input2 "C-Media Electronics Inc. USB Audio Device"
                      └─/sys/devices/pci0000:00/0000:00:12.2/usb1
                        usb:usb1
                        ├─/sys/devices/pci0000:00/0000:00:12.2/usb1/1-2
                        │ usb:1-2
                        ├─/sys/devices/pci0000:00/0000:00:12.2/usb1/1-3/1-3:1.0/input/input15
                        │ input:input15 "UVC Camera (046d:0807)"
                        ├─/sys/devices/pci0000:00/0000:00:12.2/usb1/1-3/1-3:1.0/video4linux/video0
                        │ video4linux:video0 "UVC Camera (046d:0807)"
                        ├─/sys/devices/pci0000:00/0000:00:12.2/usb1/1-3/1-3:1.2/sound/card3
                        │ sound:card3 "U0x46d0x807"
                        └─/sys/devices/pci0000:00/0000:00:12.2/usb1/1-5
                          usb:1-5
    

nouveau

I didn't find out what to do about the screen flickering on seat1 and lockups on seat0 when using the nouveau driver. In case you're looking for a solution for this very problem, it might be worth to have a look at https://wiki.archlinux.org/index.php/Xorg_multiseat which says:

To avoid tearing this seems to help on nearly all configurations - add this to /etc/environment:

CLUTTER_PAINT=disable-clipped-redraws:disable-culling 
CLUTTER_VBLANK=True 

Another hint was to add the user to the group video because otherwise they might not have access to the DRI interface.

This is about all I can say, and I switched to using Nvidia binary drivers.

NVidia

The problem that I had was appearantly that the X server of seat0 was somehow trying to take control of both GPUs even though GPU-1 was is assigned to seat1.

This somehow mixed up the X screens and X server for seat 1 couldn't find any usable screens.

I spent hours of fiddling with /etc/X11/xorg.conf.d files where I put tiny pieces of configuration like

Section "Device"
        Identifier      "graphic0"
        Driver          "nvidia"
        Option          "NoLogo"
        BusId           "PCI:1:0:0"
        MatchSeat       "seat-1"
        Option          "Monitor-DVI-1"         "monitor1"
EndSection

and

Section "ServerLayout"
        Identifier      "seat-1"
        Screen          "screen1"       0                   0
        InputDevice     "mouse1"        "CorePointer"
        InputDevice     "keyboard1"     "CoreKeyboard"
        Option          "Seat"  "seat-1"
        Option          "SingleCard" "on"
EndSection

as advised by https://wiki.archlinux.org/index.php/Xorg_multiseat (lot's of useful information there, though it didn't solve my problem) or https://devtalk.nvidia.com/default/topic/936873/linux/-howto-multiseat-with-ubuntu-16-04-systemd-gdm-proprietary-drivers/1 (another high-quality discussion of this issue).

What finally worked for me was doing it the hard way and providing a X configuration for each of the seats.

So, my procedure was:

  1. use loginctl attach seat1 .... to assign all required devices to seat1
  2. install nvidia proprietary drivers (make sure you select the right one for you system; in terminal run ubuntu-drivers devices to see the list of available drivers)

    apt install nvida-384
    
  3. reboot
  4. login on seat0 and run nvidia-seetings. Select X Server Display Configuration on the left, click on save to X Configuration File bottom-right and save the file as ~/xorg-template
  5. Copy ~/xorg-template config file twice to /etc/X11, once as xorg-seat0.conf and once as xorg-seat1.conf
  6. Modify these two Xorg config files to match seat0 and seat1 setup respectively. I only had to change a couple of lines - the PCI address of the GPU and the number of monitors. I did however also change the naming of the Identifiers for the sake of clarity - I suppose that would not really be required. Below is my config:

    • seat0

      # xorg-seat0.conf
      Section "ServerLayout"
          Identifier     "Layout-seat0"
          Screen      0  "Screen-seat0" 0 0
          InputDevice    "Keyboard-seat0" "CoreKeyboard"
          InputDevice    "Mouse-seat0" "CorePointer"
          Option         "Xinerama" "0"
      EndSection
      
      Section "Files"
      EndSection
      
      Section "InputDevice"
          # generated from default
          Identifier     "Mouse-seat0"
          Driver         "mouse"
          Option         "Protocol" "auto"
          Option         "Device" "/dev/psaux"
          Option         "Emulate3Buttons" "no"
          Option         "ZAxisMapping" "4 5"
      EndSection
      
      Section "InputDevice"
          # generated from default
          Identifier     "Keyboard-seat0"
          Driver         "kbd"                                                                                                                                                                                                                    
      EndSection                                                                                                                                                                                                                                  
      
      Section "Monitor"                                                                                                                                                                                                                           
          # HorizSync source: edid, VertRefresh source: edid                                                                                                                                                                                      
          Identifier     "Monitor-seat0_1"                                                                                                                                                                                                        
          VendorName     "Unknown"                                                                                                                                                                                                                
          ModelName      "FUS H22-1W"                                                                                                                                                                                                             
          HorizSync       28.0 - 79.0                                                                                                                                                                                                             
          VertRefresh     50.0 - 75.0                                                                                                                                                                                                             
          Option         "DPMS"                                                                                                                                                                                                                   
      EndSection                                                                                                                                                                                                                                  
      
      Section "Device"                                                                                                                                                                                                                            
          Identifier     "Device-seat0"                                                                                                                                                                                                           
          Driver         "nvidia"                                                                                                                                                                                                                 
          VendorName     "NVIDIA Corporation"                                                                                                                                                                                                     
          BoardName      "GeForce GT 740"                                                                                                                                                                                                         
          BusID          "PCI:1:0:0"                                                                                                                                                                                                              
      EndSection                                                                                                                                                                                                                                  
      
      Section "Screen"                                                                                                                                                                                                                            
          Identifier     "Screen-seat0"                                                                                                                                                                                                           
          Device         "Device-seat0"                                                                                                                                                                                                           
          Monitor        "Monitor-seat0_1"                                                                                                                                                                                                        
          DefaultDepth    24                                                                                                                                                                                                                      
          Option         "Stereo" "0"
          Option         "nvidiaXineramaInfoOrder" "DFP-0"
          Option         "metamodes" "DVI-D-0: nvidia-auto-select +0+0, DVI-D-1: nvidia-auto-select +1680+0"
          Option         "SLI" "Off"
          Option         "MultiGPU" "Off"
          Option         "BaseMosaic" "off"
          SubSection     "Display"
              Depth       24
          EndSubSection
      EndSection
      
    • seat1

      # xorg-seat1.conf
      Section "ServerLayout"
          Identifier     "Layout-seat1"
          Screen      0  "Screen-seat1" 0 0
          InputDevice    "Keyboard-seat1" "CoreKeyboard"
          InputDevice    "Mouse-seat1" "CorePointer"
          Option         "Xinerama" "0"
      EndSection
      
      Section "Files"
      EndSection
      
      Section "InputDevice"
          # generated from default
          Identifier     "Mouse-seat1"
          Driver         "mouse"
          Option         "Protocol" "auto"
          Option         "Device" "/dev/psaux"
          Option         "Emulate3Buttons" "no"
          Option         "ZAxisMapping" "4 5"
      EndSection
      
      Section "InputDevice"
          # generated from default
          Identifier     "Keyboard-seat1"
          Driver         "kbd"
      EndSection
      
      Section "Monitor"
          # HorizSync source: edid, VertRefresh source: edid
          Identifier     "Monitor-seat1_1"
          VendorName     "Unknown"
          ModelName      "FUS H22-1W"
          HorizSync       28.0 - 79.0
          VertRefresh     50.0 - 75.0
          Option         "DPMS"
      EndSection
      
      Section "Device"
          Identifier     "Device-seat1"
          Driver         "nvidia"
          VendorName     "NVIDIA Corporation"
          BoardName      "GeForce GT 730"
          BusID          "PCI:2:0:0"
      EndSection
      
      Section "Screen"
          Identifier     "Screen-seat1"
          Device         "Device-seat1"
          Monitor        "Monitor-seat1_1"
          DefaultDepth    24
          Option         "Stereo" "0"
          Option         "nvidiaXineramaInfoOrder" "DFP-0"
          Option         "metamodes" "DVI-D-0: nvidia-auto-select +0+0"
          Option         "SLI" "Off"
          Option         "MultiGPU" "Off"
          Option         "BaseMosaic" "off"
          SubSection     "Display"
              Depth       24
          EndSubSection
      EndSection
      
  7. Create a new file 10-seats.conf in /etc/lightdm/lightdm.conf.d/ (create the folder if it isn't there yet) and assign the layouts and config files to each of the X servers:

    # 10-seats.conf
    [Seat:seat0]
    xserver-command=/usr/bin/X :0
    xserver-config=/etc/X11/xorg-seat0.conf
    xserver-layout=Layout-seat0
    
    [Seat:seat1]
    xserver-command=/usr/bin/X :1
    xserver-config=/etc/X11/xorg-seat1.conf
    xserver-layout=Layout-seat1
    
  8. reboot

As you may notice, the xorg-seat[01].conf files do not contain any hint to seats. I named the Identifiers using the strings seat0 and seat1, but that has no relevance.

But, in lightdm configuration it is required to use the names you assigned to the seats when creating them. seat0 can't be changed, but the second seat can have any name you choose (as long as it starts with seat and is followed by letters, digits, - and _ only). Make sure you use that name to configure the second seat - I have used seat1 to keep it simple.

I'm pretty sure that there are things that could be removed from the X config files, but I haven't yet tried to tidy them up. If you find a more minimalistic file to working well, feel free to post a comment here and I'll add your info (well, unless you don't feel like posting your own entire answer, that is).

For example, neither the mouse nor the keyboard configured in both of the X config files do exist on my machine - they are dummy devices added by nvidia-settings. The physical devices (USB wireless mouse and keyboard) are added on the fly because they are attached to seat0 and seat1 respectively.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.