cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

GL_AMD_performance_monitor / GL_ATI_meminfo

I find some extensions reported by the ATI non-free Linux drivers that appear to be relevant for performance analysis and profiling of OpenGL applications.  If GL_AMD_performance_monitor and GL_ATI_meminfo can be used to monitor performance or get information on memory they would be very useful.  Are any documentation or headers available for these extensions?

0 Likes
11 Replies
dar1243
Journeyman III

the documentation is here:

http://www.opengl.org/registry/specs/AMD/performance_monitor.txt

http://www.opengl.org/registry/specs/ATI/meminfo.txt

BTW: those counters are realy usefull

0 Likes

Thanks for the links.  I added the following function to my program:

#include "ati_meminfo.h"
#include <stdio.h>
#include <GL/glut.h>

#define VBO_FREE_MEMORY_ATI          0x87FB
#define TEXTURE_FREE_MEMORY_ATI      0x87FC
#define RENDERBUFFER_FREE_MEMORY_ATI 0x87FD

void
ati_meminfo (void)
{
  GLint param[4];

  glGetIntegerv (VBO_FREE_MEMORY_ATI, param);
  printf ("VBO_FREE_MEMORY_ATI\n");
  printf ("  Total memory free in the pool: %i Kbyte\n", param[0]);
  printf ("  Largest available free block in the pool: %i Kbyte\n", param[1]);
  printf ("  Total auxiliary memory free: %i Kbyte\n", param[2]);
  printf ("  Largest auxiliary free block: %i Kbyte\n", param[3]);
  printf ("\n");

  glGetIntegerv (TEXTURE_FREE_MEMORY_ATI, param);
  printf ("TEXTURE_FREE_MEMORY_ATI\n");
  printf ("  Total memory free in the pool: %i Kbyte\n", param[0]);
  printf ("  Largest available free block in the pool: %i Kbyte\n", param[1]);
  printf ("  Total auxiliary memory free: %i Kbyte\n", param[2]);
  printf ("  Largest auxiliary free block: %i Kbyte\n", param[3]);
  printf ("\n");

  glGetIntegerv (RENDERBUFFER_FREE_MEMORY_ATI, param);
  printf ("RENDERBUFFER_FREE_MEMORY_ATI\n");
  printf ("  Total memory free in the pool: %i Kbyte\n", param[0]);
  printf ("  Largest available free block in the pool: %i Kbyte\n", param[1]);
  printf ("  Total auxiliary memory free: %i Kbyte\n", param[2]);
  printf ("  Largest auxiliary free block: %i Kbyte\n", param[3]);
  printf ("\n");

  return;
}

I am working on an "ATI Mobility Redeon HD 2400 XT" with 128 MB of dedicated DDR3 memory.  Running the function just after creating the OpenGL context with GLUT I was suprised to see the following output:

VBO_FREE_MEMORY_ATI
  Total memory free in the pool: 86619 Kbyte
  Largest available free block in the pool: 86615 Kbyte
  Total auxiliary memory free: 1535668 Kbyte
  Largest auxiliary free block: 13056 Kbyte

TEXTURE_FREE_MEMORY_ATI
  Total memory free in the pool: 86619 Kbyte
  Largest available free block in the pool: 86615 Kbyte
  Total auxiliary memory free: 1535668 Kbyte
  Largest auxiliary free block: 13056 Kbyte

RENDERBUFFER_FREE_MEMORY_ATI
  Total memory free in the pool: 86619 Kbyte
  Largest available free block in the pool: 86615 Kbyte
  Total auxiliary memory free: 1535668 Kbyte
  Largest auxiliary free block: 13056 Kbyte

I was expecting the pool to be closer to my 128 MB of dedicated memory.  Is there any way to trace where that memory went?

Also, I am primarilly using display lists to manage my geometry.  Which pool (vertex buffer, texture, render buffer) should I expect display lists to use - or do display lists not take advantage of my dedicated graphics memory?

0 Likes

Following the sample usage in http://www.opengl.org/registry/specs/AMD/performance_monitor.txt I get the following errors:

undefined reference to `glGetPerfMonitorGroupsAMD'
undefined reference to `glGetPerfMonitorCountersAMD'

Are the implementations for these included in the Linux non-free drivers?

0 Likes

for the first question:

Some dedicated memory is eaten by the primary surface

(YourDesktopSizeX*YourDesktopSizeY*4)

some by your app primary fbo

(YourAppWindowSizeX*YourAppWindowsSizeY*(sizeof(Pixel)+sizeof(ZBufferPixel)))

Finally some by other system/app initial needs

so the number you get is perfectly OK

 

For the second question - on windows glGetPerMonitorGroupsAMD/glGetPerfMonitorCountersAMD works just fine

and are valid functions - i do not know if they are OK on linux

0 Likes

Thanks for the info dar1243.  I did a quick check of the libraries distributed with the Catalyst 9.3 drivers for Linux but it looks like the functions for GL_AMD_performance_monitor are missing:

$ nm -D /usr/lib/libatiadlxx.so | grep -i amd
$ nm -D /usr/lib/libfglrx_tvout.so.1 | grep -i amd
$ nm -D /usr/lib/libXvBAW.so.1 | grep -i amd
$ nm -D /usr/lib/libGL.so.1 | grep -i amd
$ nm -D /usr/lib/libAMDXvBA.so.1 | grep -i amd
$ nm -D /usr/lib/libfglrx_gamma.so.1 | grep -i amd

This is pretty disappointing.

0 Likes

Hello,

I just wanted to mention that GPU PerfStudio 2.1 has been made available which adds OpenGL support and includes a very useful Frame Profiler for performance analysis and is based on the GL_AMD_performance_monitor extension. Currently it only supports Windows and not Linux (sorry). I'll see what we can do about adding in a visualization of memory usage to a future release.

http://developer.amd.com/gpu/PerfStudio/Pages/default.aspx

0 Likes

Thanks for the heads up on GPU PerfStudio 2.1.  The screenshots look very cool.  A Linux version would be very exciting.  If the GUI is already in a cross-platform API and a Linux port could be done I am sure it would be very well received.

The ultimate tool would provide a look at resource utilization including stream processors and GPU memory for OpenCL and well as OpenGL profiling.  Even just pure API access via GL_AMD_performance_monitor exentions would go a long way for Linux developers.  As per the previous post, last I checked these functions were not implemented in the Linux libraries.  If they could be added there as a first step that would be great.

0 Likes

nm -D libGL.so | grep Perf
000000000007d1f0 T glBeginPerfMonitorAMD
000000000007eab0 T glDeletePerfMonitorsAMD
000000000007f350 T glEndPerfMonitorAMD
000000000007fc90 T glGenPerfMonitorsAMD
0000000000080bb0 T glGetPerfMonitorCounterDataAMD
0000000000080bd0 T glGetPerfMonitorCounterInfoAMD
0000000000080bf0 T glGetPerfMonitorCounterStringAMD
0000000000080c10 T glGetPerfMonitorCountersAMD
0000000000080c30 T glGetPerfMonitorGroupStringAMD
0000000000080c50 T glGetPerfMonitorGroupsAMD
00000000000850d0 T glSelectPerfMonitorCountersAMD

catalyst 9.12, i have older catalyst. but i do not find it in 9.9. do not know about 9.10 and 9.11

0 Likes

Excellent.  Thanks for the note nou.  Indeed I do find these definitions in fglrx 9.12.  I'll have to put together some test code and try them out.

0 Likes

In general, the performance monitor extension will not be much use to you. There are approximately 89 counter groups, and the counter names in each group are simply "001", "002", "003","004", etc with a total of over 9,600 individual counters.

We are working on releasing a separate library for accessing these counters and making sense of them (the same library that is used by GPU PerfStudio 2.1). I'll see what I can do about Linux support in this library.

 

 

0 Likes

Thanks for the information on the counter groups plohrmann.  Indeed if the access and usage of the counters could be released as a library on Linux that would be very handy.  Providing a traditional library interface with documentation would allow the Linux communitiy to potentially integrate the library with existing profiling GUIs.

0 Likes