From f1b32326aa6e934a8b0f69c26c60f3f83ba41e25 Mon Sep 17 00:00:00 2001 From: aidan Date: Sun, 23 Feb 2025 23:19:06 -0500 Subject: [PATCH] Clone --- README.md | 36 +++++++++++ gpu.rom | Bin 0 -> 962048 bytes kvm.conf | 2 + qemu | 33 ++++++++++ win11.xml | 176 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 247 insertions(+) create mode 100644 README.md create mode 100644 gpu.rom create mode 100644 kvm.conf create mode 100644 qemu create mode 100644 win11.xml diff --git a/README.md b/README.md new file mode 100644 index 0000000..e70f97b --- /dev/null +++ b/README.md @@ -0,0 +1,36 @@ +# QEMU-PCIE-GPU-Passthrough +![image](https://github.com/ahaas25/QEMU-PCIE-GPU-Passthrough/assets/94150901/ade6d743-e51f-43ce-a23b-c6a710b048d0) +![image](https://github.com/ahaas25/QEMU-PCIE-GPU-Passthrough/assets/94150901/69f0a2f6-576d-4934-82d1-e38f63411309) +My QEMU configuration files for passing my RTX 3070 to a Windows 11 VM. + +# Credits +This is a simplified guide based on [here](https://github.com/martinopiaggi/Single-GPU-Passthrough-for-Dummies). I highly recommend reading this guide to get a better understanding of how this works. + +# Patched VBIOS (NVIDIA Only) +I've provided my patched VBIOS as an example of what a correctly patched image should look like. Find the VBIOS for your graphics card and download it. Use a Hex editor to modify the rom file and search for the first instance of `VIDEO`. Look to the left of it for a `U`. Delete everything before the `U`. + +# Setup Overview +This is my simplified guide based off a lot of troubleshooting. +1. Enable IOMMU and Virtualization in your BIOS. +2. Install `qemu`, `libvirt`, `virt-manager` and necessary libraries. +3. Create a Windows VM using `virt-manager` using default settings. (No device passthrough yet) +4. Ensure CPU topology is correct under `CPUs` tab. (Mine was set incorrectly by default) +5. Install Windows and ensure VM works. +6. Find your GPU's PCI bus using `lspci`. In my case my GPU is on `pci_0000_08_00_0` and the audio controller is `pci_0000_08_00_1` +7. Modify `start.sh` and `stop.sh` to suite your configuration. Change any lines refering to the GPU bus to your systems (Mine is `pci_0000_08_00_0`). Make sure to change `gdm` to your display manager if you are not using GNOME. +8. Copy `start.sh` and `stop.sh` scripts in `/etc/libvirt/hooks/qemu.d//` keeping the file structure the same as in this repository. Ensure the scripts are executable with `chmod +x