**Description:**
Adds support for Intels GVT-d feature to passthrough an integrated graphics device to a bhyve-guest.
No dedicated graphic card is neccessary to use this feature. If there is no dedicated graphic card build in, the FreeBSD host runs headless after booting the guest.
//Hints://
The current version is based on FreeBSD-13.0.
This patch is based on other patches and I'm going to split this patch into smaller patches to simplify review. For easier testing, it includes all changes. As soon as some patches are merged, this patch will be rebased.
Depending patches:
- D27970
- D28277
- D28278
- D28280
**Prerequisites:**
- Intel CPU with VT-d
- BIOS option "PM Support" set to Enabled
**How to enable GVT-d:**
Just add your integrUse an updated graphics device to bhyve as any other PCI Passthru deviceOVMF (see below at Installation steps).
Just add your integrated graphics device to bhyve as any other PCI Passthru device.
If you add a GOP driver as ROM file to your GPU, you won't require an OS driver for display output.
```
bhyve -c 2 -m 4G -A -H -S -w \
-s 0,hostbridge \
-s 2,passthru,0/2/0[,rom=<path/to/gop.rom>] \
-s 4,virtio-blk,/root/win/win10.img \
-s 5,virtio-net,tap10 \
-s 31,lpc \
-l com1,stdio \
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFICODE.fd \
win10
```
**Tested Scenarios:**
| **OS** | |
| Windows | Working |
| Debian | Working with "pci=nocrs" as kernel cmdline option |
| Ubuntu 20.04 | Working |
| FreeBSD | Working (13.0-CURRENT - 20200903 snapshot) |
Tested with Windows as a guest:
| **Architecture** | |
| Sandy Bridge | Not Working (Windows reports that the device works properly but there's no correct display output) |
| Ivy Bridge | Working |
| Haswell | Working |
| Kabylake | Working |
| Coffee Lake | Working |
**Installation Ssteps:**
Update your OVMF:
1. Install your VM on the "old" way with GVT-d disabled{F31896163}
For those who don't wanna rebuild OVMF:
2. Boot into your VM with GVT-d enabled and install the graphics driver (not required for Ubuntu 20.04){F31899352}
You have to option to use GPU passthrough:
1. Running a VM with GOP driver
- debian: 1. Add a GOP driver as ROM file to your GPU
- Install i915 driver 2. Enjoy GPU passthrough
- Add "pci=nocrs" option as kernel parameter:2. Running a VM without GOP driver
- add "pci=nocrs" to GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub1. Install your VM on the "old" way with GVT-d disabled
- "sudo update-grub"2. Boot into your VM with GVT-d enabled and install the graphics driver
- Windows:
- Do not use a "fbuf" device in your bhyve cmd. It crashes your VM while installing graphics driver. Use Remote-Desktop instead.
- Install igfx driver (download [[ https://downloadcenter.intel.com/de/product/80939 | here ]])
3. Boot your VM with GVT-d enabled
**Known Limitations:**
- The bhyve-edk2 doesn't contain the Intel GOP driver. Therefore, there is no graphical output while booting. First graphical output is displayed when the Guest-OS driver is loaded 4. This also means that there is no graphical output while installing an Guest-OS.Enjoy GPU passthrough