chore(malachite): update passthrough script for nvidia

This commit is contained in:
stitchy 2025-11-02 16:44:26 -08:00
parent 54c92e13a6
commit b1dde40dcc
Signed by: stitchy
SSH key fingerprint: SHA256:p+xeQgmOvQ2br1d2STl5OnRRMef2LRqCtGA7SO4WYk0

View file

@ -24,15 +24,20 @@ let
echo 0 > /sys/class/vtconsole/vtcon1/bind
# Unbind EFI-Framebuffer
#echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind
# Unbind the GPU from display driver
virsh nodedev-detach pci_0000_03_00_0
virsh nodedev-detach pci_0000_03_00_1
virsh nodedev-detach pci_0000_03_00_2
# echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind
# Unload Modules
modprobe -r amdgpu
# modprobe -r amdgpu
modprobe -r nvidia_drm nvidia_modeset nvidia_uvm nvidia
# Unbind the GPU from display driver
# virsh nodedev-detach pci_0000_03_00_0
# virsh nodedev-detach pci_0000_03_00_1
# virsh nodedev-detach pci_0000_03_00_2
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
# We love race conditions
sleep 2
@ -53,9 +58,13 @@ let
modprobe -r vfio_iommu_type1 vfio_pci vfio
# Re-Bind GPU to Host
virsh nodedev-reattach pci_0000_03_00_0
virsh nodedev-reattach pci_0000_03_00_1
virsh nodedev-reattach pci_0000_03_00_2
# virsh nodedev-reattach pci_0000_03_00_0
# virsh nodedev-reattach pci_0000_03_00_1
# virsh nodedev-reattach pci_0000_03_00_2
virsh nodedev-reattach pci_0000_01_00_0
virsh nodedev-reaetach pci_0000_01_00_1
virsh nodedev-reaetach pci_0000_01_00_2
virsh nodedev-reaetach pci_0000_01_00_3
# Rebind VT consoles
echo 1 > /sys/class/vtconsole/vtcon0/bind
@ -64,10 +73,11 @@ let
sleep 2
# Bind Framebuffer
#echo "efi-framebuffer.0" > /sys/bus/platform/drivers/efi-framebuffer/bind
# echo "efi-framebuffer.0" > /sys/bus/platform/drivers/efi-framebuffer/bind
# Reload Modules
modprobe amdgpu
# modprobe amdgpu
modprobe nvidia_drm nvidia_modeset nvidia_uvm nvidia
# Back to On-Demand Scheduler
for file in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do echo "ondemand" > "$file"; done