I've succeeded in setting up my windows 11 VM for single gpu passthrough, however, when stopping the vm, my screen remains black. I'm using arch linux. start script: (working)
set -x
source "/etc/libvirt/hooks/kvm.conf"
systemctl stop display-manager.service
systemctl stop sddm
echo 0 > /sys/class/vtconsole/vtcon0/bind
echo 0 > /sys/class/vtconsole/vtcon1/bind
#uncomment the next line if you're getting a black screen
echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind
sleep 10
modprobe -r amdgpu
modprobe -r snd_hda_intel
virsh nodedev-detach $VIRSH_GPU_VIDEO
virsh nodedev-detach $VIRSH_GPU_AUDIO
sleep 10
modprobe vfio
modprobe vfio_pci
modprobe vfio_iommu_type1
end script: (not working)
set -x
source "/etc/libvirt/hooks/kvm.conf"
systemctl stop display-manager.service
systemctl stop sddm
echo 0 > /sys/class/vtconsole/vtcon0/bind
echo 0 > /sys/class/vtconsole/vtcon1/bind
#uncomment the next line if you're getting a black screen
echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind
sleep 10
modprobe -r amdgpu
modprobe -r snd_hda_intel
virsh nodedev-detach $VIRSH_GPU_VIDEO
virsh nodedev-detach $VIRSH_GPU_AUDIO
sleep 10
modprobe vfio
modprobe vfio_pci
modprobe vfio_iommu_type1
When ssh-ing into my system, sddm and display-manager.service are inactive. The ram used by Qemu is freed, so the VM gets stopped. I suspect some part of the script does not execute correctly, which causes an error, which causes the rest of the script to not execute. However, I don't know how to verify this theory, nor how to debug it. Any help would be appreciated!