Begin add gpuPassgrouth conf

This commit is contained in:
Florian RICHER 2024-05-07 17:55:36 +02:00
parent f7ad61e5a0
commit c117a43b27
12 changed files with 402 additions and 0 deletions

View file

@ -0,0 +1,34 @@
#!/bin/bash
# Helpful to read output when debugging
set -x
# Load variables
source "/etc/libvirt/hooks/kvm.conf"
# Stop display manager
systemctl stop gdm.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 a Race condition
sleep 5
# Unload all Nvidia drivers
modprobe -r nvidia_drm
modprobe -r nvidia_modeset
modprobe -r nvidia_uvm
modprobe -r nvidia
# Unbind the GPU from display driver
virsh nodedev-detach $VIRSH_GPU_VIDEO
virsh nodedev-detach $VIRSH_GPU_AUDIO
virsh nodedev-detach $VIRSH_USB
virsh nodedev-detach $VIRSH_SERIAL_BUS
# Load VFIO Kernel Module
modprobe vfio-pci