X
Chat
Articles developer.amd.com

AMD Enduro System for Developers

From the consumer perspective, AMD Enduro™ technology regulates your notebook’s GPU, giving you an instant boost in graphics performance when you need it and consuming almost zero watts of power ....

Oct 2, 2015 benjamincoquelle 1 views

From the consumer perspective, AMD Enduro™ technology regulates your notebook’s GPU, giving you an instant boost in graphics performance when you need it and consuming almost zero watts of power when you don’t. This can give you great battery life when using AMD FirePro™ professional graphics or AMD Radeon™ graphics. You can find more information about AMD Enduro technology here.

However, this means that as a developer, you don’t have control over which processor – CPU, integrated GPU (iGPU), or discrete GPU (dGPU) – runs your code. This may not work for you as a developer. As a developer you may need to force your application to run on the discrete GPU.

This blog shows you how to do that. This solution works for Microsoft Windows® 7 and Windows 8. We’ll cover Windows 10 at the end of the blog.

Forcing High Performance

To force your application to run on the AMD discrete GPU, define a variable and set the value to 1, as shown in this code excerpt.

extern "C"
{
__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
}

This will set the switchable graphics mode to high performance for your application. Figure 1 shows the comparable per-application user settings in the AMD Catalyst™ Control Center.

Power management settings for switchable graphics with AMD Enduro™ technology
Fig 1: Power management settings for switchable graphics

Knowing where your application runs

You may have a system with both an APU (containing an iGPU) and a dGPU. You may want to know which GPU your application is actually running on.

If you work with OpenGL, you can query this information by using glGetString(GL_RENDERER).

However if you work with DirectX® 11 (DX11), things get a bit more complicated. In effect AMD Enduro-enabled systems use Linked Display Adapter mode. The adapter description will refer to the master (iGPU) adapter regardless of which adapter is actually being used for rendering.

As a result, traditional DX11 calls will not work and will always give you the iGPU as the GPU used by your application. So this code isn’t going to do the job.

IDXGIDevice * pDXGIDevice;
hr = g_pd3dDevice->QueryInterface(__uuidof(IDXGIDevice), (void **)&pDXGIDevice);
IDXGIAdapter * pDXGIAdapter;
pDXGIDevice->GetAdapter(&pDXGIAdapter);
DXGI_ADAPTER_DESC adapterDesc;
pDXGIAdapter->GetDesc(&adapterDesc);

Instead you need to use the AMD Display Library (ADL) to find out which GPU is used for rendering. We’ve written a little sample application to do just that. Just run the application, and it will pop up a window that tells you whether it is running on the dGPU or iGPU. You can then play with the AMD Catalyst Control Center, change settings, and see the difference in behavior.

The code for this little example is available on the FirePro™ Developer Technologies Look for the file enumGPUType.zip in the Downloads section. The sample code shows you how to use ADL to identify which GPU is being used.

The sample works as follows:

  1. First, we check whether we are using a switchable graphics system. To do this we use this ADL call: ADL_PowerXpress_Scheme_Get. If we are not, then there’s nothing to do.
  2. If it is a switchable graphics system, then in the function GetGPUTypeFromProfile, it finds the application process name using win32 call GetModuleFileName.
  3. Finally we look in the application profile managed by the AMD Catalyst Control Center to find out which GPU is used by the application. To do this we call ADL_ApplicationProfiles_ProfileOfAnApplication_Search.

Windows 10

For Windows 10, Microsoft’s design and implementation for hybrid graphics (combined iGPU and dGPU) has changed. As a result, there is no method to programmatically force an application to use a specific GPU. You need to use the AMD Catalyst Control Center as described above.

While you can’t specify which GPU is used programmatically, you can still find out which is actually in use. For this case you can use the DX11 API to query which GPU is assigned to the application.

What this means is that the same code we showed above that doesn’t work on Windows 7 and 8, does work for Windows 10. This allows you to determine whether the application is running on the iGPU or dGPU in a hybrid graphics system.

IDXGIDevice * pDXGIDevice;
hr = g_pd3dDevice->QueryInterface(__uuidof(IDXGIDevice), (void **)&pDXGIDevice);
IDXGIAdapter * pDXGIAdapter;
pDXGIDevice->GetAdapter(&pDXGIAdapter);
DXGI_ADAPTER_DESC adapterDesc;
pDXGIAdapter->GetDesc(&adapterDesc);

For OpenGL, developers can still use glGetString(GL_RENDERER) to identify the GPU.

While it’s nice to be friendly to consumers, and AMD Enduro technology is great at extending battery life, sometimes developers need specific control. I hope this helps you manage your GPU more effectively when developing your software.


 

Benjamin Coquelle is a Member of Technical Staff and Software Development Engineer at AMD. Links to third party sites and references to third party trademarks, are provided for convenience and illustrative purposes only. Unless explicitly stated, AMD is not responsible for the contents of such links, and no third party endorsement of AMD or any of its products is implied.

Windows and DirectX are registered trademarks of Microsoft Corporation.

Read Next

Related Articles

All Articles
Community

Comments