Can Linux handle Apple's proprietary hybrid GPU implementation? (Mac mini 2011 as small NAS)

Hi,

the better/worse half of a family member is very happy with a Mac mini 2011 (model with i5-2520M and AMD Radeon HD 6630M).

That box worked for almost 8 years without any issues but since its performance is more and more an issue it got a Mini 2018 companion.

The Mini 2011 has two 2 TB SATA SSDs and is to become a Backup NAS (only 1 GbE) with RAID1 for the 2018 model since that thing is a black box with no access to data if anything goes wrong with its hardware (yes, I know…).

Can Linux handle Apple’s proprietary way of switching between the CPU iGPU (HD 3000) and the dedicated AMD GPU?

It would be a waste of energy and an unnecessary heat source to always have the AMD dGPU running - I tried Bootcamp/Windows a few years ggo and there the dGPU was always on.

Thanks for the advice!

Are you sure it’s Apple Proprietary and they’re not just talking about normal GPU switching?

Check out this archwiki page to get you up to speed:

Apple uses a hardware mux chip (like the Basic Switching paragraph of your link) WITH Dynamic Switching to switch between the two solutions on-the-fly.

Louis Rossmann mentioned this a few times in his videos about the 2012 A1286 15" MacBook Pros since their mux chip (explicitly not the dGPU) sometimes needs to be “reballed” to solve display glitches.

1 Like

Like this?

1 Like

Yeah, those are the droids we’re looking for.

It should work.

2 Likes

its not clear if the switching is automatic or manual.

would be a good reason to get a macbook if it was automatic.

At least when running macOS it is completely automatic. You can even start an application and depending on the actual workload it can start using only the battery-saving iGPU and if necessary turn on the dGPU without any GUI lags/glitches or the need to restart the application.

well yeah but thats true of windows too for most laptops. I meant in linux though… gpu switching in linux is kind of a shitshow (for pcs). I think Pop OS has some magic to make it fairly easy to switch but nothing automatic.

The kernel doesn’t handle switching. That’s a userland operation. The kernel acts as a abstraction layer between the userland programs and the devices.

So, it’s manual.

foiled again.

1 Like

Yeah, so the GPU switching is going to require bumblebee, I believe. (at least, that’s how my Nvidia hybrid device works)

I’m not sure how it works. It does seem as if apple is doing something different for switching here.

would bumblebee still work the same way?

Bumblebee enables and disables the GPU via PCIe power control and drivers.

So, as long as the hardware supports it, which, if I’m understanding the kernel source file you linked correctly, is what that does, it should work fine.

1 Like

but it needs more than that because the wiring is clearly switching outputs as opposed to what nvidia does with just sending the framebuffer over pcie.

Its definitely over my paygrade.

Oh, yeah. I forget how that’s supposed to work, but I do remember it’s more of a pain in the ass than usual. I think @Dje4321 had this issue with a laptop she had a while ago, but I’m not holding my breath for her to show up.

1 Like

Digging a little more it seems it could be automatic if the driver supports it?

https://www.phoronix.com/scan.php?page=news_item&px=Apple-GMUX-VGA-Switcher-4.6

This article mentions vga switcheroo

https://01.org/linuxgraphics/gfx-docs/drm/gpu/vga-switcheroo.html

Am I understanding that correctly?

At the minimum vga switcheroo would offer manual control.

1 Like

Yeah, so vga-switcheroo should work, but the problem is that it requires an X restart to switch.

1 Like

Depends on the implementation. Some are implemented via a softmux (software switching) and some are a hardware based mux (hardware switching). Is also depends on the configuration. Some the dGPU is drives the display while the iGPU feeds it frames (dGPU <- iGPU) and some the iGPU drives the display whlie the dGPU gives it frames (iGPU <- dGPU).

If its (softmux, iGPU <- dGPU) then try booting into a xorg DM and try to run a GPU dependent application and see if there is a difference between the two.

iGPU
./application
dGPU
DRI_PRIME=1 ./applicatoin

https://wiki.archlinux.org/index.php/PRIME#PRIME_GPU_offloading


ive really only dealt with the nvidia implementation (softmux, iGPU <- dGPU) and that used bumblebee plus a few other things and was completely trash.

2 Likes

Could always just spawn another xorg instance for the game but thats even buggier with certain games. could maybe just spin up a simple DE and launch the game from there.

2 Likes

Yeah, super buggy.