- [Reddit thread of what is needed for GPU passthrough](https://www.reddit.com/r/Qubes/comments/9hp3e7/gpu_passthrough_howto/)
- [Solution to have more than 3Go of RAM in the Windows HVM](https://github.com/QubesOS/qubes-issues/issues/4321#issuecomment-423011787)
- [Some old references](https://www.reddit.com/r/Qubes/comments/66wk4q/gpu_passthrough/)
## Prerequise
You have a functional Windows 7 HVM.
The "how to" for this part can be found on the Qubes OS documentation and here: [Usefull github comment](https://github.com/QubesOS/qubes-issues/issues/3585#issuecomment-453200971).
However, few tips:
- Do a backup (clone VM) of the Windows HVM BEFORE starting to install QWT
- The Windows user MUST BE "user"
- Windows 7 Only, do not use Windows 10 or others.
## Hardware
To have a Windows HVM for gaming, you must have:
- A dedicated AMD GPU. By dedicated, it means: it is a secondary GPU, not the GPU used to display dom0. Nvidia GPU are not supported (or maybe with a lot of trick).
- A really fast disk (M.2 disk)
- A lot of RAM
- A dedicated screen
In my case, I use:
- Secondary GPU: AMD RX580
- Primary GPU: Some Nvidia trash, used for dom0
- 32Go of RAM. 16Go of RAM will be dedicated for the Windows HVM
- A fast M.2 disk
## Checklist
Short list of things to do to make the GPU passthrough work:
- In dom0, you edited the file /etc/default/grub to allow PCI hidding for your secondary GPU, and regenerated the grub
- You patched your stubdom-linux-rootfs.gz to allow to have more than 3Go of RAMfor your Windows HVM
## GRUB modification
You must hide your secondary GPU from dom0.
To do that, you have to edit the GRUB.
In a dom0 Terminal, type:
```bash
qvm-pci
```
Then find the devices id for your secondary gpu.
In my case, it is "dom0:0a_00.0" and "dom0:0a_00.1".
Follow the instructions here: [https://github.com/QubesOS/qubes-issues/issues/4321#issuecomment-423011787](https://github.com/QubesOS/qubes-issues/issues/4321#issuecomment-423011787)
Copy-paste of the comment:
```
This is caused by the default TOLUD (Top of Low Usable DRAM) of 3.75G provided by qemu not being large enough to accommodate the larger BARs that a graphics card typically has.
The code to pass a custom max-ram-below-4g value to the qemu commandline does exist in the libxl_dm.c file of xen, but there is no functionality in libvirt to addthis parameter.
It is possible to manually add this parameter to the qemu commandline by doing the following in a dom0 terminal: