Live data from Hacker News

OS X-KVM: Run macOS on QEMU/KVM

github.com

21–30 of 73 posts

Re: OS X-KVM: Run macOS on QEMU/KVM

#22
post #17
post #10

Earlier quoted context omitted.

I believe the most promising route is to not try to do passthrough but to use a "virtual" gpu, aka a paravirtualized device. Thanks to the contributions of an open-source developer*, virtio-gpu has been ported to macOS (it already works on Linux but not on Windows and soon it will be on macOS). Apple is also reportedly working on bringing better support for macOS virtualized environments [2]. It means that users will…

Is there some info on virtio GPU for OSX development somewhere ? I knew virtio support was happening but hadn't seen any info on the GPU bit.

I'm quite sure virtio-gpu for OS X will _never_ happen unless Apple approves of it. 3D drivers are like the most closed things in OS X.

Re: OS X-KVM: Run macOS on QEMU/KVM

#23
post #10

Earlier quoted context omitted.

I believe the most promising route is to not try to do passthrough but to use a "virtual" gpu, aka a paravirtualized device. Thanks to the contributions of an open-source developer*, virtio-gpu has been ported to macOS (it already works on Linux but not on Windows and soon it will be on macOS). Apple is also reportedly working on bringing better support for macOS virtualized environments [2]. It means that users will…

> without having to care about trying to do complicated things ([...] pci-passthrough of a second GPU) Actually, GPU passthrough is quite simple: configure host Linux to assign a virtual driver to a secondary GPU on boot and configure QEMU to use that driver on guest boot[1]. If you buy a GPU that is natively supported by macOS (e.g., Sapphire Radeon RX 580 Pulse 4GB), you get 99% performance and 100% stability of a…

IME you’ll also need to use isolcpus and affinity on the KVM threads to get stable GPU performance (with macOS or other OSes). Plus there can be some other fun issues depending on your setup, like having to flash a different BIOS on your card or having to deal with multiple devices on the same IOMMU domain (I had to pass through a USB controller with my card).

Re: OS X-KVM: Run macOS on QEMU/KVM

#24
post #16

Earlier quoted context omitted.

> without having to care about trying to do complicated things ([...] pci-passthrough of a second GPU) Actually, GPU passthrough is quite simple: configure host Linux to assign a virtual driver to a secondary GPU on boot and configure QEMU to use that driver on guest boot[1]. If you buy a GPU that is natively supported by macOS (e.g., Sapphire Radeon RX 580 Pulse 4GB), you get 99% performance and 100% stability of a…

By complicated, I mean that you have to modify your the default behavior of your host OS (which by default will grab any hardware) and pick a GPU that is supported by the guest OS. People with Nvidia GPUs cannot do that for macOS. Ideally, out-of-the-box, with a few clicks, most people including non-tech savy ones should be able to enjoy 3D acceleration in their VM, regardless of their host configuration. Besides, in…

> Besides, in the long term, Apple is likely to drop support for AMD or Intel GPU in their OS

Off topic but I’m curious about this. On one hand I think it’s a very Apple like thing to do but on the other hand it would practically kill Mac for pro use cases, which is barely hanging on by a thread right now. Could you imagine buying a $10,000+ workstation and Apple telling you 1 8k display is enough?

I think it really hinges on what the next Mac Pro looks like. If it’s arm based and allows expansion then it’ll likely support AMD and intel gpus and support for those will stick around for years. If not , then the current intel macs and their egpu support will be the end of the line.

Re: OS X-KVM: Run macOS on QEMU/KVM

#25
post #17
post #10

Earlier quoted context omitted.

I believe the most promising route is to not try to do passthrough but to use a "virtual" gpu, aka a paravirtualized device. Thanks to the contributions of an open-source developer*, virtio-gpu has been ported to macOS (it already works on Linux but not on Windows and soon it will be on macOS). Apple is also reportedly working on bringing better support for macOS virtualized environments [2]. It means that users will…

Is there some info on virtio GPU for OSX development somewhere ? I knew virtio support was happening but hadn't seen any info on the GPU bit.

The port I had in mind is this one [1], and the use case is to make it possible to run 3D accelerated Linux guests on macOS hosts. I may have wrongly believed that it would be useful for macOS guests.

Besides, it is correct that whatever happens on the driver side of things, Apple will have to approve it first (as the other reply pointed out)

[1] https://mail.gnu.org/archive/html/qemu-devel/2021-02/msg0423...

Re: OS X-KVM: Run macOS on QEMU/KVM

#26

Earlier quoted context omitted.

Not really pass through, no. If CONFIG_DRM_I915_GVT is enabled in your kernel, you can use Intel's graphics virtualization system... basically a virtio style virtual device that shares the GPU between VM and host. IMO this is way more convenient than real passthrough, where the device is only available either to the VM or the host. The downside is that you don't get full performance in the VM. "Intel GVT-g is a full…

Gvt-g is pretty much dead. New hardware e.g. Tiger Lake with Xe isn’t supported and it’s my understanding that Intel has no plans to support. See the following link for supported devices. https://github.com/torvalds/linux/blob/bbf5c979011a099af5dc7...

New Intel hardware supports SR-IOV, the successor to GVT-g, but unfortunately driver support is apparently missing for Linux: https://www.reddit.com/r/VFIO/comments/o7l2zr/sriov_on_intel...

Re: OS X-KVM: Run macOS on QEMU/KVM

#27
post #10
post #5

I’m hoping to run macOS with QEMU/KVM with a project like this or another - does anyone know though if it is possible to pass through an intel integrated gpu (in a CPU only machine) to use for hardware acceleration?

I believe the most promising route is to not try to do passthrough but to use a "virtual" gpu, aka a paravirtualized device. Thanks to the contributions of an open-source developer*, virtio-gpu has been ported to macOS (it already works on Linux but not on Windows and soon it will be on macOS). Apple is also reportedly working on bringing better support for macOS virtualized environments [2]. It means that users will…

Wow that's very surprising apple is trying to give better support for virtual environments instead of worse.. Do you know if they're allowing their iOS dev tools to run in there so you don't have to buy a mac anymore?

Re: OS X-KVM: Run macOS on QEMU/KVM

#29
post #25
post #17

Earlier quoted context omitted.

Is there some info on virtio GPU for OSX development somewhere ? I knew virtio support was happening but hadn't seen any info on the GPU bit.

The port I had in mind is this one [1], and the use case is to make it possible to run 3D accelerated Linux guests on macOS hosts. I may have wrongly believed that it would be useful for macOS guests. Besides, it is correct that whatever happens on the driver side of things, Apple will have to approve it first (as the other reply pointed out) [1] https://mail.gnu.org/archive/html/qemu-devel/2021-02/msg0423...

macOS guests use Apple’s own ParavirtualizedGraphics framework, which comes with none of the downsides of virtio-gpu. It pipes through serialised Metal at native performance.

Re: OS X-KVM: Run macOS on QEMU/KVM

#30
post #21

I’d be careful about offering commercial support for this.

I think I was thinking along the same lines as you. There is a section in the linked github titled "is this legal"[0] [0] https://github.com/kholia/OSX-KVM#is-this-legal

That appears to be in reference to the act of running macOS on non-Apple hardware. The reference to paid commercial support is what will have the Apple lawyers knocking.
Post reply on HN