Frame-Based Instant Capture

Introduction

The GPU PerfStudio server has the ability to run an application for a specified number of frames and then automatically perform a frame capture. This works for any application but is really designed to be used with re-playable workloads generated by such tools as ApiTrace (https://github.com/apitrace/apitrace)

Usage

Since the client is not used to perform the capture, the setup for instant capture is done in the "GPUPerfServer.cfg" file, an example of which is shown in the previous section. To enable Instant capture, comment in (remove the leading '#') from the

# capture-frame=150

line and change the value to the required frame number to stop at. When an application is run with GPU PerfStudio, a frame counter is used to count the number of frames rendered (starting at 1). Once the frame counter reaches the value specified, the frame will be captured. In the example here, the application will run until frame 150 is reached, and frame 150 will be captured. The application will appear to pause once a capture has been performed, and will behave as if the client was used to pause the application. A message will be shown in the log and in the GPU PerfStudio console window indicating that a capture was completed.

Once a frame has been captured, it is simply a case of loading the client and connecting to the server. Since the capture has already been performed, the tool icons (frame debugger, frame profiler and API trace) will be available for use immediately (there is no need to pause the application).

Advanced Options

The "GPUPerfServer.cfg" file also has a number of frame capture variables which can be changed. These are replicated from the client since the client options aren't available to the server.

Subsequent Frame Instant Capture

After analyzing a particular frame, it is sometimes useful to be able to step forward a number of frames and perform another automatic capture. GPU PerfStudio now allows this facility. Previously this could have been done by pressing the blue 'pause' button but it isn't very accurate, particularly for high frame rate applications where only a few frames need to be skipped.

From the Frame Debugger settings, ensure that the "AutoCapture subsequent frames" check box is checked, and in the "Number of frames to advance before next capture" edit box, enter the number of frames to skip before automatically capturing the next frame. For example, entering a value of 10 will cause the application to run normally for 10 frames and then perform an automatic capture.

When the application is paused, the AutoCapture settings can be changed and will be applied each time the application is resumed. It is also possible to enable or disable AutoCapture for subsequent frames when the application is paused.

This feature is designed to work optimally for playing back trace files but can also be used to step through live applications. Since GPU PerfStudio intercepts the timing functions, stepping forward a single frame in some applications may not work as expected. The application may either appear frozen or may appear to skip forward in time. In both these cases, change the Number of frames to advance before next capture to 2 or greater.