Skip to content

Profiling allocator GPU memory usage with GPGMM

Bryan B edited this page Feb 14, 2023 · 1 revision

Why use GPGMM for GPU memory profiling?

GPU applications very typically rely on the ability to recycle larger OS allocated memory blocks by either sub-dividing them into smaller blocks or re-using the entire memory block once not being used. Because this happens by the application, above the OS, existing OS-level profiling tools are unable to accurately report memory usage without application-specific instrumentation. GPGMM provides this instrumentation to application developers.

Profiling memory usage through GPGMM event tracing.

GPGMM event tracing is able to report:

  1. Allocator performance and memory utilization metrics.
  2. Allocation lifetimes (static vs transient).
  3. Detailed API timings.
  4. Captured API calls for later (offline) playback.

To enable:

  1. Specify ALLOCATOR_RECORD_FLAGS option when creating the allocator.
  2. Run the app, where upon termination, a captured trace file will be dumped to the current working directory.
  3. Navigate to chrome://tracing, click the load button, then select the trace file to view.