Supporting Multiple GPUs

Last Revision:
Version 1.2, 2013-07-15
First public release. Updated the drawing with OpenGL 3.2 Core Profile.
Build Requirements:
OS X v10.8 or later
Runtime Requirements:
OS X v10.8 or later

This sample demonstrates what an OpenGL application should do to support multiple GPUs. When running on a multi-GPU system, in order to render the OpenGL content correctly on all hardware, your application needs to be able to detect renderer changes. Whenever the virtual screen changes, the capabilities of the video card you are currently rendering to can change, so you must re-query those capabilities (such as max texture size) and adjust your drawing paths as necessary to support the newly active GPU.

This sample demonstrates how to detect and respond to renderer changes in both an NSOpenGLView subclass and an NSView subclass. It also demonstrates how to enable the usage of offline renderers (renderers that are not connected to a display).