The Macbook Pro 11,3 (late 2013, Retina) is equipped with two GPUs:
- discrete: NVidia GPU: GeForce GT 750 M
- integrated: Intel Iris Pro
Currently under Linux the Intel GPU can only be used with the help of:
- gfxCardStatus v2.2.1
- faking the os identification:
- https://lists.gnu.org/archive/html/grub-devel/2013-12/msg00442.html
- https://bbs.archlinux.org/viewtopic.php?pid=1368083
Otherwise the Intel GPU gets disabled by the EFI.
- boot Mac OS X
- start gfxCardStatus v2.2.1
- select "integrated only" (only needed once)
- reboot
- apply "apple_set_os" with a patched grub or patched kernel
- finally boot Linux
To improve this situation reverse engineering of Apple's switching driver is attempted and documented here.
Observations:
- gfxCardStatus basically only calls Apple's GPU swichting driver
- the "integrated only" settings is persistent
So it seems logical that the GPU selection is stored in some NVRAM / EFI variable.
/System/Library/Extensions/AppleGraphicsControl.kext/Contents/Plugins/AppleMuxControl.kext
is responsible for switching GPUs and saving of the current state.
So AppleMuxControl was disassembled and the following EFI GUID + variable were found:
fa4ce28d-b62f-4c99-9cc3-6815686e30f9
+ gpu-power-prefs
This variable also shows up in efivarfs in Linux when the Nvidia GPU is activated. The attempt of reading this variable fails with an IO error.
gpu-power-prefs
seems to be protected from access maybe, because of a not set the EFI_VARIABLE_RUNTIME_ACCESS
attribute.
With this knowledge further attempts to read this var were started. A EFI program based on https://github.com/android-ia/platform_external_efitools/ - ReadVars.c was develop.
It can be started via a EFI Shell and can read out EFI variables.
Currently it also fails to read out gpu-power-prfes
with EFI_ACCESS_DENIED
.
Further tries to read out gpu-power-prefs
and analysis.
Any input or feedback are welcome!
References:
- [1] Issue thread where this Gist originates https://github.com/ah-/gmux-scripts/issues/1