Skip to content

Instantly share code, notes, and snippets.

@266-750Balloons
Created August 1, 2022 07:33
Show Gist options
  • Save 266-750Balloons/383c3c330f819bd7d3bf57a893a03800 to your computer and use it in GitHub Desktop.
Save 266-750Balloons/383c3c330f819bd7d3bf57a893a03800 to your computer and use it in GitHub Desktop.
my unbind_vfio.sh
#!/bin/bash
## Load the config file
source "/etc/libvirt/hooks/kvm.conf"
## Unbind gpu from vfio and bind to amd
virsh nodedev-reattach $VIRSH_GPU_VIDEO
virsh nodedev-reattach $VIRSH_GPU_AUDIO
## Unload vfio
sudo modprobe -r vfio_pci
sudo modprobe -r vfio_iommu_type1
sudo modprobe -r vfio
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment