mirror of
https://gitlab.com/risingprismtv/single-gpu-passthrough.git
synced 2024-08-30 18:12:14 +00:00
Update polaris-vfio-startup.sh: added novueau, amdgpu-pro, as well as i915(Intel integrated graphics) kernel module to be unloaded just in-case someone is using those drivers.
This commit is contained in:
parent
2cb70813c6
commit
aef8f3c404
@ -1,3 +1,10 @@
|
||||
# Single GPU Passthrough Scripts
|
||||
|
||||
Scripts for passing a Polaris GPU from a linux host to a windows VM and back.
|
||||
Scripts for passing a single GPU from a Linux host to a Windows VM and back.
|
||||
|
||||
1. Change PCI ids in the vfio-startup and teardown script.
|
||||
2. Change the VM name in qemu if not already win10
|
||||
3. Run the install.sh script as root
|
||||
|
||||
For suggestions or support, join us on Discord at: https://discord.gg/bh4maVc
|
||||
|
||||
|
13
install.sh
Normal file
13
install.sh
Normal file
@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
mv /etc/libvirt/hooks/qemu /etc/libvirt/hooks/qemu_last_backup
|
||||
mv /bin/vfio-startup.sh /bin/vfio-startup.sh.bkp
|
||||
mv /bin/vfio-teardown.sh /bin/vfio-teardown.sh.bkp
|
||||
|
||||
cp vfio-startup.sh /bin/vfio-startup.sh
|
||||
cp vfio-teardown.sh /bin/vfio-teardown.sh
|
||||
cp qemu /etc/libvirt/hooks/qemu
|
||||
|
||||
chmod +x /bin/vfio-startup.sh
|
||||
chmod +x /bin/vfio-teardonw/sh
|
||||
chmod +x /etc/libvirt/hooks/qemu
|
7
qemu
7
qemu
@ -1,12 +1,13 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
|
||||
# Script for win10
|
||||
if [[ $1 == "win10" ]]; then
|
||||
if [[ $2 == "prepare" ]]; then
|
||||
/bin/polaris-vfio-startup.sh
|
||||
/bin/vfio-startup.sh 2>&1 | tee -a /var/log/libvirt/custom_hooks.log
|
||||
fi
|
||||
|
||||
if [[ $2 == "release" ]]; then
|
||||
/bin/polaris-vfio-teardown.sh
|
||||
/bin/vfio-teardown.sh 2>&1 | tee -a /var/log/libvirt/custom_hooks.log
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -37,37 +37,41 @@ stop_display_manager_if_running gdm.service
|
||||
stop_display_manager_if_running lightdm.service
|
||||
stop_display_manager_if_running lxdm.service
|
||||
stop_display_manager_if_running xdm.service
|
||||
stop_display_manager_if_running mdm.service
|
||||
stop_display_manager_if_running display-manager.service
|
||||
|
||||
|
||||
# Unbind VTconsoles if currently bound
|
||||
if test -e "/sys/class/vtconsole/vtcon0/bind" ; then
|
||||
echo 0 > /sys/class/vtconsole/vtcon0/bind
|
||||
sleep "${long_delay}"
|
||||
fi
|
||||
if test -e "/sys/class/vtconsole/vtcon1/bind" ; then
|
||||
echo 0 > /sys/class/vtconsole/vtcon1/bind
|
||||
sleep "${long_delay}"
|
||||
fi
|
||||
|
||||
#Unbind EFI-Framebuffer if currently bound
|
||||
if test -e "/sys/bus/platform/drivers/efi-framebuffer/unbind" ; then
|
||||
echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind
|
||||
sleep "${medium_delay}"
|
||||
else
|
||||
echo "Could not find framebuffer to unload!"
|
||||
fi
|
||||
|
||||
sleep "${long_delay}"
|
||||
|
||||
# Unload loaded GPU drivers
|
||||
if test -e "/tmp/vfio-loaded-gpu-modules" ; then
|
||||
rm -f /tmp/vfio-loaded-gpu-modules
|
||||
fi
|
||||
|
||||
unload_module_if_loaded amdgpu-pro
|
||||
unload_module_if_loaded amdgpu
|
||||
unload_module_if_loaded nvidia_drm
|
||||
unload_module_if_loaded nvidia_modeset
|
||||
unload_module_if_loaded nvidia_uvm
|
||||
unload_module_if_loaded nvidia
|
||||
unload_module_if_loaded ipmi_devintf
|
||||
|
||||
unload_module_if_loaded nouveau
|
||||
unload_module_if_loaded i915
|
||||
|
||||
# Unbind the GPU from display driver
|
||||
virsh nodedev-detach pci_0000_01_00_0
|
Loading…
Reference in New Issue
Block a user