Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # set debugging
- set -x
- # load variables
- source "/etc/libvirt/hooks/kvm.conf"
- # stop display manager
- systemctl stop sddm.service
- # unbind VTConsoles
- echo 0 > /sys/class/vtconsole/vtcon0/bind
- echo 0 > /sys/class/vtconsole/vtcon1/bind
- # unbind efi framebuffer
- echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind
- # avoid race condition
- sleep 12
- # unload nvidia
- modprobe -r nvidia_uvm
- modprobe -r nvidia_drm
- modprobe -r nvidia_modeset
- modprobe -r drm_kms_helper
- modprobe -r drm
- modprobe -r nvidia
- # unbind the GPU
- virsh nodedev-detach $VIRSH_GPU_VIDEO
- virsh nodedev-detach $VIRSH_GPU_AUDIO
- # load vfio
- modprobe vfio_pci
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement