Guide to pass iGPU to MacOS KVM guest.
- Working MacOS EFI.
1. Fetch necessary files from i915ovmfPkg repo.
- Use precompiled
i915ovmf.rom
from releases OR build yourself. - Some system needs FwCFG, see: https://github.com/patmagauran/i915ovmfPkg/wiki/Qemu-FwCFG-Workaround.
- Place all this 3 files (i.e.
i915ovmf.rom
,opregion.bin
,bdsmSize.bin
) ini915ovmf
directory of this repo. - Note: eDP works out of the box, May also support HDMI. Try your luck.!!
-
Replace working OpenCore EFI to
OpenCore-Catalina
directory. -
Build it:
./opencore-rebuild.sh
-
Place
BaseSystem.img
andmac_hdd_ng.img
to root of this repo.
-
Grab PCI ID:
lspci -D -nn
-
Find your iGPU PCI ID and place it inside
boot.sh
. -
Boot it:
# This script will unbind iGPU from the host and make it ready for passthrough. # After that it will run `opencore-boot-pt.sh` which is runs `qemu` command to boot OSX. # On shutdown it will rebind the iGPU to the host. # TIP: Running this on ssh session will helps us a lot to debug the issue. sudo ./boot.sh
- During iGPU passthrough qemu will write this,
but ignore that warning.
qemu-system-x86_64: -device vfio-pci,host=0000:00:02.0,id=hostdev0,bus=pcie.0,addr=0x2,romfile=i915ovmf.rom: IGD device 0000:00:02.0 cannot support legacy mode due to existing devices at address 1f.0
- We just need to make sure that iGPU placed by Qemu should match the location defined in
config.plist
, If this thing is correct you will be good to go!!
- QE/CI.!!
- Chrome / Electron based applications causes freeze (GPU hang/reset) or crashes the guest.
- Can be fixed by this guide.
- OVMF Driver: https://github.com/patmagauran/i915ovmfPkg
- OSX-KVM for providing OSX setup and tools: https://github.com/kholia/OSX-KVM
- GVT-D guide: https://github.com/intel/gvt-linux/wiki/GVTd_Setup_Guide