Guest User

start.sh

a guest
Sep 17th, 2020
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.98 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 display manager (KDE specific)
  9. systemctl stop sddm.service
  10.  
  11. #sleep 3
  12.  
  13. # Unbind VTconsoles
  14. echo 0 > /sys/class/vtconsole/vtcon0/bind
  15.  
  16. #sleep 2
  17.  
  18. # Unbind EFI-Framebuffer
  19. echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind
  20.  
  21. # Avoid a race condition
  22. sleep 5
  23.  
  24. # Unload all Nvidia drivers
  25. modprobe -r nvidia_drm
  26. modprobe -r nvidia_modeset
  27. modprobe -r drm_kms_helper
  28. modprobe -r nvidia
  29. modprobe -r i2c_nvidia_gpu
  30. modprobe -r drm
  31.  
  32. sleep 2
  33.  
  34. # Unbind the GPU from display driver
  35. virsh nodedev-detach $VIRSH_GPU_VIDEO
  36. virsh nodedev-detach $VIRSH_GPU_USB
  37. virsh nodedev-detach $VIRSH_GPU_SERIAL
  38. #It hangs right here when it tries to detach audio device
  39. virsh nodedev-detach $VIRSH_GPU_AUDIO
  40.  
  41. # Load VFIO kernel module
  42. modprobe vfio
  43. modprobe vfio_pci
  44. modprobe vfio_iommu_type1
  45.  
  46. sleep 2
  47.  
Advertisement
Add Comment
Please, Sign In to add comment