Intel® GPA 4 Tip: methods for attaching to your game (for analysis with Intel GPA System Analyzer HUD)

February 21, 2011 10:00 PM PST


Introduction
Intel® Graphics Performance Analyzers (Intel® GPA) is a graphics developer tool suite used to analyze and optimize PC games and media applications.

One of the key advantages of the product is the Intel GPA System Analyzer HUD can analyze your game without having to link with any special libraries or graphics drivers, nor do you need to modify your game code to use the tool.

With Intel GPA you have two choices for how the tool attaches to your game:
  • Intel GPA attaches to the game when you explicitly launch your game through the Intel GPA Monitor's "Analyze Application..." option
  • Intel GPA attaches to the game automatically through the use of the "Auto-detect launched applications" option of the Intel GPA Monitor
The rest of this document describes these two methods, and the pro's and con's of each method.

Using the "Analyze Application..." Option
This method provides an explicit means for connecting Intel GPA and your game. This method is recommended as the primary method of attaching Intel GPA to your game, and is most useful when your game can be started from the command line.

To enable this method, be sure that the Intel GPA Monitor is already running and it's icon is visible in the notification area. If it's not running, go to the Microsoft Windows* Start Menu for Intel GPA, and start the Intel GPA Monitor from there. Once it's running, right-click on the icon and select "Analyze Application...", as shown below:
monitor.jpg

When the dialog box appears (see below), select the application from the top of the dialog box (such as gpasample.exe) -- Intel GPA will then automatically copy the information from the last time you ran the game into the "command line" and "working folder" portions of the dialog box.
analyze.png

If this is the first time you are attaching to the game with Intel GPA, either "browse" to the pathname of your game (select the "..." icon on the far right), or explicitly enter the pathname and options that you wish to use, as well as the working folder (which may be different than where you run the game). In either case, select "Run" to startup your game and the Intel GPA System Analyzer HUD.

The key advantage of this approach is that Intel GPA only attaches to the game that you want to run, using the command line options and the "working folder" you specify for the game. The key disadvantage is that there may be some games that you can't attach to in this manner, especially if your game doesn't start up via the command line, but starts as a result of being spawned by another process.

Using the "Auto-detect launched applications" Option
Using this method, Intel GPA will attach to any application which starts after you start using this approach. To analyze your game with Intel GPA, you just startup your game as you would normally, such as from the Microsoft Windows* Start Menu.

To enable this method, see the previous method for starting up the Intel GPA Monitor and selecting "Preferences". The Intel GPA Monitor then displays a dialog box, where you'll select the "Auto-detect launched applications" checkbox, as shown here:
auto.png

Then, whenever any application starts Intel GPA will attach to that process; for applications that use Microsoft DirectX* the Intel GPA System Analyzer HUD will automatically start displaying metrics as an overlay on that application's window.

Though on the surface this approach appears very simple to use, it is not recommended for most game developers. The key disadvantage is that any process (and not just your game) that starts after you enable this option will result in the Intel GPA interceptor DLL attaching to that process -- this which may result in side effects such as unexpected application crashes. Therefore, we recommend that most developers use the manual approach described above. However, if you cannot use the manual approach, we suggest that you enable "Auto-detect launched applications" just before you run your game, then disable it immediately after your analysis with the Intel GPA System Analyzer HUD.

Closing Thoughts...
The latest version of Intel GPA, Version 4, has improved its internal process for attaching to your game, so the number of games that it can attach to has increased in this version. The net result is that using one of the two approaches outlined here should be able to allow your game or graphics application to be analyzed with Intel GPA. But the preferred method is to use the manual approach, as the automatic approach may result in unexpected side effects such as application crashes.

However, there are still some situations where Intel GPA can't attach to your game -- a key reason for this might be that the game utilizes encryption or other protection methods which keep Intel GPA from attaching to that process. In this case, the recommended approach is to obtain a version of the game that does not have these protection methods enabled.


* Other names and brands may be claimed as the property of others.