mirror of
https://github.com/WarrenHood/dotfiles.git
synced 2025-04-29 14:05:00 +01:00
Added some scripts for VFIO
This commit is contained in:
parent
3e567de177
commit
10cb42ccc4
8
scripts/.scripts/find_gpu_iommu
Executable file
8
scripts/.scripts/find_gpu_iommu
Executable file
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/env bash
|
||||||
|
shopt -s nullglob
|
||||||
|
for g in `find /sys/kernel/iommu_groups/* -maxdepth 0 -type d | sort -V`; do
|
||||||
|
echo "IOMMU Group ${g##*/}:"
|
||||||
|
for d in $g/devices/*; do
|
||||||
|
echo -e "\t$(lspci -nns ${d##*/})"
|
||||||
|
done;
|
||||||
|
done;
|
10
scripts/.scripts/vm_activate
Executable file
10
scripts/.scripts/vm_activate
Executable file
|
@ -0,0 +1,10 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo "Unloading nvidia_drm"
|
||||||
|
sudo modprobe -r nvidia_drm
|
||||||
|
|
||||||
|
echo "Setting graphics mode to Vfio"
|
||||||
|
supergfxctl -m Vfio
|
||||||
|
|
||||||
|
echo "Restarting libvirtd"
|
||||||
|
sudo systemctl restart --now libvirtd
|
10
scripts/.scripts/vm_deactivate
Executable file
10
scripts/.scripts/vm_deactivate
Executable file
|
@ -0,0 +1,10 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo "Loading nvidia_drm"
|
||||||
|
sudo modprobe nvidia_drm
|
||||||
|
|
||||||
|
echo "Setting graphics mode to Integrated"
|
||||||
|
supergfxctl -m Integrated
|
||||||
|
|
||||||
|
echo "Restarting libvirtd"
|
||||||
|
sudo systemctl restart --now libvirtd
|
Loading…
Reference in a new issue