Shamelessly copied from https://forum.proxmox.com/threads/gpu-passthrough-hp-elitedesk-800-35w-g2-core-i5-vpro-6500t.135888/ with some adjustments and reported for posterity/self history.
First make sure all virtualization stuff, includint VT-d are enabled in the BIOS
Install ProxMox, then login into the console as root
vi /etc/default/grub
Change the GRUB_CMDLINE_LINUX_DEFAULT
to the value below
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on iommu=pt textonly vfio_iommu_type1.allow_unsafe_interrupts=1 nofb nomodeset vfio-pci.ids=8086:1912 video=vesafb:off video=efifb:off video=simplefb:off"
Then
update-initramfs -u
update-grub
reboot
After the reboot:
vi /etc/modprobe.d/vfio.conf
Fill it with:
options vfio-pci ids=8086:1912 disable_vga=1
Then
echo 'vfio' >> /etc/modules
echo 'vfio_iommu_type1' >> /etc/modules
echo 'vfio_pci' >> /etc/modules
echo 'vfio_virqfd' >> /etc/modules
echo 'blacklist i915' >> /etc/modprobe.d/blacklist.conf
update-initramfs -u
update-grub
reboot
Finally create a VM:
- Display should be "None" (one of the Serial options probably also works)
- Add PCI Device corresponding to the GPU, in this case
0000:00:02
; pass-through all the functions but do not set it as primary GPU - Optionally (likely) also redirect the USB devices. Either your local USB devices or, as I did, the entire xHCI Controller (from PCI devices).
- Had not great success redirecting the audio, because it's on the same ISA bus as the network adapter and while the VM starts with audio, it starts without networking and breaking ProxMox itself. I just plugged an old USB audio adapter I had around (a Creative X-Fi I bought in around 2008, still works great and finally has a decent use).