#!/bin/bash

sudo rmmod nvidia_modeset nvidia_uvm nvidia
echo "NVIDIA drivers removed"
sudo modprobe -i vfio_pci vfio_pci_core vfio_iommu_type1
echo "VFIO drivers added"
sudo virsh nodedev-detach pci_0000_01_00_0
echo "GPU detached (now vfio ready)"
echo "COMPLETED!"
