merge-requests/1/head
Yuri Alek 6 years ago
parent b5ef833d76
commit d0ea27d93b

@ -1,6 +1,6 @@
# Single GPU passthrough with QEMU and VFIO # Single GPU passthrough with QEMU and VFIO
<!-- AKA Passthrough VGA on first slot --> <!-- AKA Passthrough VGA on first slot -->
----
## ToC ## ToC
1. [What this does](#what-this-does) 1. [What this does](#what-this-does)
2. [What you need](#what-you-need) 2. [What you need](#what-you-need)
@ -10,7 +10,6 @@
6. [Known problems](#known-problems) 6. [Known problems](#known-problems)
7. [TODO](#todo) 7. [TODO](#todo)
## What this does ## What this does
In one command it kills X, frees the GPU from drivers and console, detaches the GPU from the host, starts the VM with the GPU, waits until the VM is off, reattaches the GPU to the host and starts lightdm. In one command it kills X, frees the GPU from drivers and console, detaches the GPU from the host, starts the VM with the GPU, waits until the VM is off, reattaches the GPU to the host and starts lightdm.
@ -65,14 +64,15 @@ sudo mkinitcpio -p linux
4. Reboot the system to load the vfio drivers 4. Reboot the system to load the vfio drivers
5. (Optional)[Download virtio drivers](virtio_drivers) 5. [Optional] [Download virtio drivers](virtio_drivers)
``` ```
wget -o virtio-win.iso "https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso" wget -o virtio-win.iso "https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso"
``` ```
6. Get the GPU BIOS [Source](GPU_BIOS_video) <!--[Why?][] --> 6. Get the GPU BIOS [Source](GPU_BIOS_video)
[You can download the bios.](techpowerup vgabios) If you do so, download a HEX editor and skip to step 4. <!-- [Why?][] -->
[You can download the bios.](techpowerup vgabios) If you do so, download a HEX editor and skip to step 4.
1. Boot the host into Windows. 1. Boot the host into Windows.
2. [Download and install GPU-Z](GPU-Z). 2. [Download and install GPU-Z](GPU-Z).
3. [Download and install a HEX editor](bless). 3. [Download and install a HEX editor](bless).
@ -89,7 +89,7 @@ And you must supply QEMU with the Full GPU's ROM extracted extracted using a too
```bash ```bash
chmod +x scripts/iommu.sh chmod +x scripts/iommu.sh
bash scripts/iommu.sh bash scripts/iommu.sh
---- -------------------------
# GPU # GPU
IOMMU group 13 IOMMU group 13
06:00.0 VGA compatible controller [0300]: NVIDIA Corporation GK104 [GeForce GTX 770] [10de:1184] (rev a1) 06:00.0 VGA compatible controller [0300]: NVIDIA Corporation GK104 [GeForce GTX 770] [10de:1184] (rev a1)
@ -102,18 +102,17 @@ IOMMU group 18
08:00.2 SATA controller [0106]: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] [1022:7901] (rev 51) 08:00.2 SATA controller [0106]: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] [1022:7901] (rev 51)
``` ```
8. (Optional) Create the image for the VM. Only if not using a physical hard drive. 8. [Optional] Create the image for the VM. Only if not using a physical hard drive.
``` ```
qemu-img create -f raw windows.raw 60G qemu-img create -f raw windows.raw 60G
``` ```
9. Edit the script `windows-install.sh` and `windows.sh` to convenience 9. Edit the script `windows-install.sh` and `windows.sh` to convenience. Things you may have to edit:
Things you may have to edit:
1. PCI devices 1. PCI devices
2. User 2. User
3. Location of HDD, vBIOS and OVMF image 3. Location of HDD, ISO, vBIOS and OVMF image
4. The Desktop Environment, Display Manager, Windows Manager, etc. 4. The Desktop Environment, Display Manager, Window Manager, etc.
5. QEMU options like RAM and CPU config 5. QEMU options like RAM and CPU
6. Kernel modules 6. Kernel modules
<!-- <!--
Check the guides [IOMMU][], [other guide, may be important][] Check the guides [IOMMU][], [other guide, may be important][]
@ -123,8 +122,7 @@ Check the guides [IOMMU][], [other guide, may be important][]
sudo scripts/windows-install.sh sudo scripts/windows-install.sh
``` ```
11. Install Windows 11. When installing Windows, in the section `Where do you want to install Windows?` there will be no hard drives to install to; to fix it:
When you are asked for a hard drive there will be none.
1. Load driver 1. Load driver
2. Browse 2. Browse
3. CD Drive (E:) virtio-win-0.1.1 3. CD Drive (E:) virtio-win-0.1.1
@ -144,11 +142,20 @@ sudo scripts/windows.sh
``` ```
### For the sake of convenience ### For the sake of convenience
``` ```bash
sudo ln -s scripts/qemu@.service /usr/lib/systemd/system/ sudo ln -s scripts/qemu@.service /usr/lib/systemd/system/
``` ```
```bash
alias windows="sudo systemctl start qemu@windows.service"
alias macos="sudo systemctl start qemu@macos-hs.service"
```
To start the Windows VM
```
windows
```
To start the MacOS VM
``` ```
alias fuckmicrosoft="sudo systemctl start qemu@windows.service" macos
``` ```
## About peripherals ## About peripherals

Loading…
Cancel
Save