Multiseat randomly switching Monitors after reboot

I do have a somewhat unusual multiseat-setup for a long time. A year ago i had to switch to nvidia nouveau driver because suddenly the nvidia-driver would ignore my second card. (After update: nvidia driver ignores 2nd card - Drivers - Manjaro Linux Forum)
All is well with kernel 4.19
My seat0 has one 4k-monitor +keyboard+mouse+nvidia-card0
My seat1 has two smaller monitors with another keyboard and mouse on a second nvidia-card1
After BOOT i can login at my seat0 with my keyboard and mouse. And my wive can login at seat1 with the second keyboard & mouse (so far so good)

But if i try to use kernel 5.4 or 5.9 this setup behaves odd.
After Boot my loginscreen with my name shows up on the monitor of my wive. My mouse and keyboard also do work only on this screen.
The loginscreen on my monitor has the name of my wive on it, and it does work only with second keyboard & mouse.
So something has switched places.
I thought this may be easy to correct. And i exchanged mouse & keyboard so that all will fit again. And we could work like this.

The strange thing is. This seems to happen randomly at every boot. Has anyone an idea what is happening ???

Andreas
P.S. loginctl seat-status seat0 (or seat1) seam to be nearly the same in both situations but the first line indicates that the “Sessions: …” is exchanged between seat0 and seat1

inxi -Fazy                                                                                                        
System:
  Kernel: 5.4.78-1-MANJARO x86_64 bits: 64 compiler: gcc v: 10.2.0 
  parameters: BOOT_IMAGE=/@/boot/vmlinuz-5.4-x86_64 
  root=UUID=3487ba3d-1cba-4cdc-a043-c420ebca2aca rw rootflags=subvol=@ 
  bootsplash.bootfile=bootsplash-themes/manjaro/bootsplash 
  modprobe.blacklist=ccp udev.log_priority=3 audit=0 sysrq_always_enabled=1 
  Desktop: Xfce 4.14.3 tk: Gtk 3.24.23 info: xfce4-panel wm: xfwm4 
  dm: LightDM 1.30.0 Distro: Manjaro Linux 
Machine:
  Type: Desktop Mobo: ASRock model: B450 Pro4 serial: <filter> 
  UEFI: American Megatrends v: P1.10 date: 06/19/2018 
Battery:
  Device-1: hidpp_battery_0 model: Logitech M310 serial: <filter> 
  charge: 50% (should be ignored) rechargeable: yes status: N/A 
  Device-2: hidpp_battery_1 model: Logitech Wireless Keyboard K270 
  serial: <filter> charge: 100% (should be ignored) rechargeable: yes 
  status: Discharging 
  Device-3: hidpp_battery_2 model: Logitech K520 serial: <filter> 
  charge: 50% (should be ignored) rechargeable: yes status: N/A 
CPU:
  Info: 8-Core model: AMD Ryzen 7 2700 bits: 64 type: MT MCP arch: Zen+ 
  family: 17 (23) model-id: 8 stepping: 2 microcode: 800820D 
  L2 cache: 4096 KiB 
  flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm 
  bogomips: 102224 
  Speed: 1611 MHz min/max: 1550/3200 MHz boost: enabled Core speeds (MHz): 
  1: 1572 2: 1614 3: 1530 4: 1547 5: 1373 6: 1372 7: 1546 8: 1546 9: 2876 
  10: 3894 11: 1587 12: 1615 13: 1609 14: 1619 15: 1374 16: 1375 
  Vulnerabilities: Type: itlb_multihit status: Not affected 
  Type: l1tf status: Not affected 
  Type: mds status: Not affected 
  Type: meltdown status: Not affected 
  Type: spec_store_bypass 
  mitigation: Speculative Store Bypass disabled via prctl and seccomp 
  Type: spectre_v1 
  mitigation: usercopy/swapgs barriers and __user pointer sanitization 
  Type: spectre_v2 mitigation: Full AMD retpoline, IBPB: conditional, STIBP: 
  disabled, RSB filling 
  Type: srbds status: Not affected 
  Type: tsx_async_abort status: Not affected 
Graphics:
  Device-1: NVIDIA GK107 [GeForce GT 740] vendor: eVga.com. driver: nouveau 
  v: kernel bus ID: 01:00.0 chip ID: 10de:0fc8 
  Device-2: NVIDIA GP107 [GeForce GTX 1050 Ti] vendor: Gigabyte 
  driver: nouveau v: kernel bus ID: 26:00.0 chip ID: 10de:1c82 
  Display: x11 server: X.org 1.20.9 driver: nouveau unloaded: modesetting 
  alternate: fbdev,nv,vesa resolution: <xdpyinfo missing> 
  OpenGL: renderer: NV137 v: 4.3 Mesa 20.2.2 direct render: Yes 
Audio:
  Device-1: NVIDIA GK107 HDMI Audio vendor: eVga.com. driver: snd_hda_intel 
  v: kernel bus ID: 01:00.1 chip ID: 10de:0e1b 
  Device-2: NVIDIA GP107GL High Definition Audio vendor: Gigabyte 
  driver: snd_hda_intel v: kernel bus ID: 26:00.1 chip ID: 10de:0fb9 
  Device-3: AMD Family 17h HD Audio vendor: ASRock driver: snd_hda_intel 
  v: kernel bus ID: 28:00.3 chip ID: 1022:1457 
  Device-4: Logitech C922 Pro Stream Webcam type: USB 
  driver: snd-usb-audio,uvcvideo bus ID: 1-1:2 chip ID: 046d:085c 
  serial: <filter> 
  Sound Server: ALSA v: k5.4.78-1-MANJARO 
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet 
  vendor: ASRock driver: r8169 v: kernel port: c000 bus ID: 25:00.0 
  chip ID: 10ec:8168 
  IF: enp37s0 state: up speed: 1000 Mbps duplex: full mac: <filter> 
Drives:
  Local Storage: total: 4.22 TiB used: 473.06 GiB (10.9%) 
  SMART Message: Unable to run smartctl. Root privileges required. 
  ID-1: /dev/sda vendor: Western Digital model: WD20EARX-00PASB0 
  size: 1.82 TiB block size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s 
  serial: <filter> rev: AB51 scheme: GPT 
  ID-2: /dev/sdb vendor: A-Data model: SP610 size: 476.94 GiB block size: 
  physical: 512 B logical: 512 B speed: 6.0 Gb/s serial: <filter> rev: 2C 
  scheme: GPT 
  ID-3: /dev/sdc vendor: SanDisk model: SDSSDH31000G size: 931.51 GiB 
  block size: physical: 512 B logical: 512 B speed: 6.0 Gb/s serial: <filter> 
  rev: 10RL scheme: GPT 
  ID-4: /dev/sdd vendor: Western Digital model: WD10EADS-00M2B0 
  size: 931.51 GiB block size: physical: 512 B logical: 512 B speed: 3.0 Gb/s 
  serial: <filter> rev: 0A01 scheme: GPT 
  ID-5: /dev/sde vendor: A-Data model: SX900 size: 119.24 GiB block size: 
  physical: 512 B logical: 512 B speed: 6.0 Gb/s serial: <filter> rev: 7a 
  scheme: GPT 
  ID-6: /dev/sdf type: USB vendor: Generic model: STORAGE DEVICE 
  size: 3.75 GiB block size: physical: 512 B logical: 512 B serial: <filter> 
  rev: 0250 scheme: MBR 
  SMART Message: Unknown USB bridge. Flash drive/Unsupported enclosure? 
Partition:
  ID-1: / raw size: 372.53 GiB size: 848.97 GiB (227.89%) 
  used: 473.06 GiB (55.7%) fs: btrfs dev: /dev/sdc2 
  ID-2: /home raw size: 372.53 GiB size: 848.97 GiB (227.89%) 
  used: 473.06 GiB (55.7%) fs: btrfs dev: /dev/sdc2 
Swap:
  Kernel: swappiness: 10 (default 60) cache pressure: 50 (default 100) 
  ID-1: swap-1 type: partition size: 39.06 GiB used: 0 KiB (0.0%) priority: -2 
  dev: /dev/sda1 
Sensors:
  System Temperatures: cpu: 44.4 C mobo: N/A 
  Fan Speeds (RPM): N/A 
  GPU: device: nouveau temp: 55.0 C fan: 0 device: nouveau temp: 39.0 C 
  mV: 975.00 
Info:
  Processes: 440 Uptime: 9h 04m Memory: 47.06 GiB used: 4.18 GiB (8.9%) 
  Init: systemd v: 246 Compilers: gcc: 10.2.0 clang: 11.0.0 Packages: 
  pacman: 2057 lib: 453 Shell: Zsh v: 5.8 running in: gnome-terminal 
  inxi: 3.1.08`
1 Like

Now i did monitor this for some Days.
When i start with kernel 4.19 each and every time all is well
When i start with kernel 5.4 or 5.9 most of the time my seats are switched.

First i thought this has to do with seat-management. But

loginctl seat-status seat0
loginctl seat-status seat1

dont show any differences when called in the normal/switched situation

Then i thought there may be a difference in recognizing my 2 graphic-cards so that they will switch place. But looking in seat status shows every time the same:

loginctl seat-status seat0|egrep ‘drm:card|Logitec|Sessions’

Linux manjaro18 4.19.160-1-MANJARO #1 SMP Tue Nov 24         18:41:45 UTC 2020 x86_64 GNU/Linux
seat0
	Sessions: *c2
		  │ │   │ input:input26 "Logitech USB Receiver"
		  │ │     input:input27 "Logitech USB Receiver  Consumer Control"
		  │ [MASTER] drm:card1
		  │ │ [MASTER] drm:card1-DP-1
		  │ │ [MASTER] drm:card1-DVI-D-2
		  │ │ [MASTER] drm:card1-HDMI-A-2
		  │ │ [MASTER] drm:card1-HDMI-A-3
		  │   [MASTER] drm:card1-HDMI-A-4
		  │     input:input14 "Logitech K270"
seat1
	Sessions: *c1
		  │ [MASTER] drm:card0
		  │ │ [MASTER] drm:card0-DVI-D-1
		  │ │ [MASTER] drm:card0-DVI-I-1
		  │   [MASTER] drm:card0-HDMI-A-1
		  │ input:input12 "Logitech M310"
		    input:input13 "Logitech K520"

Then i thought maybe the mouse and keboard switch place. But seat-status shows they don’t. I have no clue on what happens
:exploding_head:

normal:

(login1)   ..... (login2)
[drm:card1].....[drm:card0]
[monitor1] ..... [monitor2]+[monitor3]
[keyboard1]..... [keyboard2]
[mouse1]   ..... [mouse2]

switched:

(login2)   ..... (login1)
[drm:card1].....[drm:card0]
[monitor1] ..... [monitor2]+[monitor3]
[keyboard2]..... [keyboard1]
[mouse2]   ..... [mouse1]

So when this happens, loginctl seat-status does not represent reality. because it says that:

seat0 has [drm:card1]…[drm:card1] which is connected to [monitor1]
seat0 has input:input14 “Logitech K270” which is my [keyboard1]
seat0 has input:input27 “Logitech USB Receiver Consumer Control” which is my [mouse1 = input27]

but in reality [mouse2 = input12 “Logitech M310”] and [keyboard2 = input13 “Logitech K520”] are connected to the session on [monitor1]
:thinking:
For me the problem is not the switched “login”, but that every time this happens i have to switch mouse and keyboard between seats