#!/bin/bash set -x # Load Variables source "/etc/libvirt/hooks/kvm.conf" # Deisolate host systemctl set-property --runtime -- user.slice AllowedCPUs=0-15 systemctl set-property --runtime -- system.slice AllowedCPUs=0-15 systemctl set-property --runtime -- init.scope AllowedCPUs=0-15 # Enable CPU governor schedutil mode cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor for file in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do echo "schedutil" > $file; done cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor # Delete looking glass shm rm /dev/shm/looking-glass # Unload VFIO kernel module modprobe -r vfio-pci # Rebind the GPU to display driver virsh nodedev-reattach $VIRSH_GPU_VIDEO virsh nodedev-reattach $VIRSH_GPU_AUDIO # Read our nvidia configuration before starting our graphics nvidia-xconfig --query-gpu-info > /dev/null 2>&1 # Load all Nvidia drivers modprobe nvidia_drm modprobe nvidia_modeset modprobe nvidia_uvm modprobe nvidia # Dealloc hugepages echo 0 > /proc/sys/vm/nr_hugepages # Mount the Windows drive mount -a || /bin/true