Hello Everyone,
I run on my desktop a Windows VM with Looking-Glass and a GTX1080, while the Host (Arch Linux) uses a RX550 as a display output. That works just fine.
When I don’t need the VM I can run games on the GTX using prime-run. That works just fine as well (even though I don’t have a Igpu).
However, the transition from one mode to the other is not very consistent.
I wrote a small script, which removes the vfio-pcie module, loads the nvidia module, and restarts sddm (effectively the x-server):
#!/bin/bash
sudo -s <<EOF
modprobe -r vfio-pci
echo 1 > /sys/bus/pci/devices/0000:27:00.0/remove
echo 1 > /sys/bus/pci/devices/0000:27:00.1/remove
echo 1 > /sys/bus/pci/rescan
EOF
export DISPlAY=:0
qdbus org.kde.ksmserver /KSMServer logout 0 0 0
sleep 2
sudo -s << EOF
modprobe nvidia
sleep 1
systemctl restart sddm
EOF
the problem is that sddm does not automatically log me in again, and for some reason only shows up with a black screen an the courser (at least every other sddm release). I tried to troubleshoot that problem many times and decided it is easier to tick the autologin box.
Does anyone know if there is a better solution, which does not involve restarting the x-server?
I can load the proper module without the need to log out or restart the x-server, however prime run only works after the restart.
Or any Ideas what I can try to fix sddm for good?