Jump to content
13 posts in this topic

Recommended Posts

I've been working with GPU passthrough and QEMU/KVM for quite a number of years now, however only just getting around to making a macOS VM.

So far it works pretty well, though there is still optimisation left to do. I haven't build a Hackintosh for a long time and unsure of what I can do.

 

My main issue is that I am unable to get DRM working and the VDA Decoder check fails.

I have passed through an AMD FirePro W7000 which works well and has Quartz & Metal support.

Passing through GPU HDMI/DP audio results in a black screen with no input after initial boot if its on the same PCIe root port as the main GPU - not sure what causes this but its minor for now.

Strange as it fully works under a Windows 10 VM.

QEMU-macOS_12.6-Hackintool_VDA_Decoder_Failed.thumb.png.8edafa43bef650b2df175cc18f96a8c9.png

 

I am also unsure of how to get the CPU to properly be displayed in the macOS About menu, it does get detected properly in System Information.

QEMU-macOS_12.6-About_Wrong_CPU.png.feb9ef49f25327b4a28d561171366e24.png

 

I have attached my system information, ioreg and OpenCore EFI folder.

Any help fixing and optimising my install would be appreciated :)

QEMU-macOS_12.6.ioreg QEMU-macOS_12.6.sysinfo.spxQEMU-macOS_12.6-EFI.zip

Edited by Hamish Claxton

I should mention that I was able to get the 'hda-duplex' QEMU audio codec working with VoodooHDA v3.0.1, but am now figuring out how to add support for it to AppleALC.kext.

Edited by Hamish Claxton

I am using IORegistryExplorer v3.0.2.

 

Thanks for the EFI. I had to disable AppleALC though due to QEMU Audio only working with VoodooHDA at the moment.

It did fix the macOS About page CPU unknown issue :D May I know how you came up with the ProcessorType value?

 

VDA Decoder & DRM are still broken for me unfortunately.

 

I hadn't passed through the onboard audio as I currently use it on my host. Run both Windows and macOS VMs ontop of my usual Arch Linux desktop environment.

Great for cross-platform development!

 

System Specs:
    CPU: Intel Core i5 6c/12t 10500
    RAM: 32 GB
    MB: ASUS PRIME H470-Plus

    PSU: Corsair 450W SFX 80+ Platinum

 

    GPU Host (Linux): Intel UHD Graphics 630
    Guest GPU 1 (macOS): AMD FirePro W7000 4GB

    Guest GPU 2 (Windows): NVIDIA Quadro K2000 2GB

 

Probably need to add another 32 GB of RAM at some point since running a bit low, hence why macOS only has 4 GB.

Edited by Hamish Claxton
  • Like 1
21 minutes ago, Slice said:

This is because of different IORegistryExplorer version. 2.0 or 3.0.

 

Ahhh!!, I understand, I use this:

 

https://github.com/vulgo/IORegistryExplorer

 

 

2 minutes ago, Hamish Claxton said:

I am using IORegistryExplorer v3.0.2.

 

Thanks for the EFI. I had to disable AppleALC though due to QEMU Audio only working with VoodooHDA at the moment.

It did fix the macOS About page CPU unknown issue :D May I know how you came up with the ProcessorType value?

 

VDA Decoder & DRM are still broken for me unfortunately.

 

You probably need an SSDT-GFX... I use this for my hackinabox with RX6xxx, otherwise I don't have audio via HDMI/DP... but I do have DRM even though I don't use it... it's adapted to my computer, you can modify it for it yours looking at ioreg and see if it works for you

 

SSDT-GFX.aml

 

I pass the audio directly from the integrated on board to the VM just like the GPU, and it works with AppleALC 🤷‍♂️

 

  • Thanks 1
52 minutes ago, PoMpIs said:

You probably need an SSDT-GFX... I use this for my hackinabox with RX6xxx, otherwise I don't have audio via HDMI/DP... but I do have DRM even though I don't use it... it's adapted to my computer, you can modify it for it yours looking at ioreg and see if it works for you

How do you go about making SSDT-GFX may I ask? I tried using yours but it made no difference.

  • Like 1
21 minutes ago, Hamish Claxton said:

How do you go about making SSDT-GFX may I ask? I tried using yours but it made no difference.

 

Try this EFI... and see if the audio is activated by HDMI/DP 

 

EFI.zip

 

If it doesn't work I don't know how to do it with that GPU..

 

In my case, virtualizing with the intel 12400F in UNRAID, I need the SSDT-GFX for the HDMI/DP audio to work, but the DRM works without it... in a ryzen 5900x, everything works without using the SSDT-GFX .... but I only use AMD RX6xxx GPUs

 

I can't help you with the QEMU-audio issue, I don't know how it works, for MacOS I use the board's audio ( ALC1220 ) and for the other VMs I use USB cards that even MacOS recognizes natively

 

https://es.creative.com/p/sound-blaster/sound-blaster-play-3

  • Thanks 1
27 minutes ago, PoMpIs said:

 

Try this EFI... and see if the audio is activated by HDMI/DP 

 

EFI.zip 1.51 MB · 1 download

 

If it doesn't work I don't know how to do it with that GPU..

 

In my case, virtualizing with the intel 12400F in UNRAID, I need the SSDT-GFX for the HDMI/DP audio to work, but the DRM works without it... in a ryzen 5900x, everything works without using the SSDT-GFX .... but I only use AMD RX6xxx GPUs

 

I can't help you with the QEMU-audio issue, I don't know how it works, for MacOS I use the board's audio ( ALC1220 ) and for the other VMs I use USB cards that even MacOS recognizes natively

 

https://es.creative.com/p/sound-blaster/sound-blaster-play-3

 

Unfortunately that didn't work 😕. Thanks for giving it a go though. It may have worked, but the problem is, when I pass through the GPU audio device with vfio alongside the main device, it results in a black screen with no input after the verbose when loading macOS.

I think it may be time to upgrade the GPU as I noticed Ventura removed support for GCN 1.0 and when I did a test the desktop environment was super laggy due to no Quartz Extreme & Metal support.

 

Do you know if the AMD RX6xxx have the AMD reset bug? Would love to avoid it if I can.

 

Regarding audio, no worries. Happy using VoodooHDA till I figure out how to get AppleALC working.

I use my onboard audio anyhow for audio to my monitor so can't pass that through. Did consider using a USB sound card, but I really need the audio to be on the one system as I need to hear sound from both Linux and my Windows VM ontop of macOS.

 

Is there a way to disable sleep on macOS as it doesn't work in the VM anyhow? I'd rather macOS not try to go to sleep, and have the Sleep item in the Apple menu disabled. Sleeping the monitor is okay though.

Also regarding Wi-Fi/BT, is there no way to disable them as well? I don't have a Wi-Fi/BT card to pass though and I keep getting an enable Bluetooth popup every now and then which is a little annoying.

 

 

  • Sad 1

@Hamish Claxton  

 

What do you use to virtualize? Unraid, Proxmox??

 

In unraid with the RX6xxx I don't suffer from the amd reset bug, it only happens in MacOS ventura updates... but when I want to update or do it via VNC and as soon as the update is finished I start normally with the GPU passed to the virtual machine.... 😄

 

In unraid I need to modify the XML manually, so that the GPU works well..

 

This would be the code of the GPU as put by unraid when adding the GPU:

 

<hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
      </source>
      <alias name='hostdev1'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x03' slot='0x00' function='0x1'/>
      </source>
      <alias name='hostdev2'/>
      <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x03' slot='0x00' function='0x2'/>
      </source>
      <alias name='hostdev3'/>
      <address type='pci' domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x03' slot='0x00' function='0x3'/>
      </source>
      <alias name='hostdev4'/>
      <address type='pci' domain='0x0000' bus='0x0a' slot='0x00' function='0x1'/>
    </hostdev>

 

And this is how I leave it so that the RX6800xt works with HDMI audio, and even the USB port, in which have hot plug of any USB device

 

<hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
      </source>
      <alias name='hostdev1'/>
      <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0' multifunction='on'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x03' slot='0x00' function='0x1'/>
      </source>
      <alias name='hostdev2'/>
      <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x1'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x03' slot='0x00' function='0x2'/>
      </source>
      <alias name='hostdev3'/>
      <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x2'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x03' slot='0x00' function='0x3'/>
      </source>
      <alias name='hostdev4'/>
      <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x3'/>
    </hostdev>

 

 

You can remove sleep mode without problems... I haven't used monterey for a long time, I only have Ventura and it's not the same, but you must have an option that says "prevent the Mac from going to sleep when the screen turns off" you activate it and that's it won't go to sleep...

In ventura I have it on screens/advanced

 

1536263794_Capturadepantalla2022-09-14alas13_59_18.png.1c50a79c5a8f6b685658026249a9d866.png

 

PS: Can you put a capture of the IOMMU groups?

 

Edited by PoMpIs

@PoMpIs

I don't use any virtualisation specific OS or even libvirt. Instead I run QEMU/KVM directly using my own patches if needed. My development distro of choice is Arch Linux, and I use this for daily workstation as well. 

GPU works 100% fine under a Windows 10 VM. My monitor is an AOC AG493UCX2 49" 5120x1440, which is handy as I can do PBP to display Linux + macOS/Windows at the same time.

 

Here are my IOMMU groups:

IOMMU Group 0:
        00:00.0 Host bridge [0600]: Intel Corporation Comet Lake-S 6c Host Bridge/DRAM Controller [8086:9b53] (rev 03)
IOMMU Group 1:
        00:01.0 PCI bridge [0604]: Intel Corporation 6th-10th Gen Core Processor PCIe Controller (x16) [8086:1901] (rev 03)
        01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Pitcairn XT GL [FirePro W7000] [1002:6808]
        01:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Oland/Hainan/Cape Verde/Pitcairn HDMI Audio [Radeon HD 7000 Series] [1002:aab0]
IOMMU Group 2:
        00:02.0 VGA compatible controller [0300]: Intel Corporation CometLake-S GT2 [UHD Graphics 630] [8086:9bc8] (rev 03)
IOMMU Group 3:
        00:14.0 USB controller [0c03]: Intel Corporation Comet Lake USB 3.1 xHCI Host Controller [8086:06ed]
        00:14.2 RAM memory [0500]: Intel Corporation Comet Lake PCH Shared SRAM [8086:06ef]
IOMMU Group 4:
        00:15.0 Serial bus controller [0c80]: Intel Corporation Comet Lake PCH Serial IO I2C Controller #0 [8086:06e8]
        00:15.1 Serial bus controller [0c80]: Intel Corporation Comet Lake PCH Serial IO I2C Controller #1 [8086:06e9]
IOMMU Group 5:
        00:16.0 Communication controller [0780]: Intel Corporation Comet Lake HECI Controller [8086:06e0]
IOMMU Group 6:
        00:17.0 SATA controller [0106]: Intel Corporation Comet Lake SATA AHCI Controller [8086:06d2]
IOMMU Group 7:
        00:1b.0 PCI bridge [0604]: Intel Corporation Comet Lake PCI Express Root Port #21 [8086:06ac] (rev f0)
IOMMU Group 8:
        00:1c.0 PCI bridge [0604]: Intel Corporation Device [8086:06bc] (rev f0)
IOMMU Group 9:
        00:1d.0 PCI bridge [0604]: Intel Corporation Comet Lake PCI Express Root Port #9 [8086:06b0] (rev f0)
IOMMU Group 10:
        00:1d.2 PCI bridge [0604]: Intel Corporation Device [8086:06b2] (rev f0)
IOMMU Group 11:
        00:1d.3 PCI bridge [0604]: Intel Corporation Device [8086:06b3] (rev f0)
IOMMU Group 12:
        00:1f.0 ISA bridge [0601]: Intel Corporation H470 Chipset LPC/eSPI Controller [8086:0684]
        00:1f.3 Audio device [0403]: Intel Corporation Comet Lake PCH cAVS [8086:06c8]
        00:1f.4 SMBus [0c05]: Intel Corporation Comet Lake PCH SMBus Controller [8086:06a3]
        00:1f.5 Serial bus controller [0c80]: Intel Corporation Comet Lake PCH SPI Controller [8086:06a4]
IOMMU Group 13:
        02:00.0 Non-Volatile memory controller [0108]: Phison Electronics Corporation E12 NVMe Controller [1987:5012] (rev 01)
IOMMU Group 14:
        03:00.0 VGA compatible controller [0300]: NVIDIA Corporation GK107GL [Quadro K2000] [10de:0ffe] (rev a1)
        03:00.1 Audio device [0403]: NVIDIA Corporation GK107 HDMI Audio Controller [10de:0e1b] (rev a1)
IOMMU Group 15:
        05:00.0 USB controller [0c03]: Fresco Logic FL1100 USB 3.0 Host Controller [1b73:1100] (rev 10)
IOMMU Group 16:
        06:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 15)

And script output which calls QEMU:

qemu-system-x86_64 \ 
	-name macOS \ 
	-machine q35,accel=kvm,kernel_irqchip=on,vmport=off,mem-merge=off,nvdimm=on \ 
	-cpu host,kvm=off,vendor=GenuineIntel \ 
	-smp sockets=1,cores=4,threads=1 \ 
	-vcpu vcpunum=0,affinity=4 \ 
	-vcpu vcpunum=1,affinity=5 \ 
	-vcpu vcpunum=2,affinity=10 \ 
	-vcpu vcpunum=3,affinity=11 \ 
	-drive file=/macOS-QEMU/EFI-Firmware/Orilla-VM_CODE.fd,if=pflash,format=raw,unit=0,readonly=on \ 
	-drive file=/macOS-QEMU/EFI-Firmware/Orilla-VM_VARS_macOS.fd,if=pflash,format=raw,unit=1 \ 
	-smbios type=0,vendor='American Megatrends Inc.',version="0806",date="05/08/2020",release="20200805000000.000000+000",uefi="on" \ 
	-smbios type=1,manufacturer="ASUS",product="ASUS PRIME H470-PLUS",version="Rev 1.xx",serial="",uuid="",sku="SKU",family="Default string" \ 
	-smbios type=2,manufacturer="ASUSTeK COMPUTER INC.",product="PRIME H470-PLUS",version="Rev 1.xx",serial="" \ 
	-smbios type=3,manufacturer="ASUSTeK COMPUTER INC.",serial="" \ 
	-smbios type=4,manufacturer="Intel(R) Corporation",version="Intel(R) Core(TM) i5-10500 CPU @ 3.10GHz" \ 
	-device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" \ 
	-m size=4G,slots=2,maxmem=32G \ 
	-mem-path /dev/hugepages/macOS \ 
	-mem-prealloc \ 
	-overcommit mem-lock=off \ 
	-nodefaults \ 
	-display none \ 
	-enable-kvm \ 
	-msg timestamp=on \ 
	-rtc base=localtime,clock=host,driftfix=none \ 
	-boot menu=off,strict=on \ 
	-global kvm-pit.lost_tick_policy=discard \ 
	-global ICH9-LPC.disable_s3=1 \ 
	-global ICH9-LPC.disable_s4=0 \ 
	-global ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off \ 
	-audiodev driver=pa,server=/run/user/1000/pulse/native,in.stream-name="macOS Input",out.stream-name="macOS Output",out.mixing-engine=off,timer-period=2500,in.buffer-length=10000,out.buffer-length=10000,id=pulse \ 
	-device pcie-root-port,chassis=1,x-speed=16,x-width=16,hotplug=off,bus=pcie.0,addr=01.0,id=pcie-root-port-1 \ # FirePro W7000 Root Port
	-device vfio-pci-nohotplug,host=01:00.0,bus=pcie-root-port-1,addr=00.0,multifunction=on,x-pci-vendor-id=0x1002,x-pci-device-id=0x6808,x-pci-sub-device-id=0x1002,x-pci-sub-vendor-id=0x030c,id=host-device-0 \ # FirePro W7000 GPU
	-device vfio-pci-nohotplug,host=01:00.1,bus=pcie-root-port-1,addr=00.1,x-pci-vendor-id=0x1002,x-pci-device-id=0xaab0,x-pci-sub-device-id=0x1002,x-pci-sub-vendor-id=0xaab0,id=host-device-1 \ # FirePro W7000 Audio
	-device pcie-root-port,chassis=3,x-speed=16,x-width=16,hotplug=off,bus=pcie.0,addr=03.0,id=pcie-root-port-3 \ 
	-device virtio-blk-pci,drive=virtio-scsi-disk-0,bus=pcie-root-port-3,addr=00.0,bootindex=1,id=virtio-pci-scsi-0 \ 
	-drive file=/macOS-QEMU/OpenCore2.img,format=raw,if=none,cache=none,aio=native,id=virtio-scsi-disk-0 \ 
	-device virtio-blk-pci,drive=virtio-scsi-disk-1,bus=pcie-root-port-3,addr=0A.0,id=virtio-pci-scsi-1 \ 
	-drive file=/macOS-QEMU/macOS.qcow2,format=qcow2,if=none,cache=none,aio=native,id=virtio-scsi-disk-1 \ 
	-device pcie-root-port,chassis=4,x-speed=16,x-width=16,hotplug=off,bus=pcie.0,addr=04.0,id=pcie-root-port-4 \ 
	-device ich9-ahci,bus=pcie-root-port-4,addr=00.0,id=ich9-ahci-1 \ 
	-drive file=/macOS-QEMU/Install_macOS_Monterey_12.6.iso,format=raw,if=none,media=cdrom,readonly=on,id=sata-cd-0 \ 
	-device ide-cd,bus=ich9-ahci-1.0,drive=sata-cd-0 \ 
	-device pcie-root-port,chassis=5,x-speed=16,x-width=16,hotplug=off,bus=pcie.0,addr=05.0,id=pcie-root-port-5 \ 
	-device qemu-xhci,bus=pcie-root-port-5,addr=00.0,id=usb-xhci-0 \ 
	-device pcie-root-port,chassis=8,x-speed=16,x-width=16,hotplug=off,bus=pcie.0,addr=08.0,id=pcie-root-port-8 \ 
	-device ich9-intel-hda,bus=pcie-root-port-8,addr=00.0,id=ich9-intel-hda-0 \ 
	-device hda-duplex,bus=ich9-intel-hda-0.0,cad=0,audiodev=pulse \ 
	-device pcie-root-port,chassis=9,x-speed=16,x-width=16,hotplug=off,bus=pcie.0,addr=09.0,id=pcie-root-port-9 \ 
	-netdev user,id=host-network-0 \ 
	-device virtio-net-pci,netdev=host-network-0,mac=d4:5d:64:1a:2c:01,bus=pcie-root-port-9,addr=00.0 \ 
	-device pcie-root-port,chassis=10,x-speed=16,x-width=16,hotplug=off,bus=pcie.0,addr=0A.0,id=pcie-root-port-10 \ 
	-netdev tap,ifname=QVMTap2,script=no,downscript=no,id=host-network-1 \ 
	-device virtio-net-pci,netdev=host-network-1,mac=d4:5d:64:1a:2c:02,bus=pcie-root-port-10,addr=00.0 \ 
	-chardev stdio,mux=on,id=monitor-0 \ 
	-mon chardev=monitor-0 

All works well when I run Windows (slightly different output to that above), but when booting macOS with the FirePro W7000 Audio attached, it black screens and I am unable to get any further information for debugging.

 

Regarding sleep: Is there a way to disable the Sleep item in the main Apple menu top left? Just so I, or anyone else don't click it.

  • Like 1

I managed to get a hold of a friends Radeon RX 580 and swapped the FirePro W7000 out for it.

Booted up perfectly and both GPU and HDMI/DP Audio were detected.

VDA Decoder now Fully Supported and DRM works as expected :D

 

I guess the FirePro W7000 is just a bit too old now for recent macOS versions - especially since support is removed in Ventura.

 

Regarding DisplayPort Audio, I am unable to change the volume through macOS. Is there a way I can get that working? 

I am able to do it on Linux, seems odd that macOS cannot.

 

Is there anything else I can possibly optimise with this virtual machine? Do I need to add in power management support etc?

Another minor cosmetic issue, but how can I show the proper Platform ID and Intel Generation in Hackintool?

Edited by Hamish Claxton
  • Haha 1

@Hamish Claxton 

 

I'm glad everything works when I change the GPU 😄... it was very strange that it didn't work..

 

Regarding the volume control by HDMI/DP, MacOS has no output control... 🤷‍♂️

 

I use Monitor control, it's wonderful, I like it a lot:

 

https://github.com/MonitorControl/MonitorControl

 

Cheers 

  • Like 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...