mandatorypeanuts

script.sh

Aug 18th, 2025
17
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. #!/bin/bash
  2. #Output debugging
  3. set -x
  4.  
  5. #Load variables
  6. source "/etc/libvirt/hooks/kvm.conf"
  7.  
  8. #Stop display manager
  9. #systemctl stop display-manager systemctl --user -M Dylon@ stop 'plasma\*'
  10. #systemctl stop sddm.service
  11. sudo systemctl stop sddm
  12. systemctl status display-manager.service
  13.  
  14.  
  15. #Unbind VTconsoles
  16. echo 0 > /sys/class/vtconsole/vtcon0/bind
  17. echo 0 > /sys/class/vtconsole/vtcon1/bind
  18.  
  19. #framebuffer
  20. echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind
  21.  
  22.  
  23. #GPUs
  24. sleep 5
  25.  
  26. echo "0000:03:00.0" | sudo tee /sys/bus/pci/devices/0000:03:00.0/driver/unbind
  27.  
  28. sleep 5
  29.  
  30. modprobe -r amdgpu
  31. modprobe -r snd_hda_intel
  32.  
  33.  
  34. virsh nodedev-detach $VIRSH_GPU_VIDEO
  35. virsh nodedev-detach $VIRSH_GPU_AUDIO
  36. virsh nodedev-detach $VIRSH_GPU_VGA
  37. virsh nodedev-detach $VIRSH_GPU_AUDIO2
  38.  
  39. sleep 5
  40.  
  41. modprobe vfio
  42. modprobe vfio-pci
  43. modprobe vfio_iommu_type1
Advertisement
Add Comment
Please, Sign In to add comment