Coopydood / ultimate-macOS-KVM

Helping noobs and pros alike build the ultimate macOS virtual machine with easy automation, powered by KVM. Now with macOS Sequoia support!
https://coopydood.github.io/ultimate-macOS-KVM/
GNU General Public License v3.0
424 stars 25 forks source link

[ULTMOS] No boot with resizable BAR on - AMD RX 580 #114

Closed tuxrinku closed 1 week ago

tuxrinku commented 2 months ago

Describe the Issue

My hackintosh with a RX 580 passthrough doesn't boot when resizable bar is enabled in BIOS. Screen gets stuck at the Apple logo. There's no problem at all when it's disabled. I tried to set ResizeAppleGpuBar to 0 in config.plist as mentioned in the OpenCore documentation but it doesn't change anything. I'd like to enable it since my main gpu gets a few extra fps when ReBAR is on.

I'm currently on Sonoma, but I tried with Monterey and issue is the same.

My guess is that since the RX 580 doesn't support ReBAR, the hackintosh machine won't boot when it's enabled. So ideally there would be a way to enable it for my Nvidia card, and disable it for the AMD one.

Any suggestion ?

Reproduce the Issue

Enable Resizable BAR in BIOS and try to boot the vm.

Expectation

No response

Screenshots

No response

Operating System

Ubuntu 24.04

Kernel

6.10

Processor

i5-13600KF

RAM (in GB)

32GB

GPU(s)

Nvidia RTX 4080; AMD RX 580

Version

v0.12.2

Branch

main

Additional Information

No response

Coopydood commented 2 months ago

Hi there,

Believe me I understand the frustration of having to do without ReBAR.

I have 2 GPUs in my system and my BIOS only lets me change it globally. Unfortunately like yourself, VFIO passthrough doesn't work with ReBAR.

Better yet, it was the one thing between me and success for many, MANY sleepless nights when first trying to get it working myself. Little did I realise the only issue was ReBAR being on...

So yeah, tangent aside - I have no idea, sorry :/

tuxrinku commented 2 months ago

Okay I found a workaround. With ReBAR enabled, I have to unload the vfio-pci driver from the gpu and then set the bar size back to 256mb, then the machine boots with no problem and I still have 16gb bar size on my main RTX 4080.

The steps (adapt using your gpu pci address) : 1 - Unbind the vfio-pci driver from your gpu : echo -n "0000:06:00.0" > /sys/bus/pci/drivers/vfio-pci/unbind 2 - Set BAR size on the gpu to 256mb : echo 8 > /sys/bus/pci/devices/0000:06:00.0/resource0_resize 3 - Rebind the vfio-pci driver to your gpu : echo -n "0000:06:00.0" > /sys/bus/pci/drivers/vfio-pci/bind

After that you should be able to start the machine with no problem. I didn't try with different values than 256mb though. Hope it helps, and maybe if it works you can include it in ULTMOS !

Scrounger9726 commented 1 week ago

Okay guys I need some help: I got my GPU (AMD RX 580) passed through to MacOS. But I can't figure out how to get it to be used by MacOS.

Any help with this would be great.

Screenshot From 2024-10-21 07-44-06 Screenshot From 2024-10-21 07-44-12

Coopydood commented 1 week ago

Hi there,

By the looks of the entries, you might still have the "Spice stuff" attached to your VM. Try removing

This can be done in virt manager. You need to do it in that order. Then try again.

It might also go without saying, but make sure you have a physical display connected to the RX 580 itself.

If you need any other help please feel free to join the discord where we will be more than happy to help.

Cheers.

eversiege commented 1 week ago

I will chime in to say, if you can, @Scrounger9726, please create a separate issue (just click new issue at the top of the page, select macOS and follow the instructions) so we don't lose your problems, or as @Coopydood, join the Discord server.

eversiege commented 1 week ago

Closing this issue as solved, pinning it until working documentation