Does rMBP share the integrated and the dedicated VRAM between cards?

Discussion in 'MacBook Pro' started by walkie, Feb 12, 2013.

  1. walkie macrumors 6502

    Joined:
    Feb 13, 2010
    #1
    As we know the integrated Intel HD4000 comes with 512Mb and the dedicated graphic card nVidia 650M with 1Gb on the rMBP, I'd like to know if rMBP shares this memory to sum up a total of 1.5Gb of VRAM for both graphic devices, if not how the rMBP can switch from one to the other graphic device without even flickering?, I mean if you're using the HD4000 and then MacOSX needs more power and switch to the nVidia, does MacOSX move all the data from one VRAM to the other and viceversa?
     
  2. maflynn Moderator

    maflynn

    Staff Member

    Joined:
    May 3, 2009
    Location:
    Boston
    #2
    I believe the integrated GPU only uses system ram, and the discrete GPU only uses vram, the two will not intermix.
     
  3. dusk007 macrumors 68040

    dusk007

    Joined:
    Dec 5, 2009
    #3
    There is about 512 MB VRAM to swap. The bandwidth is in the range of 8GB/s.
    It takes 1/16 of a second to copy the data over.
    Upon switching one GPU can power up and initialize in parallel. At the last moment all that needs to be switched is the display output.
    For a little bit they probably run in parallel and do both the same thing. Then they simply switch the mulitplexer to take the buffer output from the other gpu. That in theory could work extremely fast.

    They definitely don't share the RAM but on Windows at least GPU drivers can dynamically assign system RAM as additional VRAM. Some of the high end cards use up to 4GB added VRAM. I doubt that is done on OSX. Also the graphics switching on Windows is different and IMO much better than the OSX solution.
     
  4. walkie thread starter macrumors 6502

    Joined:
    Feb 13, 2010
    #4
    Interesting explanation, but in the end the HD4000 doesn't have its own memory and instead uses part of the main RAM, does it?

    I can't figure out MacOSX not doing the same thing as Windows, in theory in any OS be Linux, Windows etc. the graphic card can use the main RAM as VRAM if it runs out of VRAM but not sure...
     
  5. leman macrumors 604

    Joined:
    Oct 14, 2008
    #5
    This is correct. And this is also a big benefit - usually, the driver has to copy the data (textures etc.) to the GPU in order to do some work. With the IGP's ability to access system RAM, the driver can in certain cases optimise the data access and completely eliminate the copy.

    Are you sure that it is what happens in Linux and Windows? If I am not mistaken, the memory of current GPUs is still not virtualised (I might be wrong about it thought, I stopped keeping up with current GPU architectures some time ago). Now, if the VRAM is running short, the driver will recycle the data in the VRAM, copying it out or into the system RAM as needed.
     
  6. snaky69 macrumors 603

    Joined:
    Mar 14, 2008
    #6
    That would be correct.
     
  7. walkie thread starter macrumors 6502

    Joined:
    Feb 13, 2010
    #7
    According to this: http://www.tomshardware.co.uk/forum/342932-15-kepler-cards-pulling-system-vram-runs and other articles I have read in the past about graphic cards they do use system memory when they use up all the VRAM.
     
  8. Krevnik macrumors 68040

    Krevnik

    Joined:
    Sep 8, 2003
    #8
    This is correct. Integrated GPUs can access system memory, as they are on the same die, and share a memory controller with the CPU. And because the drivers can swap out textures/etc as needed, there just hasn't been a need.

    But I can see how folks can get confused. The driver does use system memory as an overflow cache for what is in VRAM, but it isn't the same thing as the GPU having access to system memory.
     
  9. dusk007 macrumors 68040

    dusk007

    Joined:
    Dec 5, 2009
    #9
    The important distinction is that what is usually considered VRAM for the IGP is set aside. It is fixed. Physically yes it is the same main memory but logically it isn't. Therefore it would still need to copy to and from this fixed memory VRAM.

    Describing anything added as a cache is more accurate. The "true" VRAM even if it is in sys. memory is initialized at startup and cannot be changed while running.
     
  10. leman macrumors 604

    Joined:
    Oct 14, 2008
    #10
    This is not correct. The IGP has the ability to address an arbitrary location in the RAM. It is true that a portion of the RAM is always reserved for the IGP, but it does not mean that the IGP can only access that portion. OS X defines custom OpenGL extensions which allow to optimise scenarios like these (e.g. GL_APPLE_client_storage).
     
  11. walkie thread starter macrumors 6502

    Joined:
    Feb 13, 2010
    #11
    I agree with this, but didn't know the IGP was allowed to access the system memory directly.
     
  12. dusk007 macrumors 68040

    dusk007

    Joined:
    Dec 5, 2009
    #12
    Than I stand corrected in some sense.
    The VRAM data is still in this fixed bucket. It isn't like the IGP is allowed to use 512MB wherever it may please, whenever it wants. That it still has the ability (especially for OpenCL probably very useful) to address outside of this VRAM doesn't make the VRAM anymore fluid.
    Especially the rest of the OS and CPU is locked out of what is VRAM. It can still address and modify but it cannot do with it anything it wants like store some app data in there.

    Important for the op is that dedicated VRAM and IGP VRAM will never be shared for one GPU. The 650M won't access stuff in the IGP VRAM and the HD 4000 will never do anything with the 650M. The copy back and forth is afaik also a CPU job handled by the driver.
    With Optimus in Windows it is slightly different as the final framebuffer is always the IGP one and the 650M would always have to forward there. Which is in some sense shared ressource.
     

Share This Page