Git Product home page Git Product logo

osx_gvt-d's Introduction

OSX GVT-D

Guide to pass iGPU to MacOS KVM guest.

Prerequisites

  • Working MacOS EFI.

Procedure

1. Fetch necessary files from i915ovmfPkg repo.

2. Configure OpenCore.

  • Replace working OpenCore EFI to OpenCore-Catalina directory.

  • Build it:

    ./opencore-rebuild.sh
  • Place BaseSystem.img and mac_hdd_ng.img to root of this repo.

3. Prepare iGPU for passthrough

  • 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

Notes

  • During iGPU passthrough qemu will write this,
    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
    
    but ignore that warning.
  • 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!!

What is working

  • QE/CI.!!

Known issues & Fixes

  1. Chrome / Electron based applications causes freeze (GPU hang/reset) or crashes the guest.

Credits

osx_gvt-d's People

Contributors

vivekmiyani avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

osx_gvt-d's Issues

Errors when running boot.sh

Hi All, trying to get this to work but having some issues. Does the error below mean anything?

qemu-system-x86_64: -fw_cfg name=etc/igd-opregion,file=./i915ovmf/opregion.bin: warning: externally provided fw_cfg item names should be prefixed with "opt/"
qemu-system-x86_64: -fw_cfg name=etc/igd-bdsm-size,file=./i915ovmf/bdsmSize.bin: warning: externally provided fw_cfg item names should be prefixed with "opt/"
qemu-system-x86_64: -device vfio-pci,host=0000:00:02.0,id=hostdev0,bus=pcie.0,addr=0x2,romfile=./i915ovmf/i915ovmf.rom: vfio 0000:00:02.0: no iommu_group found: No such file or directory
modprobe: FATAL: Module vfio_pci is builtin.
modprobe: FATAL: Module vfio is builtin.

Blank screen on boot

After running ./boot.sh the screen on my laptop turns off, occasionally accompanied by a blinking caps lock indicator (although I was not able to reproduce this reliably). How should I go about collecting logs for this? Redirecting the output to a file doesn't give anything. Also I should mention I'm running a 2nd gen X1 Yoga with i5-3700U and HD620 on Linux 5.10.90 LTS from Arch Linux

Kernel Panic: x86_validate_topology

Booting the macOS installer in GVT-D passthrough (using all of the i915ovmf stuff mentioned in the repo) ends up with this kernel panic:

https://imgur.com/ilcg9U3

Using a manually-compiled version of Qemu (no libvirt or else) on Linux Mint 20.3. My iGPU is an Intel HD Graphics 620, the one within my entry-level i7-7500U CPU. I have a working, dual-booted hackintosh in the same machine, but I wanted to get rid of the dual-boot.

I have tried to write a kernel patch in OpenCore, as described here: https://forums.unraid.net/topic/84430-hackintosh-tips-to-make-a-bare-metal-macos/page/4/. No luck so far.

I will attach my OpenCore EFI folder as well, in case someone could help me with this. Thanks in advance.
OpenCore-gvtd.zip

Preventing gvt-d corruption on electron based programs

Hello, i wanted to report that that issue can be mitigated by setting the qemu priority to Realtime priority and -20 nice (if i understand it correctly its because its priority is higher than most IRQ) this also prevent random memory corruption segfaults for some reason, also by disabling transparent hugepages it also help mitigated the issue.
Screen Shot 2021-06-02 at 09 39 36

Complete noob here. where do I put these files and why can't I find some?

Hello, I am having some trouble. I set up a VM using OSX-KVM, and it works, this is my next step. I cannot find the files opregion.bin, bdsmSize.bin anywhere, and I do not know where to even put the rest of the files. My KVM folder has an OpenCore folder with an EFI folder, is this my working OpenCore? should I put these files in that folder, or put that folder in these files before I do ./opencore-rebuild.sh

I successfully passthrough my IGPU but video memory is still 7mb

Hi, first thanks for your great work, I installed my monterey and the screen shows up and it recognizes my Intel HD Graphics 510 but for some reason it stills saying 7mb of video, what could be the problem? should I teak my config.plist or something?, could you give some light about this?
IMG_20220328_101428481

Issues re: 2. Configure Opencore

When I initially ran the build script,
./opencore-rebuild.sh

I got an error regarding guestfish:

./opencore-image-ng.sh: line 120: guestfish: command not found
ERROR: starting guestfish failed

So I installed (apt-get install) libguestfs-tools
When I tried to re-run the script I got this error:

### partition disk image
# part-init /dev/sda gpt
# part-add /dev/sda p 2048 300000
# part-add /dev/sda p 302048 -2048
# part-set-gpt-type /dev/sda 1 C12A7328-F81F-11D2-BA4B-00A0C93EC93B
# part-set-bootable /dev/sda 1 true
# mkfs vfat /dev/sda1 label:EFI
# mkfs vfat /dev/sda2 label:OpenCoreBoot
libguestfs: error: mkfs: vfat: /dev/sda2: mkfs.vfat: Label can be no longer than 11 characters

For reference I am on proxmox
kernel version: Linux 5.13.19-2-pve #1 SMP PVE 5.13.19-4
PVE manager version: pve-manager/7.1-7/df5740ad

Also, hardware is macmini 6,2 (late 2012) with core i7 3720QM and Intel HD Graphics 4000.

Thanks in advance!

iGPU passthrough in Proxmox 7 - help on the README

Hello there,

I found this repository via Reddit and I was wondering if this configuration would work on my system.

Basically I wanna passthrough a HD 530 to my current macOS Monterey VM via Proxmox, if I do it via GUI it boot loops. What I'm confused about is that you apparently need to patch OpenCore to get it working (I have v15). If I then boot the VM with the patched OpenCore image and the GPU attached, will it work or its use is not intended for that?

I've always seen that iGPU passthrough is difficult and this is the closest thing I've come across to maybe get it working.

Thanks in advance for the help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.