[KVM] Add Desktop gpu-passthrouth config
This commit is contained in:
parent
c5d8a8501f
commit
0034421f8b
11 changed files with 1357 additions and 0 deletions
7
configs/kvm/libvirt/hooks/qemu.d/win10/release/end/cpu_mode_ondemand.sh
Executable file
7
configs/kvm/libvirt/hooks/qemu.d/win10/release/end/cpu_mode_ondemand.sh
Executable file
|
@ -0,0 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
## Enable CPU governor on-demand mode
|
||||
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
|
||||
for file in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do echo "ondemand" > $file; done
|
||||
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
|
||||
|
4
configs/kvm/libvirt/hooks/qemu.d/win10/release/end/dealloc_hugepages.sh
Executable file
4
configs/kvm/libvirt/hooks/qemu.d/win10/release/end/dealloc_hugepages.sh
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/bash
|
||||
|
||||
echo 0 > /proc/sys/vm/nr_hugepages
|
||||
|
36
configs/kvm/libvirt/hooks/qemu.d/win10/release/end/stop.sh
Executable file
36
configs/kvm/libvirt/hooks/qemu.d/win10/release/end/stop.sh
Executable file
|
@ -0,0 +1,36 @@
|
|||
#!/bin/bash
|
||||
set -x
|
||||
|
||||
# Load variables
|
||||
source "/etc/libvirt/hooks/kvm.conf"
|
||||
|
||||
# Unload VFIO-PCI Kernel Driver
|
||||
modprobe -r vfio-pci
|
||||
modprobe -r vfio_iommu_type1
|
||||
modprobe -r vfio
|
||||
|
||||
# Re-Bind GPU to Nvidia Driver
|
||||
virsh nodedev-reattach $VIRSH_GPU_VIDEO
|
||||
virsh nodedev-reattach $VIRSH_GPU_AUDIO
|
||||
virsh nodedev-reattach $VIRSH_USB
|
||||
virsh nodedev-reattach $VIRSH_SERIAL_BUS
|
||||
|
||||
# Rebind VT consoles
|
||||
echo 1 > /sys/class/vtconsole/vtcon0/bind
|
||||
echo 1 > /sys/class/vtconsole/vtcon1/bind
|
||||
|
||||
# Bind EFI-Framebuffer
|
||||
nvidia-xconfig --query-gpu-info > /dev/null 2>&1
|
||||
echo "efi-framebuffer.0" > /sys/bus/platform/drivers/efi-framebuffer/bind
|
||||
|
||||
# Load all Nvidia drivers
|
||||
modprobe nvidia_drm
|
||||
modprobe nvidia_modeset
|
||||
modprobe drm_kms_helper
|
||||
modprobe drm
|
||||
modprobe nvidia_uvm
|
||||
modprobe nvidia
|
||||
|
||||
# Restart Display Manager
|
||||
systemctl start gdm.service
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue