Created
July 5, 2022 07:13
-
-
Save sewnie/ab42126255fc5c0652449375b1b0bb2f to your computer and use it in GitHub Desktop.
kvm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| modprobe -r vfio_pci | |
| modprobe -r vfio_iommu_type1 | |
| modprobe -r vfio | |
| virsh nodedev-reattach pci_0000_01_00_0 | |
| virsh nodedev-reattach pci_0000_01_00_1 | |
| virsh nodedev-reattach pci_0000_01_00_2 | |
| virsh nodedev-reattach pci_0000_01_00_3 | |
| virsh nodedev-reattach pci_0000_05_00_0 | |
| echo 1 > /sys/class/vtconsole/vtcon1/bind | |
| echo 1 > /sys/class/vtconsole/vtcon0/bind | |
| echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/bind | |
| modprobe nvidia_drm | |
| modprobe nvidia_uvm | |
| modprobe nvidia_modeset | |
| modprobe drm_kms_helper | |
| modprobe nvidia | |
| modprobe i2c_nvidia_gpu | |
| modprobe drm | |
| sv start agetty-tty1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -x | |
| sv stop agetty-tty1 | |
| umount -R /data | |
| echo 0 > /sys/class/vtconsole/vtcon0/bind | |
| echo 0 > /sys/class/vtconsole/vtcon1/bind | |
| echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind | |
| sleep 5 | |
| modprobe -r nvidia_drm | |
| modprobe -r nvidia_uvm | |
| modprobe -r nvidia_modeset | |
| modprobe -r drm_kms_helper | |
| modprobe -r nvidia | |
| modprobe -r i2c_nvidia_gpu | |
| modprobe -r drm | |
| virsh nodedev-detach pci_0000_01_00_0 | |
| virsh nodedev-detach pci_0000_01_00_1 | |
| virsh nodedev-detach pci_0000_01_00_2 | |
| virsh nodedev-detach pci_0000_01_00_3 | |
| virsh nodedev-detach pci_0000_05_00_0 | |
| modprobe vfio | |
| modprobe vfio_pci | |
| modprobe vfio_iommu_type1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment