GPU passthrough of physical Mac Mini node to macOS VM

itsthejb

New Member
Jul 26, 2024
24
5
3
Hi everyone,

I recently added a Mac Mini 2018 machine as a node to my cluster. I had a previous macOS VM running on a non-Mac node, and now that I've moved it, I would ideally like to take maximum benefit of passing through its natively supported hardware. However, I haven't been very successful, mostly due to this unusual use case. Posting here in the hope that someone else has done the same and can point me in the right direction.

I have gone through full steps wrt. ensuring kernel support for the T2-based machine. It is, for example, running a T2-compliant kernel from https://github.com/AdityaGarg8/pve-edge-kernel-t2 and I also exported and installed firmwares from the previous macOS bare metal install

As a first step, I'd like to passthrough the GPU, in order to get best-possible performance when working on the machine through VNC. Config:

Code:
agent: 1
args: -device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" -smbios type=2 -device usb-kbd,bus=ehci.0,port=2 -device usb-mouse,bus=ehci.0,port=3 -cpu host,kvm=on,vendor=GenuineIntel,+kvm_pv_unhalt,+kvm_pv_eoi,+hypervisor,+invtsc
autostart: 0
balloon: 0
bios: ovmf
boot: order=virtio0
cores: 4
cpu: host
cpuunits: 100
efidisk0: local-lvm:vm-101-disk-0,size=128K
hostpci0: 0000:00:02,pcie=1,x-vga=1
hotplug: disk,network,usb
machine: q35
memory: 6144
meta: creation-qemu=9.0.2,ctime=1725038254
name: macOS
net0: virtio=BC:24:11:6F:B0:E6,bridge=vmbr0
numa: 1
onboot: 1
ostype: other
scsihw: virtio-scsi-pci
smbios1: uuid=fdeb9a02-59fd-410f-846a-44d75d378272
sockets: 1
startup: order=10
tablet: 1
tags: desktop;macos
vcpus: 4
vga: none
virtio0: local-lvm:vm-101-disk-1,cache=none,discard=on,size=64G
vmgenid: eeb527c2-5f08-414a-aff8-393b4d808163

I've also had various tries to patching OpenCore's config to enable detection of the card. For example:

Code:
<key>DeviceProperties</key>
<dict>
        <key>Add</key>
        <dict>
            <key>PciRoot(0x0)/Pci(0x2,0x0)</key>
            <dict>
                <key>device-id</key>
                <data>kj4AAA==</data>
                <key>AAPL,ig-platform-id</key>
                <data>BwCbPg==</data>
                <key>framebuffer-patch-enable</key>
                <data>AQAAAA==</data>
                <key>framebuffer-stolenmem</key>
                <data>AAAwAQ==</data>
            </dict>
        </dict>
</dict>

... However despite various tries I didn't get close to having the iGPU detected in the macOS VM.

It would also be nice to enable Bluetooth, in the hope that perhaps even Airdrop might be functional (seems a bit ambitious!). However, passing through any of the network adapters removes Ethernet as well.

In any case, this is a general call for help!

Thanks in advance!
 
Why are you running Proxmox on a Mac mini instead of MacOS? You can run mac-on-mac VMs (probably) easier, but not sure about passthru. I say this as someone who is typing from a 2018 Mini running Sonoma 14 btw.

You might have better results with a different desktop sharing software (other than VNC) - try Nomachine NX
 
@Kingneutron yeah I know that this seems like adding unnecessary abstraction; the idea was that I want the extra node not just for running some very trivial macOS things

VNC performance is actually quite good... Hence why I disabled the display for the vm; it's sluggish otherwise. I'm just trying to maximise the use of what I've got.
 
  • Like
Reactions: Kingneutron
Hi everyone,

I recently added a Mac Mini 2018 machine as a node to my cluster. I had a previous macOS VM running on a non-Mac node, and now that I've moved it, I would ideally like to take maximum benefit of passing through its natively supported hardware. However, I haven't been very successful, mostly due to this unusual use case. Posting here in the hope that someone else has done the same and can point me in the right direction.

I have gone through full steps wrt. ensuring kernel support for the T2-based machine. It is, for example, running a T2-compliant kernel from https://github.com/AdityaGarg8/pve-edge-kernel-t2 and I also exported and installed firmwares from the previous macOS bare metal install

As a first step, I'd like to passthrough the GPU, in order to get best-possible performance when working on the machine through VNC. Config:

Code:
agent: 1
args: -device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" -smbios type=2 -device usb-kbd,bus=ehci.0,port=2 -device usb-mouse,bus=ehci.0,port=3 -cpu host,kvm=on,vendor=GenuineIntel,+kvm_pv_unhalt,+kvm_pv_eoi,+hypervisor,+invtsc
autostart: 0
balloon: 0
bios: ovmf
boot: order=virtio0
cores: 4
cpu: host
cpuunits: 100
efidisk0: local-lvm:vm-101-disk-0,size=128K
hostpci0: 0000:00:02,pcie=1,x-vga=1
hotplug: disk,network,usb
machine: q35
memory: 6144
meta: creation-qemu=9.0.2,ctime=1725038254
name: macOS
net0: virtio=BC:24:11:6F:B0:E6,bridge=vmbr0
numa: 1
onboot: 1
ostype: other
scsihw: virtio-scsi-pci
smbios1: uuid=fdeb9a02-59fd-410f-846a-44d75d378272
sockets: 1
startup: order=10
tablet: 1
tags: desktop;macos
vcpus: 4
vga: none
virtio0: local-lvm:vm-101-disk-1,cache=none,discard=on,size=64G
vmgenid: eeb527c2-5f08-414a-aff8-393b4d808163

I've also had various tries to patching OpenCore's config to enable detection of the card. For example:

Code:
<key>DeviceProperties</key>
<dict>
        <key>Add</key>
        <dict>
            <key>PciRoot(0x0)/Pci(0x2,0x0)</key>
            <dict>
                <key>device-id</key>
                <data>kj4AAA==</data>
                <key>AAPL,ig-platform-id</key>
                <data>BwCbPg==</data>
                <key>framebuffer-patch-enable</key>
                <data>AQAAAA==</data>
                <key>framebuffer-stolenmem</key>
                <data>AAAwAQ==</data>
            </dict>
        </dict>
</dict>

... However despite various tries I didn't get close to having the iGPU detected in the macOS VM.

It would also be nice to enable Bluetooth, in the hope that perhaps even Airdrop might be functional (seems a bit ambitious!). However, passing through any of the network adapters removes Ethernet as well.

In any case, this is a general call for help!

Thanks in advance!
Any luck with this?
 
@mikeyo Actually yes.

Follow the steps here: https://www.perplexity.ai/search/does-the-mac-mini-2018-model-8-ZlDkEpefREuWkWZ8j76RtA#1

What went correctly this time:
  • I may have had i915 in both the module blacklist and module load list. This may mean it was still loaded
  • I had the vfio-pci 0000:00:02.0: Invalid PCI ROM header signature: expecting 0xaa55, got 0xffff error, which I had before. The answer shows that it can just be ignored with rombar=0
  • Of course disable the PVE display for the VM
And it works! The device is reported as Intel HD Graphics CFL CRB, which isn't what I expected. However it reports support for Metal 3, and that is working (metal processes are running).

However, I'm mostly not using it in my case, since it's not _that_ necessary. However it's nice to know that I can have it working now whenever I want

Now what I'd still like to get working is passing through the wireless adapter, particularly for Bluetooth. Still not been successful there
 
Last edited:
  • Like
Reactions: mikeyo