Advertisement
Guest User

startup script

a guest
Dec 1st, 2021
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.08 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 sddm.service
  10. pulse_pid=$(pgrep -u YOURUSERNAME pulseaudio)
  11. pipewire_pid=$(pgrep -u YOURUSERNAME pipewire-media)
  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.  
  20. # Avoid a race condition by waiting a couple of seconds. This can be calibrated to be shorter or longer if required for your system
  21. sleep 5
  22.  
  23. # Unload all Radeon drivers
  24.  
  25. modprobe -r amdgpu
  26. modprobe -r gpu_sched
  27. modprobe -r ttm
  28. modprobe -r drm_kms_helper
  29. modprobe -r i2c_algo_bit
  30. modprobe -r drm
  31. modprobe -r snd_hda_intel
  32.  
  33. # Unbind the GPU from display driver
  34. virsh nodedev-detach $VIRSH_GPU_VIDEO
  35. virsh nodedev-detach $VIRSH_GPU_AUDIO
  36.  
  37. # Load VFIO kernel module
  38. modprobe vfio
  39. modprobe vfio_pci
  40. modprobe vfio_iommu_type1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement