Advertisement
Guest User

start.sh

a guest
Jun 1st, 2021
2,255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.67 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # set debugging
  4. set -x
  5.  
  6. # load variables
  7. source "/etc/libvirt/hooks/kvm.conf"
  8.  
  9. # stop display manager
  10. systemctl stop sddm.service
  11.  
  12. # unbind VTConsoles
  13. echo 0 > /sys/class/vtconsole/vtcon0/bind
  14. echo 0 > /sys/class/vtconsole/vtcon1/bind
  15.  
  16. # unbind efi framebuffer
  17. echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind
  18.  
  19. # avoid race condition
  20. sleep 12
  21.  
  22. # unload nvidia
  23. modprobe -r nvidia_uvm
  24. modprobe -r nvidia_drm
  25. modprobe -r nvidia_modeset
  26. modprobe -r drm_kms_helper
  27. modprobe -r drm
  28. modprobe -r nvidia
  29.  
  30. # unbind the GPU
  31. virsh nodedev-detach $VIRSH_GPU_VIDEO
  32. virsh nodedev-detach $VIRSH_GPU_AUDIO
  33.  
  34. # load vfio
  35. modprobe vfio_pci
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement