Graphics acceleration (Core Image, Quartz Extreme) for Intel HD Graphics 4000 (on Ivy Bridge processors) works in Mac OS X! The drivers are included in the MacBook Pro (Mid 2012) Software Update 1.0, Lion 10.7.5, or Mountain Lion 10.8. (Also found in BridgeHelper 5.0).
- …and maybe some others I don’t know about
As pointed out by ElNono and proteinshake, the critical bit missing to get the HD4000 drivers to load is the AAPL,ig-platform-id device property for the graphics device. Of course, on anything other than Apple hardware, this property wouldn’t exist, and would need to be added.
The AAPL,ig-platform-id property is a 32-bit number that must be one of the values listed in the following table. Thanks to ElNono for figuring it out.
The value of AAPL,ig-platform-id selects which graphics configuration the driver will use (er, blindly assume). Setting AAPL,ig-platform-id to any of the 12 values will load the HD4000 driver, but there are some other constraints.
First, the setting affects which ports are enabled. Configurations with zero ports should be avoided (no output?). Configurations with just one port should probably be avoided because it’s probably not the port you’re looking for. On my GA-Z77M-D3H, for configurations with one port, the enabled port is not the DVI port. For configurations with two or more ports, DVI was available. The VGA port is not enabled for any of the configurations. I did not test the HDMI port.
Also, the graphics memory size for the configuration must match the setting in BIOS. If they don’t match, the driver may crash (kernel panic at
gen7_memory.cpp:721), or the display may be corrupted. For example, using configuration
0x01660000 (96 MB, 3 pipes, 4 ports), set the Graphics Memory Size to 96 MB to match. It appears that OS X doesn’t obey the DVMT Total Memory Size setting (always 512 MB with 8 GB system RAM), so I just left it as MAX to match.
ioreg -l -p IODeviceTree can be used to verify that the device property was correctly added to the list of properties for the graphics device. The end result is that the AAPL,ig-platform-id property shows up in
ioreg output. A correct value causes
AppleIntelGraphicsHD4000.kext to load.
The goal is to inject a device property named
AAPL,ig-platform-id with a 32-bit value that is one of the table entries (e.g., 01660000). There are many ways to inject a device property, and I know very few of them. The method I used was to modify the Chameleon bootloader’s GraphicsEnabler code to add the property whenever GraphicsEnabler=y (gma.c). Here are a few options I’ve heard of:
- Modify the bootloader’s GraphicsEnabler code. I modified Chimera 1.10 (rev 1999,
i386/libsaio/gma.c) to add a new device property value.
- Device property injection by the bootloader using “device-properties” in org.chameleon.Boot.plist. I don’t know how to generate such a string, but there are a few examples posted in this thread. Something about gfxutil.
- Editing the DSDT to add the property for the graphics device.
Modifying the Chameleon Boot Loader
I chose to modify the GraphicsEnabler code from the Chameleon/Chimera bootloader. The patches below can be applied to the source code from svn (http://forge.voodooprojects.org/svn/chameleon). I’ve also compiled patched versions of Chameleon (rev. 2012) and Chimera (rev. 1999) for convenience.
- Chameleon svn r2012
- Update July 20, 2012: Chimera 1.11
- Chimera 1.11 has been updated with something similar to what’s described here (AAPL,ig-platform-id set to 01660009 and device-id set to 0166).
- Chimera 1.10.0
Settings that don’t matter
It appears that AAPL,ig-platform-id is the only critical setting to enable hardware acceleration. I’ve tried changing a few other things and none of them seem to matter.
device-id and revision. The driver doesn’t care whether this is mobile (0166) or desktop (0162). I suspect it needs to be one of the two in order to load the kext, but it’s not important to match it with the high-order 16 bits of AAPL,ig-platform-id. I left mine unchanged at 0162:0009 using configuration 01660000.
GFX0 vs. IGPU in DSDT. This doesn’t seem to matter either. Both work the same, so I left mine as GFX0 without issues.
SMBios version/productname. I tried a few, and also tried without smbios.plist. The driver loaded fine in all cases. (Mac Pro, iMac, MacBook Pro were all ok)
Settings that do matter
AAPL,ig-platform-id. Yes, it matters.
Graphics memory size in BIOS. This must match the amount of graphics memory for the chosen configuration.
Connectors. Not all output connectors are enabled. Getting a garbled display could be a symptom the connector currently used is disabled. Changing the value of AAPL,ig-platform-id might change which connectors are enabled/disabled.