** Hackintosh ** Tips to make a bare metal MacOS


Leoyzen

Recommended Posts

<hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x0' multifunction='on'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x04' slot='0x00' function='0x1'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x1'/>
    </hostdev>

Try this first. Since its one card this just both on the same bus with separate functions. We do this GPUs when we want to use the GPU audio. 

 

<hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0' multifunction='on'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x04' slot='0x00' function='0x1'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x1'/>
    </hostdev>

This second try will but the device on bus 00 which should make it look like a "internal" device to Mac os but on the 9th slot with different functions. 

Edited by david279
  • Like 1
Link to comment
1 hour ago, derpuma said:

Yeah, that is the reset problem. Hoped the fix would have been compiled into the kernel.

For that reason I use a script via CA User Scripts Plugin. The use avoids me from restarting the whole server.
It simply powers the 5700xt off/on and then you are able to reboot the VM.

 

Be sure not to simply copy the script, enter the individual PCI root for your card.
I use VFIO-PCI Config and it shows me the the PCI address of my card.

 

I am familiar with this procedure. I think thats a specific problem on macOS vm as the problem does not occur on linux or windows vms. 

I am thankful for your idea, but that's just another workaround - which by the way puts the whole system to sleep and requires physical interaction with the server.

Link to comment
55 minutes ago, giganode said:

 

I am familiar with this procedure. I think thats a specific problem on macOS vm as the problem does not occur on linux or windows vms. 

I am thankful for your idea, but that's just another workaround - which by the way puts the whole system to sleep and requires physical interaction with the server.

Hmm, I am not 100% sure but I thought I have to reset the 5700XT also when I shut down my Windows 10 VM and start it again.
As said not 100% sure cause 99% of my work I use mac OS. But I will check this out!

  • Like 1
Link to comment
2 hours ago, david279 said:

The second one is something i never tried before with a mulitfunction on the 00 bus so it maybe a long shot.

David, thx so far. I tried both methods. Unfortunately the card does not show up in mac OS, neither with multifunction='on' nor with both on bus 00 and slot 09 function 0x0 and 0x1...

Could it be another problem? Maybe kext related?

Any other idea?
 

Link to comment
6 minutes ago, derpuma said:

David, thx so far. I tried both methods. Unfortunately the card does not show up in mac OS, neither with multifunction='on' nor with both on bus 00 and slot 09 function 0x0 and 0x1...

Could it be another problem? Maybe kext related?

Any other idea?
 

Download ioregexplorer and see if its loaded in there. If you see it then you could add it thru the DeviceProperties/Add section in opencore.

  • Like 1
Link to comment

This is what ./gfxutil -f ethernet gives me.1703062077_Bildschirmfoto2020-12-07um23_45_31.thumb.png.f124d9e8437695c34ab8ec22c3460a0a.png
So do I have to set 3 DeviceProperties?

One for my en0:

<key>Add</key>
		<dict>
			<key>PciRoot(0x1)/Pci(0x1,0x0)/Pci(0x0,0x0)/Pci(0x1,0x0)</key>
			<dict>
				<key>built-in</key>
				<data>AQ==</data>
			</dict>
		</dict>
		<key>Delete</key>
		<dict/>

And two for the 2x 10Gbe ports on the 10Gb network card?

<key>DeviceProperties</key>
	<dict>
		<key>Add</key>
		<dict>
			<key>PciRoot(0x1)/Pci(0x9,0x0)</key>
			<dict>
				<key>built-in</key>
				<data>AQ==</data>
			</dict>
		</dict>
		<key>Delete</key>
		<dict/>
	</dict>
<key>Add</key>
		<dict>
			<key>PciRoot(0x1)/Pci(0x9,0x1)</key>
			<dict>
				<key>built-in</key>
				<data>AQ==</data>
			</dict>
		</dict>
		<key>Delete</key>
		<dict/>


 

Edited by derpuma
Link to comment
41 minutes ago, derpuma said:

And two for the 2x 10Gbe ports on the 10Gb network card?

Take into account that you don't have to write 2 times the DeviceProperties section. Just add the 2 addresses into the "add" section.

Not sure, but the en0 should be the builtin, maybe you have to readjust something. Maybe resetting network sertings could reorder the en(x) devices, auto setting en0 for the builtin.

Otherwise, after resetting networks just boot with the builtin ethernet only, so that the os can set it to en0. Once it's saved as en0 add the others.

Edited by ghost82
Link to comment
8 minutes ago, derpuma said:

Can you give me a code example please?! 

 <key>DeviceProperties</key>
    <dict>
        <key>Add</key>
        <dict>
            <key>PciRoot(0x1)/Pci(0x9,0x0)</key>
            <dict>
                <key>built-in</key>
                <data>AQ==</data>
            </dict>
            <key>PciRoot(0x1)/Pci(0x9,0x1)</key>
            <dict>
                <key>built-in</key>
                <data>AQ==</data>
            </dict>
        </dict>
        <key>Delete</key>
        <dict/>
    </dict>

Link to comment
52 minutes ago, ghost82 said:

Very interesting, may I ask, for pure information, which patch did you apply to the kernel or from where you downloaded?

I'm currently running 6.9.0-beta35 with the old Navi Reset Patch. You can find it here: https://forum.level1techs.com/t/navi-reset-kernel-patch/147547/47

It's no longer supported, because gnif works on something new. But that new project is in the early stages and cannot supersede the old patch as Navi and Vega cards are not working correctly, atm. I tested it.

As soon as the new vendor-reset - https://github.com/gnif/vendor-reset - does work, we should give it a try. And maybe - or better hopefully - the new fix can deal with macOS vms better than the old patch.

Link to comment
1 hour ago, ghost82 said:

Very interesting, may I ask, for pure information, which patch did you apply to the kernel or from where you downloaded?

I made the implementation to Unraid and @giganode tested it for me because I don't own such a card, if you also want to apply the patch then please write me a PM and I will send you a link and how to apply it.

 

Keep in mind that I implemented this because the vendor patch isn't working properly for now.

  • Like 1
Link to comment
3 minutes ago, ghost82 said:

Thank you very much, I don't own any amd card too, I asked just for curiosity, it seemed strange that it worked for all (?) vms except the mac os one.

ok...

17 hours ago, ghost82 said:

I agree with you, the issue is related to linux/amd/passthrough and not to which vm runs.

But if you haven't got one... then don't deny my statement...

Link to comment
1 minute ago, giganode said:

then don't deny my statement...

I didn't want to offend anyone, this must be clear; since it's a patch applied to linux for vfio it should be independent on which vm is applied. You could have other issues in the config of the bootloader for example, that was all I wanted to say.

Link to comment
9 minutes ago, ghost82 said:

it seemed strange that it worked for all (?) vms except the mac os one.

This doesn't seem strange to me, think of it as a real hackintosh... Even to get it working on bare metal is a little wonder (sometimes, Clover,...)... :D

 

Keep in mind if you start a Windows VM in between the reset patch works again I think... ;)

Link to comment
1 minute ago, ich777 said:

This doesn't seem strange to me, think of it as a real hackintosh... Even to get it working on bare metal is a little wonder (sometimes, Clover,...)... :D

 

Keep in mind if you start a Windows VM in between the reset patch works again I think... ;)

Yes but this doesn't apply to the patch, but as I wrote it's related to wrong configuration of the bootloader (or not working code) which manages the gpu.

Edited by ghost82
Link to comment
Just now, ghost82 said:

Yes but this doesn't apply to the patch, but as I wrote it's related to wrong configuration of the bootloader which manages the gpu.

Why did you know that? Clover was just an example.

 

Did you know how Apple shuts down a system and what it sends to the hardware and what not, I don't.

My guess is that Apple does stop the system differently than a standard system look at the many posts out there about that ACPI is diffent to a standard Windows/Linux machine and that this is the problem that the patch triggers the reset of the card.

  • Like 1
Link to comment

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.