Skip to content

Instantly share code, notes, and snippets.

@Berny23
Last active March 14, 2024 18:14
Show Gist options
  • Save Berny23/2c9b04081a2be7846d800ed78ca2c43d to your computer and use it in GitHub Desktop.
Save Berny23/2c9b04081a2be7846d800ed78ca2c43d to your computer and use it in GitHub Desktop.
KVM QEMU Single NVIDIA GPU Passthrough with Kubuntu Host and Windows 11 Guest (/etc/libvirt/hooks/qemu.d/<VM-NAME>/release/end/revert.sh)
#!/bin/bash
set -x
# Reload GPU kernel modules
modprobe nvidia
modprobe nvidia_modeset
modprobe nvidia_uvm
modprobe nvidia_drm
# Reload mainboard audio controller kernel modules
modprobe snd_hda_intel
# Rebind VT consoles
echo 1 > /sys/class/vtconsole/vtcon0/bind
nvidia-xconfig --query-gpu-info > /dev/null 2>&1
echo "efi-framebuffer.0" > /sys/bus/platform/drivers/efi-framebuffer/bind
# Restart Display Manager
systemctl start display-manager.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment