Jump to content
Idris Gsmalla

How I can Pass through more than 16 cores OSX-VM?

8 posts in this topic Last Reply

Recommended Posts

I have successfully installed Mojave 10.14.6 as VM with Unraid 6.7.2, and successfully passthrough my Vega FE GPU the tricky part that I have dual E5-2690 v4 CPUs with a total of 28 core and 56 Threads.

l already tried with selecting all the threads available but clover bootloader won’t boot I had the same experienced before when I used virtmanger but I used this custom flag and I was able to boot normally:

-smp 56,cores=8 \


?How I can use this custom flag with Unraid xml confg file and excluding two threads for unraid system 

4xc7xy9hrsx21.png

Share this post


Link to post

remove your topology from the xml, then you can go up to 64

Share this post


Link to post
53 minutes ago, 1812 said:

remove your topology from the xml, then you can go up to 64

The problem is not related to the core count as in windows or Linux vm l can easily select the cores l want and passthrough them normally via Unraid web-GUI. 

 

macOS refuses to boot on my machine because if I pass certain numbers of cores through to it.

 

I don’t know if Unraid configuration format doesn’t natively support setting a thread count? 

 

Before as @FoxletFox suggested to me with his macOS-Simple-KVM project due to platform assumptions in XNU, it's better to pass all threads as either single CPUs (_-smp 56,cores=1_) or as dual core pairs (_-smp 56,cores=2_).

But l can’t figure out how to do that in Unraid xml config. 

Share this post


Link to post
14 minutes ago, Idris Gsmalla said:

The problem is not related to the core count as in windows or Linux vm l can easily select the cores l want and passthrough them normally via Unraid web-GUI. 

 

macOS refuses to boot on my machine because if I pass certain numbers of cores through to it.

 

I don’t know if Unraid configuration format doesn’t natively support setting a thread count? 

 

Before as @FoxletFox suggested to me with his macOS-Simple-KVM project due to platform assumptions in XNU, it's better to pass all threads as either single CPUs (_-smp 56,cores=1_) or as dual core pairs (_-smp 56,cores=2_).

But l can’t figure out how to do that in Unraid xml config. 

Ok, don’t listen to me. Seeing how I’ve run OS X on an 80 core 4 processor machine at the max 64 allowed....

 

 The problem is OS X only recognizes certain topologies and won’t boot if its not within those parameters. Soo... yes, it’s a topology issue. Remove topology and you can do 3, 33, whatever. The added bonus is OS X will utilize threads as single cores for greater performance. 

 

For further reading see

 

 

 

or, you know, don’t.

Share this post


Link to post
Posted (edited)
16 minutes ago, 1812 said:

Ok, don’t listen to me. Seeing how I’ve run OS X on an 80 core 4 processor machine at the max 64 allowed....

 

 The problem is OS X only recognizes certain topologies and won’t boot if its not within those parameters. Soo... yes, it’s a topology issue. Remove topology and you can do 3, 33, whatever. The added bonus is OS X will utilize threads as single cores for greater performance. 

 

For further reading see

 

 

 

or, you know, don’t.

Thank you for the clarification, to be honest I kinda noob when it comes to kvm l was using macOS as primarily bare metal hackintosh.

 

if you don’t mind can you share with me your current macOS xml file and your clover EFI folder or .config file so l can try and replicate your setup and to achieve the same performance as you :)

Edited by Idris Gsmalla

Share this post


Link to post

Remove the line with this stuff in it. Just delete it from the xml. 

 

<topology sockets='1' cores='2' threads='2'/>

Share this post


Link to post

I have the same experiences and was never able to solve it. Followed this kind gentlemens advice and even copied his xml but did not work. Its some magical combination of factors that makes it not work/work. Same for sierra/high sierra/mohave. Tried different clovers etc.
Topologies, no topologies , tried for weeks.
Max i got was it booted but then almost every program you run crashes.
Gave up so if you find it let me know. Run all my osx vms with max 32 vcores (16 hyperthreaded) and called it a day.

Share this post


Link to post

here is one currently running 3 cores (only one that is currently off that I can copy clean xml from)

 

<?xml version='1.0' encoding='UTF-8'?>
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  <name>MojaveSSD</name>
  <uuid>7f64a5af-78ee-094d-98h3-154180c3b58d</uuid>
  <metadata>
    <vmtemplate xmlns="unraid" name="Linux" icon="default.png" os="linux"/>
  </metadata>
  <memory unit='KiB'>8388608</memory>
  <currentMemory unit='KiB'>8388608</currentMemory>
  <memoryBacking>
    <nosharepages/>
  </memoryBacking>
  <vcpu placement='static'>3</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='1'/>
    <vcpupin vcpu='1' cpuset='11'/>
    <vcpupin vcpu='2' cpuset='10'/>
  </cputune>
  <os>
    <type arch='x86_64' machine='pc-q35-3.1'>hvm</type>
    <loader readonly='yes' type='pflash'>/usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi.fd</loader>
    <nvram>/etc/libvirt/qemu/nvram/7f64a5af-78ee-094d-98h3-154180c3b58d_VARS-pure-efi.fd</nvram>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
  </features>
  <cpu mode='host-passthrough' check='none'/>
  <clock offset='utc'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='no'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/local/sbin/qemu</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='none' io='native' discard='unmap'/>
      <source file='/mnt/disks/Mojavessd/vdisk.img'/>
      <target dev='hda' bus='sata'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <controller type='scsi' index='0' model='virtio-scsi'>
      <address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x0'/>
    </controller>
    <controller type='scsi' index='1' model='lsilogic'>
      <address type='pci' domain='0x0000' bus='0x0a' slot='0x00' function='0x0'/>
    </controller>
    <controller type='scsi' index='2' model='virtio-scsi'>
      <address type='pci' domain='0x0000' bus='0x0b' slot='0x00' function='0x0'/>
    </controller>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x2'/>
    </controller>
    <controller type='sata' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pcie-root'/>
    <controller type='pci' index='1' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='1' port='0x10'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0' multifunction='on'/>
    </controller>
    <controller type='pci' index='2' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='2' port='0x11'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x1'/>
    </controller>
    <controller type='pci' index='3' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='3' port='0x12'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x2'/>
    </controller>
    <controller type='pci' index='4' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='4' port='0x13'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x3'/>
    </controller>
    <controller type='pci' index='5' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='5' port='0x8'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0' multifunction='on'/>
    </controller>
    <controller type='pci' index='6' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='6' port='0x9'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <controller type='pci' index='7' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='7' port='0xa'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <controller type='pci' index='8' model='dmi-to-pci-bridge'>
      <model name='i82801b11-bridge'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1e' function='0x0'/>
    </controller>
    <controller type='pci' index='9' model='pci-bridge'>
      <model name='pci-bridge'/>
      <target chassisNr='9'/>
      <address type='pci' domain='0x0000' bus='0x08' slot='0x00' function='0x0'/>
    </controller>
    <controller type='pci' index='10' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='10' port='0xb'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x3'/>
    </controller>
    <controller type='pci' index='11' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='11' port='0xc'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x4'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:9d:4f:62'/>
      <source bridge='br0'/>
      <model type='e1000-82545em'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target type='isa-serial' port='0'>
        <model name='isa-serial'/>
      </target>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <channel type='unix'>
      <target type='virtio' name='org.qemu.guest_agent.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='tablet' bus='usb'>
      <address type='usb' bus='0' port='1'/>
    </input>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x05' slot='0x00' function='0x1'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
    </hostdev>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
    </memballoon>
  </devices>
  <qemu:commandline>
    <qemu:arg value='-global'/>
    <qemu:arg value='pcie-root-port.speed=8'/>
    <qemu:arg value='-global'/>
    <qemu:arg value='pcie-root-port.width=16'/>
    <qemu:arg value='-usb'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='usb-mouse,bus=usb-bus.0'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='usb-kbd,bus=usb-bus.0'/>
    <qemu:arg value='-smbios'/>
    <qemu:arg value='type=2'/>
    <qemu:arg value='-cpu'/>
    <qemu:arg value='Penryn,vendor=GenuineIntel,kvm=on,rdtscp,+invtsc,+avx,+aes,+xsave,xsaveopt,vmware-cpuid-freq=on,'/>
    <qemu:arg value='-set'/>
    <qemu:arg value='device.sata0-0-0.rotation_rate=1'/>
  </qemu:commandline>
</domain>

 

 

it has extra lines from the basic xml that space invader provides to 1. enable full speed pcie and 2. enable trim on images that are located on an ssd.

 

if you're having problems with yours, post your xml and I'll look at it.

Share this post


Link to post

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
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.