diff --git a/scripts/hooks/win10-igpu/prepare/begin/start.sh b/scripts/hooks/win10-igpu/prepare/begin/start.sh index 4c5073f..69f1e4d 100644 --- a/scripts/hooks/win10-igpu/prepare/begin/start.sh +++ b/scripts/hooks/win10-igpu/prepare/begin/start.sh @@ -46,7 +46,7 @@ modprobe -r nvidia virsh nodedev-detach $VIRSH_GPU_VIDEO virsh nodedev-detach $VIRSH_GPU_AUDIO -# Load VFIO kernel module +# Load VFIO kernel modules modprobe vfio modprobe vfio_pci modprobe vfio_iommu_type1 diff --git a/scripts/hooks/win10-igpu/release/end/revert.sh b/scripts/hooks/win10-igpu/release/end/revert.sh index a84bd63..70e9f4a 100644 --- a/scripts/hooks/win10-igpu/release/end/revert.sh +++ b/scripts/hooks/win10-igpu/release/end/revert.sh @@ -5,7 +5,20 @@ set -x # Load Variables source "/etc/libvirt/hooks/kvm.conf" -# Unload VFIO kernel module +# 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 modules modprobe -r vfio_pci modprobe -r vfio_iommu_type1 modprobe -r vfio @@ -14,7 +27,7 @@ modprobe -r vfio virsh nodedev-reattach $VIRSH_GPU_VIDEO virsh nodedev-reattach $VIRSH_GPU_AUDIO -# Read our nvidia configuration when before starting our graphics +# Read our nvidia configuration before starting our graphics nvidia-xconfig --query-gpu-info > /dev/null 2>&1 # Load all Nvidia drivers @@ -26,18 +39,5 @@ modprobe nvidia # Dealloc hugepages echo 0 > /proc/sys/vm/nr_hugepages -## 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 - -# 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 - -# Delete looking glass shm -rm /dev/shm/looking-glass - # Mount the Windows drive mount -a || /bin/true diff --git a/scripts/hooks/win10/release/end/revert.sh b/scripts/hooks/win10/release/end/revert.sh index ff43ace..3a6f58d 100644 --- a/scripts/hooks/win10/release/end/revert.sh +++ b/scripts/hooks/win10/release/end/revert.sh @@ -2,15 +2,15 @@ set -x -# 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 - # 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 + # Dealloc hugepages echo 0 > /proc/sys/vm/nr_hugepages