Notes, scripts, XML files, and README
This commit is contained in:
36
scripts/prepare/begin/start.sh
Normal file
36
scripts/prepare/begin/start.sh
Normal file
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -x
|
||||
|
||||
# Load Variables
|
||||
source "/etc/libvirt/hooks/kvm.conf"
|
||||
|
||||
# Stop LightDM
|
||||
systemctl stop lightdm.service
|
||||
sleep 2
|
||||
|
||||
# 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 a race condition by waiting a couple of seconds. This can be calibrated to be shorter or longer if required for your system
|
||||
sleep 2
|
||||
|
||||
# Unload all Nvidia drivers
|
||||
modprobe -r nvidia_drm
|
||||
modprobe -r nvidia_modeset
|
||||
modprobe -r drm_kms_helper
|
||||
modprobe -r nvidia
|
||||
modprobe -r drm
|
||||
|
||||
# Unbind the GPU from display driver
|
||||
virsh nodedev-detach $VIRSH_GPU_VIDEO
|
||||
virsh nodedev-detach $VIRSH_GPU_AUDIO
|
||||
|
||||
# Load VFIO kernel module
|
||||
modprobe vfio
|
||||
modprobe vfio_pci
|
||||
modprobe vfio_iommu_type1
|
Reference in New Issue
Block a user