Advertisement
Guest User

start.sh

a guest
Jun 24th, 2021
3,394
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. #!/bin/bash
  2. # Helpful to read output when debugging
  3. set -x
  4.  
  5. # Load the config file with our environmental variables
  6. source "/etc/libvirt/hooks/kvm.conf"
  7.  
  8. # Stop your display manager. If youre on kde it ll be sddm.service. Gnome users should use killall gdm-x-session instead
  9. systemctl stop display-manager.service
  10. pulse_pid=$(pgrep -u youruser pulseaudio)
  11. pipewire_pid=$(pgrep -u youruser pipewire)
  12. kill $pulse_pid
  13. kill $pipewire_pid
  14.  
  15. # Unbind VTconsoles
  16. echo 0 > /sys/class/vtconsole/vtcon0/bind
  17. echo 0 > /sys/class/vtconsole/vtcon1/bind
  18.  
  19. # Avoid a race condition by waiting a couple of seconds. This can be calibrated to be shorter or longer if required for your system
  20. sleep 5
  21.  
  22. # Unload all Radeon drivers
  23. modprobe -r amdgpu
  24.  
  25. # Unbind the GPU from display driver
  26. virsh nodedev-detach $VIRSH_GPU_VIDEO
  27. virsh nodedev-detach $VIRSH_GPU_AUDIO
  28.  
  29. # Load VFIO kernel module
  30. modprobe vfio
  31. modprobe vfio_pci
  32. modprobe vfio_iommu_type1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement