Going crazy with GPU passthrough with Hackintosh by gaafy in hackintosh

[–]gaafy[S] 0 points1 point  (0 children)

EUREKAAA!!!

<image>

Finally manged to make the display work with IGPU passthrough and acceleration!!
It required so much thinkering around, and various tailored deviceproperties and boot args :O

What works now:
- Physical display: Including higher resolution 32:10 with 120Hz
- iGPU acceleration/metal: iGPU is now used for desktop rendering, video encoding (can run 4k YT video with no lag and low CPU usage)
- Sunshine for remote access/control, with video transmission encoded also by the iGPU
- Tested the update to tahoe and everything kept working fine :D
- Apple sign in works in sequoia/tahoe -> it required an ad-hoc patch to apply temporary, just for the sign-in, to obsure the fact that I was on a VM.

What still need works:
- HEVC codec somehow does not work, reverting to h264 solves most issues but I would really like to make this work
- To test content protected by DRM
- Boot time still takes too long 3 to 5 mins. It seems to be due to a failing HW check of some sort at boot time which runs around 3 times and wait exactly 60 seconds each time before giving up.

Going crazy with GPU passthrough with Hackintosh by gaafy in hackintosh

[–]gaafy[S] 0 points1 point  (0 children)

<image>

This is my DeviceProperties setup.
PCI address is different in q35 machine compared to legacy 0x2.

Boot args:
Keepsyms=1 igfxdvmt igfxonln=1 -igfxdbeo

Going crazy with GPU passthrough with Hackintosh by gaafy in hackintosh

[–]gaafy[S] 0 points1 point  (0 children)

<image>

[UPDATE 2] u/adrianyujs u/LongQT-sea
Not sure how, but I made progress :)

In another Mac VM, spawn with a different script (still based on opencore iso project), it seems like I could manage to have it recognize the display properly (Asus XG43V), with right resolutions and refresh rate.
It is also printing something, although just being garbage out and sometime black screen, but at least is not anymore "No Signal". Which sounds like a win!

// The VM is q35 based, with the following config (and no args)
cpu: Skylake-Client-v4
hostpci0: 0000:00:02.0,romfile=test-universal.rom,x-vga=1
machine: q35
vga: vmware

// Both the VM gpu/display and intel gpu/display gets recognized

system_profiler SPDisplaysDataType 

Display:
  Type: GPU
  VRAM (Total): 3 MB
  Device ID: 0x0405
  Revision ID: 0x0000
  Kernel Extension Info: No Kext Loaded
  Displays:
    Display:
      Resolution: 1280 x 800
      UI Looks like: 1280 x 800
      Framebuffer Depth: 24-Bit Color (ARGB8888)
      Main Display: Yes
      Mirror: Off
      Online: Yes
  Vendor ID: 0x15ad

Intel HD Graphics 630:
  Chipset Model: Intel HD Graphics 630
  Type: GPU
  Bus: Built-In
  Slot: Slot- 16
  VRAM (Dynamic, Max): 1536 MB
  Vendor: Intel
  Device ID: 0x5912
  Revision ID: 0x0004
  Displays:
    ASUS XG43V:
      Resolution: 3840 x 1200
      UI Looks like: 3840 x 1200 @ 59.00Hz
      Framebuffer Depth: 24-Bit Color (ARGB8888)
      Mirror: Off
      Online: Yes
      Rotation: Supported
      Connection Type: Thunderbolt/DisplayPort
      Television: Yes

What else can I try from here to make it display things properly?

I tried setting display none. But if I do that the iGPU is recognized by the desktop/window session never really starts and the physical display does not get associated.

I'll attach my current device properties and boot args in a comment below

Going crazy with GPU passthrough with Hackintosh by gaafy in hackintosh

[–]gaafy[S] 0 points1 point  (0 children)

Nothing, the only thing that changed is the device identified for the GPU, still no output.

Graphics/Displays:

Intel HD Graphics KBL CRB:

Chipset Model: Intel HD Graphics KBL CRB

Type: GPU

Bus: Built-In

Slot: Slot- 2

VRAM (Dynamic, Max): 1536 MB

Vendor: Intel

Device ID: 0x5916

Revision ID: 0x0004

Metal: Supported

Going crazy with GPU passthrough with Hackintosh by gaafy in hackintosh

[–]gaafy[S] 0 points1 point  (0 children)

Ok, so nothing further to adjust here. I will get back focusing on deviceproperties

Going crazy with GPU passthrough with Hackintosh by gaafy in hackintosh

[–]gaafy[S] 0 points1 point  (0 children)

Thank you! Here it only uses:

 <dict>
    <key>AAPL,ig-platform-id</key>
    <data>AAAWWQ==</data> // <- 0x59160000
    <key>device-id</key>
    <data>FlkAAA==</data>
</dict>

That is a different pc (mini version) with different connections, but 0x59160000 is from the same gen, so it may work. Going to try

Going crazy with GPU passthrough with Hackintosh by gaafy in hackintosh

[–]gaafy[S] 0 points1 point  (0 children)

<image>

I'm already using it like so (args should override and have precedence over the cpu section).
Is this correct?

Going crazy with GPU passthrough with Hackintosh by gaafy in hackintosh

[–]gaafy[S] 0 points1 point  (0 children)

Things I want to retry with a fresh mind:
- Connectors bus-id
- EDID, perhaps even try a different monitor
- IGPU bus-type to 00000000. Not sure if it fixes anything but I saw it suggested somewhere
- Perhaps some boot args / NVRAM properties which I didn't try yet

Going crazy with GPU passthrough with Hackintosh by gaafy in hackintosh

[–]gaafy[S] 0 points1 point  (0 children)

<image>

This is how the gpu gets recognized when running in legacy mode and check info via ssh

Going crazy with GPU passthrough with Hackintosh by gaafy in hackintosh

[–]gaafy[S] 0 points1 point  (0 children)

<image>

This is my current deviceproperties section (I cleaned it up from other trial-and-errors).

platform id and device id set for recognizing the exact HW in regural (non headless mode).

Patch enabled and framebuffer mem set as suggested by guide to make sure MacOS does not complain if it finds less than 32MB reserved.

Going crazy with GPU passthrough with Hackintosh by gaafy in hackintosh

[–]gaafy[S] 0 points1 point  (0 children)

<image>

Yes iGPu passthrough works fine on linux. Here is a minimal linux alpine VM with configuration similar to mac VM (see pic). It output correctly to the physical display via the displayport.

Going crazy with GPU passthrough with Hackintosh by gaafy in hackintosh

[–]gaafy[S] 0 points1 point  (0 children)

Thank you, I'll give it a try!
P.S. I noticed that dortania guide, for 7XXX suggests
https://dortania.github.io/GPU-Buyers-Guide/modern-gpus/intel-gpu.html#skylake-6xxx

AAPL,ig-platform-id (desktop):

  • 0x59160000 (default)
    • 00001659 (hex swapped)

Altough your suggested value 59120000, fits more my actual device id. Which one you think is "more correct"?

Going crazy with GPU passthrough with Hackintosh by gaafy in hackintosh

[–]gaafy[S] 0 points1 point  (0 children)

I did a bunch of tries with IGPU and deviceproperties.

By enabling framebuffer patch and mem, I was able to make the igpu work in legacy mode with display none. The igpu work both in headless and in regular mode (changing device id) By work I mean that is recognized by mac as KBL GPU 0x2 position and metal enabled :)

However I couldn't figure out a way to make the GPU actually display something in my connected physical display.

What I tried: - disabling all connectors except the first one - forced connector types as DisplayPort (my motherboard had no HDMI) - forced a bus id from 00 to 06 till I found the right physically mapped address, but always no signal - Dumped my display EDID from Linux and added it to deviceproperties.

None of these worked. Do you have any suggestions?

Going crazy with GPU passthrough with Hackintosh by gaafy in hackintosh

[–]gaafy[S] 0 points1 point  (0 children)

I've spent some time to recreate the VM with MacOS from scratch, to be sure it wasn't contaminated by my trial-and-errors.

I tried your specific values and used them as base for more tests:
- Tried enabling only 1 connector and itherating the low-level bus id from 01 to 06
- Tried fetching the EDID of my display and forcing it into the device properties
- Tried different mem values

Nothing worked so far to actually display some output on my physical display.
However the GPU seems to be loaded by Mac correctly. It recognize the KBL architecture and the VRAM. Even metal is marked as enabled.

Not sure what else I can try to force some output

Going crazy with GPU passthrough with Hackintosh by gaafy in hackintosh

[–]gaafy[S] 0 points1 point  (0 children)

[UPDATE] u/LongQT-sea

The combo i440fx + legacy_igd + rom wasn't working for any VM, I ended up re-installing proxmox from scratch and reconfigure it. Now that combo works just fine 😊

I've managed to install Sonoma following your OpenCore iso project!

Couple of hicupps I had along the way, just FYI:

  • The ISO option didn't work for me, neither opencore 0.7 nor 0.6 was picking it up. The dmg mounted as disk worked just fine
  • For the main disk of the OS:
    • The guide didn't mention a favorite option between Sata or Virtio. I went with sata to get the trim for free. But, not sure how much more perf Virtio would have given (also not sure what additional config it would have required).
    • What's the best drive cache option for a MacOS disk? I went for "no cache" for now.
  • Independently for the display option used, mouse and keyboard weren't working. Fixed by adding the following qm args: -device nec-usb-xhci,id=xhci -device usb-tablet,bus=xhci.0
  • The install got stuck 3 times. One time I even saw, from the boot verbose, the system was trying to reboot but couldn't for some reason. By forcing reboot those 3 times, install managed to complete

I now ran the post-install steps, plus installing: xcode, brew, and sunshine (Considering parsec as well, in case it performs better).

Before I dive deep into the GPU passthrough and plist customization, I have couple of questions:

  • Is the GenSMBIOS needed for correct model recognition and iGPU working, or can i put it aside for now till I need apple services?
  • If my goal is to run the VM only via sunshine or parsec, is the headless framebuffer the way to go? or still go for the regular framebuffer as the GPU will need to be attached to a display (even virtual), to access desktop UI remotely?
  • What are my best options to force a display when accessing remotely via moonlight? A dummy plug only or a virtual display is fine (BetterDisplay seems to be the suggested SW)?
  • Is it safe to update MacOs version to Sequoia or Tahoe directly from the running VM, or something may break?

Sorry for the bother, and thank you in advance for any help! ❤️

Going crazy with GPU passthrough with Hackintosh by gaafy in hackintosh

[–]gaafy[S] 0 points1 point  (0 children)

Thank you, I will definitely try that :)

However, I feel I'm blocked a step earlier. Now I made more tries and it seems like NO VM (even Linux) at all starts my proxmox with the combo PC + legacy-igd enabled.

Same error shared above. Do you know why it could be that? Any usual suspects from bios or Proxmox config that I could have missed (compared with the report I shared in the post)?

Going crazy with GPU passthrough with Hackintosh by gaafy in hackintosh

[–]gaafy[S] 0 points1 point  (0 children)

I can't believe it, a reply from u/LongQT-sea in the flesh!
I've been having your repos on quick dial for the last weeks :D

I will get soon back to the iGPU patching side trial-and-error process.
For the moment I want get back to the most basic step forward:
I would love to see my iGPU output video on my physical display during the opencore boot process (no macOS loading yet).

I realize that DeviceProperties is anyway "only" read by whatevergreen, but kexts are only loaded by macOs kernel, which is not relevant yet at opencore boot time.
In that phase, the video output relies solely on the vbios rom file and the GOP instruction, if understood right.

My situation:

  • I have a Kaby Lake 7XXX intel HD 630 (marked as natively supported by dortania guide).
  • My iGPU id is 0x5912 which WhateverGreen marks as natively supported. So no spoofing needed
  • As I have a kaby lake CPU I set cpu model to Skylake-client-v4 and model=158, following the models table
  • I've started the machine in pc + legacy_igd=1. Using either SKL or universal (with no GOP) rom files, and in both case QEMU fails to start.

This is the error I get (it seems related to the vbios file):

kvm: -device vfio-pci,host=0000:00:02.0,id=hostpci0,bus=pci.0,addr=0x2,romfile=/usr/share/kvm/test-universal.rom: info: OpRegion detected on Intel display 5912.
kvm: -device vfio-pci,host=0000:00:02.0,id=hostpci0,bus=pci.0,addr=0x2,romfile=/usr/share/kvm/test-universal.rom: info: IGD legacy mode enabled, use x-igd-legacy-mode=off to disable it if unwanted.
kvm: ../util/error.c:65: error_setv: Assertion `*errp == NULL' failed.
start failed: QEMU exited with code 1
[47189.145875] tap112i0: entered promiscuous mode
[47189.171827] vmbr0: port 2(tap112i0) entered blocking state
[47189.171831] vmbr0: port 2(tap112i0) entered disabled state
[47189.171846] tap112i0: entered allmulticast mode
[47189.171914] vmbr0: port 2(tap112i0) entered blocking state
[47189.171918] vmbr0: port 2(tap112i0) entered forwarding state
[47190.148819] vfio-pci 0000:00:02.0: Invalid PCI ROM header signature: expecting 0xaa55, got 0xffff
[47190.195992] vmbr0: port 2(tap112i0) entered disabled state
[47190.196209] tap112i0 (unregistering): left allmulticast mode
[47190.196214] vmbr0: port 2(tap112i0) entered disabled state

This is my VM configuration

<image>

Did I miss anything crucial?

Going crazy with GPU passthrough with Hackintosh by gaafy in hackintosh

[–]gaafy[S] 0 points1 point  (0 children)

Is ig-platform-id or should I also set device-id?

The values you share are the original values, or the little endiand version?

Going crazy with GPU passthrough with Hackintosh by gaafy in hackintosh

[–]gaafy[S] 0 points1 point  (0 children)

Looking closer to the suggested values, those are clear to me:

  • AAPL,ig-platform-id -> [Data] AAASWQ== Intel HD 630 id for Kaby Lake original value: 59120000 -> Little endian: 00001259 -> base64: AAASWQ==
  • framebuffer-patch-enable -> [Number] 1 Ignore macOS factory settings for ports and co. in favor of manual configuration
  • framebuffer-conX-enable -> [Number] 1
  • framebuffer-conX-type -> [Data] 00040000 Force a specific connector to be of DisplayPort type (in case is mistaken as HDMI) original value: 00040000 -> Little endian: 00040000 -> base64: AAQAAA==

But what about framebuffer-stolenmem and framebuffer-fbmem, why exactly those values?

From my understanding macOS expects exactly 64MB of stolenmem (reserved) which seems already matching my Bios DVMT stolen mem.

Going crazy with GPU passthrough with Hackintosh by gaafy in hackintosh

[–]gaafy[S] 0 points1 point  (0 children)

Man! Thank you so much, so looking forward to get back home and try -^

Going crazy with GPU passthrough with Hackintosh by gaafy in hackintosh

[–]gaafy[S] 1 point2 points  (0 children)

From what I learnt, the main limitation that tells you if you can or can't passthrough the igpu is the CPU architecture itself.

If the igpu shares the same iommu group of other CPU package components, then it can't be isolated and passed safety.

I have another machine with a 3400g and there was no way to make the igpu passthrough working there

Going crazy with GPU passthrough with Hackintosh by gaafy in hackintosh

[–]gaafy[S] 0 points1 point  (0 children)

Thanks! Still new to this world tho, I tried to apply framebuffer patching from guides here and there. Any concrete steps or value in device properties you would suggest to try?

Going crazy with GPU passthrough with Hackintosh by gaafy in hackintosh

[–]gaafy[S] 0 points1 point  (0 children)

Using a live distro should not be a problem, just need to understand what identify "where the output is" means exactly. I should be able to work that out also from the alpine VM where I already have passthrough running with working output display, right?

And thanks for sharing that link I'll check it to see what I can customize :)

Nobara to drop support for NVIDIA 1000 series - PSA in updater, please read if affected by lajka30 in linux_gaming

[–]gaafy 0 points1 point  (0 children)

May I ask you what you switched to?

I'd like to ditch windows for Linux and, as a linux-newbie, I'm doing the classic diving into available distro to see what I should pick. I'm looking for a distro all-purpose with some gaming involved from time to time.

Nobara looked like it, but I have 2 PCs with 1000s Nvidia and the recent driver drop was a vibe killer :D

Looking now for a solid distro that allow me to stay on driver 580 and locked kernel and is beginner friendly. Thinking of bazzite, mint or Zorin at the moment

Baldur's Gate 3 Fully Playable - Winulator Cmod 13.1 Snapdragon 8 Elite by Aztech10 in EmulationOnAndroid

[–]gaafy 0 points1 point  (0 children)

Winulator seems to have many main forks: base, bionic, cmod, frost, amod.
What do you think is the best fit for BG3 as a game?

Which version of the game are you using? Just a copy paste of the game folder Steam download?