Hardware Acceleration

How do you know in Linux/glx if the rendering is being done on hardware? I believe in Windows there was some kind of wglGetInfo call that would display either Microsoft x.x (indicating software rendering) or NVidia (indicating hardware). What is the equivalent command in glx?

Thanks for the help.

There’s no command for that on glx, but maybe typing glxinfo on a terminal. Also, simply checking the vendor version of gl inside a program could suffice.

But typing glxinfo in a terminal won’t tell me if my particaulr application is using hardware rendering. If I understand correctly, it should be similar to Windows - where depending on what kind of rendering context you request, you may end up rendering in software rather than on the card. It was an application dependent issue, not system dependent.

How do you check the vendor version? This is different than just the version of gl that is running I assume?

Thanks for the reply.

I just found the way to check the vendor version:

glXGetClientString( dpy, GLX_VENDOR)

(thanks for the tip)

It returns ATI which I assume means that it is rendering on the card. What is the microsoft equivalent of vendor (on linux) if it were in software rendering? Mesa?

Thanks again.

Read “direct rendering” (DRI) value from “glxinfo” output in linux.

If DRI is on, it is hardware accelerated.

However, using Mesa does not mean you are always in software mode. XFree86 and Xorg support hardware acceleration on several video cards through DRI . (usually older video cards)

Again, correct me if I’m wrong, but checking glxinfo in a terminal does NOT tell you if the particular application that I’m writing is using hardware or software rendering, correct? This is definitely the case in windows, and I’m guessing linux is similar. It should be dependent on what “XVisualInfo” you request and are given in the application. e.g. if you request a 32 bit buffer but only 16 is supported by the card, it will result in software rendering. I know this is the case for windows (via requesting pixel formats) - but it seems that linux perhaps just fails if it can’t provide a format that matches rather than giving you the nearest match?

“glxinfo” gives you proficient info whether your linux box is hardware accelerated or not. If “direct rendering” is enabled, then your application CAN be run in hardware mode.

Note that a specific client vendor string does NOT guarantee you are in hardware mode.

Try this; Unload “dri” kernel module from your X config file and re-run “glxinfo”. You will still see “ATI” in client vendor string, but the OpenGL program will be run slowly or crashed.

Well I guess that’s the key difference I’m looking to find out - does it run slower or does it crash? I need to be able to know when my application is run on other machines, will it just fail if it can’t get hardware rendering? Or will it run slower because it is using software rendering - in which case, how would we know without verifying some speed benchmark? In Windows, if you determine that the vendor string (during the application running, not just in a terminal) is the hardware vendor after you’ve retrieved your rendering context, then you know you have hardware rendering. Is this not true for linux?