Intel HD4000 QE/CI Acceleration

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).

  • AppleIntelGraphicsHD4000.kext
  • AppleIntelGraphicsFramebufferCapri.kext
  • …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.

AAPL,ig-platform-id Memory (MB) Pipes Ports Comment
01660000 96 3 4
01660001 96 3 4
01660002 64 3 1 No DVI
01660003 64 2 2
01660004 32 3 1 No DVI
01620005 32 2 3
01620006 0 0 0 No display
01620007 0 0 0 No display
01660008 64 3 3
01660009 64 3 3
0166000a 32 2 3
0166000b 32 2 3

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.

Results


| +-o GFX0@2
| | | {
| | | "assigned-addresses" = <1010008200000000000080f70000000000004000181000c20f000000000000100000000000000010201000810000000000f000000000000040000000>
| | | "IOInterruptSpecifiers" = (<1000000007000000>,<0400000000000100>)
| | | "class-code" = <00000300>
| | | "IODeviceMemory" = (({"address"=4152360960,"length"=4194304}),({"address"=64692944896,"length"=268435456}),"IOSubMemoryDescriptor is not serializable")
| | | "AAPL,gray-page" = <01000000>
| | | "IOHibernateState" = <00000000>
| | | "IOPowerManagement" = {"MaxPowerState"=2,"ChildrenPowerState"=2,"CurrentPowerState"=2}
| | | "subsystem-vendor-id" = <58140000>
| | | "built-in" = <00>
| | | "acpi-device" = "IOACPIPlatformDevice is not serializable"
| | | "IOPCIMSIMode" = Yes
| | | "IOInterruptControllers" = ("io-apic-0","IOPCIMessagedInterruptController")
| | | "name" = "display"
| | | "vendor-id" = <86800000>
| | | "device-id" = <62010000>
| | | "IOPCIResourced" = Yes
| | | "compatible" = <"pci1458,d000","pci8086,162","pciclass,030000">
| | | "AAPL,iokit-ndrv" =
| | | "acpi-path" = "IOACPIPlane:/_SB/PCI0@0/GFX0@20000"
| | | "model" = <"Intel HD Graphics 4000">
| | | "subsystem-id" = <00d00000>
| | | "revision-id" = <09000000>
| | | "AAPL,ig-platform-id" = <00006601>
| | | "AAPL,gray-value" =
| | | "pcidebug" = "0:2:0"
| | | "IOName" = "display"
| | | "device_type" = <"display">
| | | "reg" = <0010000000000000000000000000000000000000101000020000000000000000000000000000400018100042000000000000000000000000000000102010000100000000000000000000000040000000>
| | | }

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.

Setting AAPL,ig-platform-id

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.

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.

57 comments to Intel HD4000 QE/CI Acceleration

  • MacGirl86

    Where can I find the file that has the AAPL,ig-platform-id so I can add it and change the value of it?

  • MacGirl86

    I did something right but at the same time something is also wrong too. I have Intel HD Graphics 4000 512 MB now but I have to start up in safe mode because I am getting a grey distorted screen after startup without safe mode enabled.

    • Henry

      Is the Graphics memory size in BIOS correct? (should be 32, 64, or 96 MB)…also, I get garbled output on the VGA connector.

  • chad

    Hi Henry, could you give me a clue as to where I can place the AAPL,ig-platform-id or where I can find this? I am new to running the Mac os and its a bit confusing to a newbie like me so any help would be greatly appreciated.
    If this is something I need to add to my org.chameleon.Boot.plist then maybe give me an example of what this should look like so I can just copy and paste it from yours to mine. This is how my org.chameleon.Boot.plist looks now and and I do get a distorted screen after startup If not in Safe Mode. I DON’T USE A dsdt.aml with my setup! Thanks a lot for the information here!

    EthernetBuiltIn
    Yes
    GraphicsEnabler
    Yes
    Graphics Mode
    1680x1050x32
    Kernel
    mach_kernel
    Kernel Flags
    npci=0x3000 darkwake=0
    Legacy Logo
    Yes
    Timeout
    2
    UseKernelCache
    Yes

    • Henry

      As far as I know, without AAPL,ig-platform-id set, the HD4000 driver wouldn’t even attempt to load. Getting distorted screen suggests the driver is loading. Do you have it set already? (Which boot loader are you using?)

      I am also a newbie 🙂

  • chad

    EthernetBuiltIn
    Yes
    GraphicsEnabler
    Yes
    Graphics Mode
    1680x1050x32
    Kernel
    mach_kernel
    Kernel Flags
    npci=0x3000 darkwake=0
    Legacy Logo
    Yes
    Timeout
    2
    UseKernelCache
    Yes

  • chad

    Its not posting everything!

  • chad

    Im using Chameleon r2012 from above. When I start up in safe mode it shows the intel HD 4000 as having 512mb, up from 64mb but I don’t know where to take this from here. I can’t find where I am supposed to change the AAPL,ig-platform-id to a different number. I think thats the only problem right now and thats why the screen is distorted? I feel like an idiot right now for not knowing how to fix this.

    • Henry

      Ah 🙂
      In the section “Setting AAPL,ig-platform-id”, I listed 3 ways of adding the AAPL,ig-platform-id device property. One of the ways is to modify the bootloader to do it. The bootloader I posted does just that. By default, it sets it to 01660000 (96MB, 4 ports, etc).

      Do you have Graphics Memory set to 96 MB in your bios settings?

  • chad

    I can try that right now setting my graphics memory to 96 mb

  • chad

    Its still has a distorted screen immediately after startup even when changing the Graphics card bios memory to 96mb?

    • Henry

      I don’t know… the only other case I’ve seen with distorted display is using the VGA output. VGA doesn’t work. I’ve only tested DVI.

  • chad

    Thinking that I was already plugged into the HDMI I decided to try all the video ports in the back and success, I have full acceleration! I can’t believe it was all from not being plugged into the right video port. Thanks for your help!

  • chad

    It was my DVI port giving me the distorted video, but I had an HDMI to DVI cable laying around and using this works perfectly without the distorted screen.

    • Henry

      Great!

      In that case, you might consider playing with the ID number (maybe 01660001?) to see if you can get the combination of enabled ports you like. Maybe binary-editing some table inside the driver to individually control the ports might be needed if it doesn’t work… (like what’s sometimes done with HD3000)

      • chad

        ok, thanks for this and it was your modified chameleon boot loader installer that really did the work. Whats the easiest way to find where this ID number is so I can play around with the different numbers?

        • Henry

          I added yet another parameter to the bootloader. Passing HD4000PlatformId=[0 through 11] changes which value it sets AAPL,ig-platform-id to (HD4000PlatformId=0, for 0x01660000 is the default). You can type this at the boot prompt, or as an entry in org.chameleon.Boot.plist.

          ioreg -l -p IODeviceTree will tell you what the property is set to (see “Results”), so you can check if it got set as you wanted.

          • chad

            ok, thanks a lot for the information! Before this blog was posted I didn’t know where to begin, this blog has been very helpful.

          • Chad

            Henry, the chameleon boot loader is perfect now and both DVI and HDMI working great here! I wasn’t using the computer that much the last few days but today I finally reinstalled your newly modified boot loader and its just awesome. I think your the first person so far to do this. THANKS AGAIN!!!

          • Henry

            How did you get both DVI and HDMI working? (was it 01660001, or something else?)

            The guys on the InsanelyMac thread got this working before me. I patched the GraphicsEnabler code to do the same 🙂

  • chad

    If its hard to explain then don’t worry about it. I know that very soon Chameleon will be updated with these settings and it will just take a click of the mouse to install the Intel HD 4000. I’m just very happy that its working here now and HDMI to DVI doesn’t bother me as long as its working so I’m completely ok with it! Thanks to you its working!

  • Sting

    Thanks so much for the amazing guide!
    I’m on an ASRock H77m-itx and using the patched Chimera bootloader provided above. I got the kernal panic mentioned with the bios not being set to 96MB, and of course my BIOS was set to “auto”. I have no bios option to change select 96, just 32, 64, and 128, so I tried 64 and booted with flag HD4000PlateformId=8. No kernal panic, and in my plist I also have the resolution set at 1920x1280x32 (which makes it look so nice), but for some reason the cursor isn’t there. I can open files, and select options, but only by guessing where the cursor is – very weird problem. Any suggestions? Thanks!

  • Sting

    Ok so I tried HD4000PlatformId=9 instead and now I have a cursor. Doesn’t seem that QE/CI is working though (solid grey menu bar). Is there another way I check to confirm this, and if it’s not working what else should I try? Thanks

    • Henry

      I would check these:
      – About This Mac says video memory is ~512 MB (shows that the driver is loaded)
      – If not, check ioreg -l for AAPL,ig-platform-id being set (If you’re using a device-properties string, it conflicts with GraphicsEnabler and only the device-properties string is used)
      – Check that it didn’t boot up in “safe mode”

      I’ve seen a (almost-)missing cursor once when I set BIOS to 64M using a 96M configuration… I can’t say I can be much help here… Good luck!

      • Sting

        Says that the video memory is 512MB.

        Not sure at all what you mean with the ioreg -l thing. device-properties string? I’m using the modified chimera bootloader posted above and I’ve tried using a combo of different things (64MB with 8, or 9, now 32 with 5) [I’m running a i5-3570k if that makes any difference], and I’m not booting with safe mode.

        It seems mostly as long as the bios memory matches the right HD4000PlatformId I get a cursor, but still never QE/CI.

        Side note: sometimes in the about this mac it shows the mac mini picture, and sometimes just what looks like an Apple Display. With both though it shows in system report as a mac mini (although I believe you said smbios shouldn’t matter)

        Any ideas again would be greatly appreciated!

        • Henry

          Running ioreg -l -p IODeviceTree gives a list of devices and their properties. The ideas is to verify that GraphicsEnabler actually inserted the device property, so you should see AAPL,ig-platform-id being set for the graphics device (named GFX0, IGPU, or something else).

          If you happen to also use a “device-properties” string in org.chameleon.Boot.plist (for other hardware, perhaps), it overrides the device property set by GraphicsEnabler. As long as you see AAPL,ig-platform-id in ioreg, that’s all the patched bootloader does…

          I don’t have any more ideas… maybe the kernel logs might have some clues (perhaps boot with -v).

  • Tom

    Where can I find my device ID? Don’t have Windows installed..

  • Tom

    I’ve got HD4000 with full QE/CI but O N L Y from a cold startup.. Not a huge problem but it’s strange..

  • Jan

    Hi, I received my new GA-Z77-DS3H(F13) together with a i5-3570k CPU recently, and I tried to use the HD4000 too, without success. Is it possible that you provide me with your dsdt file and extra folder? That would be absolutely great for me as beginner!

  • RR7

    I seem to be the only person on the planet with the following problem:

    i can get the driver loaded, but the screen goes blank. as in off. like its out of range or asleep or something. it does it in safe mode too, but only when the id is injected, and it doesnt matter which one, it always seems to do it. It’s the AppleIntelFrameBufferCapri.kext thats doing it. i can delete HD4000.kext and the same thing still happens.

    if i connect via screen sharing, i can see that the menu bar is transparent, and the system is running fine, at the correct resolution. it reports as being connected via displayport, which is correct.

    ioreg shows 3 frame buffers, (0,1,2) and Appledisplay connected to the @2 framebuffer.

    looking through the verbose startup, i see that HD4000 fails due to dependancies on IOGraphicsFamily, and that it couldn’t alloc class Gen7Accellerator. i dont know if this is related, like i sai, if i remove the kext, the same thing happens. how does one diagnose a dependancy failure?

    i’ve tried switchrex and tried dropped the resolution, which doesnt fix it, everything looks okay, so i’m stumped as to whats going on and why, and it seems that no-one around is able or willing to try, i dont blame them i guess.

    but i could really do with some sample DSDT and IOREG files to try and work out whats going on.

    any help really appreciated!

    • Henry

      I don’t use a custom DSDT (I use a GA-Z77M-D3H). I’m using the DVI port using 01660000. Have you tried all the different values of AAPL,ig-platform-id to see if it’s just an issue with which displays are enabled?

    • Henry

      Here’s the output of ioreg -l. Maybe it might be useful for you.
      http://blog.stuffedcow.net/wp-content/uploads/2012/07/ioreg.txt

      I seem to have four AppleIntelFramebuffers, with my DVI port connected to AppleIntelFramebuffer@1.

      I don’t seem to see any complaints about kext dependencies in verbose startup, using Mountain Lion 10.8.

      • RR7

        Hi,

        thanks for the ioreg, i tried to open it in that ioreg viewer but it says its corrupt, so i’m trying to work out the text.

        i’ve tried every single plaltform id. on id9 i get 3 framebuffers, no display detected. on 5 i get 3 framebuffers and my display detected on @2. on another id, i cant remember which, might be 0, or 3, i get 4 framebuffers and the display is detected on @3.

        the only one that seems to show up is 0, 3 and 5 by the looks of things, maybe 8. suffice to say NONE of them fix the actual issue.

        even weirder, is that if i put the pc to sleep, then wake it up when i press the input button to switch form pc to hdmi input, just for a fraction of a second i get to see the mac display!

        as i turn the input button on and off, i can see ioreg terminating the display and adding a new one again (red and green) but in each case the screen itself is off, no backlight.

        i was thinking it may be some backlight issue where it needs a backlight driver but is getting a non-backlight one. however when i installed windows 8 on the pc, the software brightness controls show as unavailable. so iguess its not that. there is a hardware brightness/backlight on/of button, but it doesnt make any difference when the mac framebuffer is loaded.

        another interesting thing, is on windows 8 it says secondary display, when i switch to that, the display goes off, and it goes to the VGA output on the back.

        if i plug a VGA monitor into this, while the display is blank on the mac side of things, it is trying to output to the VGA and its garbed. so it looks like its outputting the desktop to the wrong framebuffer? i was looking for a utilty to swap screens, but since VGA isnt supported, this doesnt seem to show up either.

        i really dont want to give up on this, its a very nice all-in-one chassis i have, and on paper it should be vanilla compatible.

        i notice on sandy bridge framebuffer you can edit the outputs, i guess this type of hack isnt known yet on the HD4000 side of things.

        a utilty to cycle output between framebuffers would be useful, if anyone knows of such a thing.

  • RR7

    Maybe connector table hacks?

  • chris

    thanks henry for that, excuse my english because Iam french to montreal quebec

    Iam so happy to my intel hd4000 on my hackintosh, and finaly put my graphic card on the box.

    my OS work very good whit this bootloader and do you have a update or somtings like that because its experimental he

    anyway thank you mr henry

    chris

  • RR7

    well, i was able to hack the connector tables, so i could get my display connected on whatever platform id i like.

    but, i had the same problem regardless. blank screen. i’m lacking in what diagnostic steps could be needed to discover whats actually going on.

  • Nik

    Came to this party a bit late, but I also had a hell of a time getting HD4000 graphics to run. The newer version of Chameleon and the patched version listed here wouldn’t work for me so I looked through the forum Henry linked on how to do this using the device strings in /Extra/org.chameleon.Boot.plist and figured out how the gfxutil stuff worked.

    Long story short, if you need to fix this and Henry’s solution doesn’t work you can try adding this to your /Extra/org.chameleon.Boot.plist after setting your video memory to 32MB.

    device-properties
    8800000001000000010000007c0000000200000002010c00d041030a000000000101060000027fff0400100000006d006f00640065006c0000001a000000496e74656c20484420477261706869637320343030302c0000004100410050004c002c00690067002d0070006c006100740066006f0072006d002d006900640000000800000005006201

    If you want more memory, take a look here, I wrote up how to use gfxutil to generate the required strings.

    nik

    • Nik

      Whoops, tags got removed. Here’s the properly formatted version of the string that needs to be added for 32M:

      <key>device-properties</key>
      <string>8800000001000000010000007c0000000200000002010c00d041030a000000000101060000027fff0400100000006d006f00640065006c0000001a000000496e74656c20484420477261706869637320343030302c0000004100410050004c002c00690067002d0070006c006100740066006f0072006d002d006900640000000800000005006201</string>

    • Henry

      Hmm… were you already using a device-properties string for some other hardware? “Graphics Enabler” and device-properties are mutually exclusive: The bootloader builds a device-properties string at runtime, but then uses the one in org.chameleon.Boot.plist instead, if it exists.

  • Tayyab

    I have Inspiron 5520 laptop and there is no option to set graphics memory in bios. 🙁

    Is there any other way?

    • Henry

      I’d guess the BIOS does set the graphics memory to some value… it might take some guessing to figure out what it is (or try the settings until it works).

  • Sam

    On most laptops it is not possible to manually set the video RAM for Intel HD Graphics. Both laptops I have it is not possible to change this setting in the BIOS, it is luck of the draw that my first laptop has 64MB set by the manufacturer and has full QE/CI. On the second however, it is set at 128MB and none of the above device strings list that high an amount. So I can never get the second laptop to run Mountain Lion :(. On my desktop, it is entirely possible and works with ML beautifully…

    • Dani

      Is there a way around this? my laptop doesn’t have an option to set the video RAM. I don’t know exactly how much was set by the manufacturer by default, but I’m guessing it’s 128, since I can’t seem to be able to get it to work.

  • CYF

    FYI, regarding the VGA port not being available, this is NOT true. I have my VGA, HDMI, and internal laptop display all working simultaneously right now. I have a modified DSDT and AppleCapriFrameBuffer.kext. The VGA must be connected during start up, and a lot of times the laptop will not recognize if the VGA is “hot”-unplugged. HDMI switching seems fine.

    • Tiger

      CYF, as I know, for those laptops without standalone display adaptor, HD4000 can’t be drived to use internal display. Does your laptop has a standalone display adaptor?

  • HK47

    Nik! Thank You! You fixed my issue! I added those device properties in in chameleon file, reboot and now I have HD4000 graphics recognized and working. Thank You!

  • RR7

    i’m back, and I worked out whats going on!

    my system has two display outputs, internal displayport and external VGA.

    the system detects the displays and allocates the display pipe, but its using the wrong pipe.

    i was able to test this by hacking the VGA enabled and running that by itself, which resulted in garbled display in the built in screen, the OS reports the VGA monitor details, but that’s not where it sends the picture.
    right now port 04 06 uses AAPL,DisplayPipe 00 00 00 00, but it should use AAPL,DisplayPipe 01 00 00 00, and vice versa for 06 02.
    unfortunately, I don’t (yet!) know how to change this, but that’s the problem, and that should solve it.

    anyone got any pointers in how to change the AAPL,DisplayPipe property, or re-allocate the pipe numbers? are they done in BIOS?

  • hello. Why my laptop just showed 384 mb of memory?
    on this post it said 512mb.

    So, can we increase it?

    thanks.

    ps: sorry for my bad english, i’m indonesian :D.

  • look at this site!

    I found a solution.

    Fix the Ports and you can use every ID:…

    I have upload this file on Server.

  • Hello mate, I have Asus Maximus V Formula(no gpu)only HD 4000(2 port i.e HDMI & DisplayPort) can you tell me which one is working for me. much thanks.

    • ps : am using “ig-platform-id: 01660003, Stolen RAM for FB: 64MB, Pipes: 2, Ports: 2, FBMem: 2” and freeze on apple logo. bt when I boot wid -v -f -x den its works. any solutions?

    • Henry

      I don’t know, I suppose you could try all of them and see which works.

      From your motherboard manual, it looks like the reserved graphics memory size isn’t configurable. The BIOS setting (“Allows you to select the amount of system memory allocated to DVMT 5.0 used by the iGPU.”) seems to set the DVMT memory size, rather than the reserved size…(?)

  • German

    Hi!

    i installed iAtkos Mountain Lion, then i installed Multibeast for HD 4000 graphics.
    When i reboot the screen are distorted.

    I want to try your patched Chimera for resolved this problem.

    i will start from the begining again.

    1 – Install iAtkos Mountain Lion
    2 – Install your patched Chimera an restart
    3 – Set video memory from bios at 96mb.

    This is the right way? replace multibeast for your chimera and reboot?

    THANKS!!!

    Sorry for my english.

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>