How to get driver version ?

I know that OpenGL can use glGetString to get vender, renderer and version … but how do you get the driver version ?

I need to support all Windows OS …

Andrew

  1. Right Click on Desktop
  2. Click Properties
  3. Click Settings tab
  4. Click Advanced button
  5. Click the tab that has the name of your video card on it*

Now the version will be in there.

*This works for nvidia drivers, if you have an ati or something else, you may have to go somewhere else after you click the Advanced button.

-SirKnight

I thought after posting that I’d get this response … thanks … but I need to get it programmatically !

Andrew

Win9x/Me: HKLM\Software\Microsoft\Windows\CurrentVersion\OpenGLdrivers
Win2K/XP: HKLM\Software\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers

In these registry keys, you will find the filename of the OpenGL ICD (e.g. nvoglnt.dll). You can read the version info resource from this DLL using the GetFileVersionInfo() API function. Note that the .DLL extension may or may not be present, so check for it.

– Tom

Thanks Tom … that’s just what I wanted !

Andrew

Sorry Tom … How do you know the KeyName ? Mine’s only got one key and that’s RIVATNT … is it safe just to use the fisrt value returned by GetValueNames ?

Thanks

Andrew

Technically if you have multiple video cards installed (or if you installed a new one without uninstalling the drivers of the old one), there may be more than one key. These cases are pretty rare, though.

– Tom

Several large vendors have system images with all kinds of interesting stuff in them. I would not assume that there will only be one entry.

This is really interesting since allows to pull out the dll name… not sure this is useful however.

In my app, I pull out the driver info from the following key:
“HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E968-E325-11CE-BFC1-08002BE10318}\0000”.
Now, I checked out two nv cards (geforce2 and geforce4) and a matrox card (G400) and looks to be just fine.
Too bad the key name itself does not make any sense at all to me.
From there, you can get video card type (as the OS sees it, usually similar to GL_RENDERER), who provided the driver and, most important of all, the driver version. This is however, a little different from what you expect. For example, nv driver 43.45 is described as “4.3.4.5”. Not a problem however.

The problem with this is that, it pulls out information on a single display device which may be not enough. In my opinion this is not a problem since I heard only the primary got GL acceleration. BTW, most computers (98%?) got a single video card.

Is there not an interface for this via directX for win32? That would seem a more reliable solution than reading stab-in-the-dark entries from the registry.
How do you get a driver version for Linux and Macs, while we’re at it?

Originally posted by knackered:
Is there not an interface for this via directX for win32?

I totally forgot that. I found the interesting structure in the DX sdk and I am going to try that out.
In the meanwhile, here’s my reference:
“D3DADAPTER_IDENTIFIER8”
filled using “GetAdapterIdentifier”.
Thank you for issuing that one!

EDIT - UPDATE:
Tried that out. Looks like it can be used without too much truoble. Here are the results of the query:

Driver: “nv4_disp.dll”, description: “NVIDIA GeForce4 Ti 4400”
Product = “6”
Version.SubVersion.Build = “14.10.4403”

The problem is that I don’t know how to should I look at the values in the ‘Product’ field. ‘Version’, ‘SubVersion’ also look unclear to me. ‘Build’ is actually the driver version as I know (NV 44.03). Can someone post queries on other video cards please?

[This message has been edited by Obli (edited 06-10-2003).]

What do the fields mean? I’ve got a XP system with 6.14.10.4403 nvidia drivers and a 2k system with 6.14.10.6343 ATI drivers and 1.04.00.068 Matrox Parhelia drivers.

I noticed the first three numbers are the same for nvidia and ATI. Is this a coincedence or does it mean something?

Should one just look at the last number or does x.y.z+1.w imply a newer driver than x.y.z.w-1?

I know of a couple “bad” drivers for nvidia and ati. I was thinking about detecting mtxogl.dll, atioglxx.dll, nvoglnt.dll (and whatever the win9x version is) in the system directory and getting whatever version it is. If it is less than a value I encode then I display a warning saying my app runs better with newer drivers. Of course I detect the vendor string in OpenGL first to know which one of those files to check.

Originally posted by Obli:
In my app, I pull out the driver info from the following key:
“HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E968-E325-11CE-BFC1-08002BE10318}\0000”.
In my opinion this is not a problem since I heard only the primary got GL acceleration. BTW, most computers (98%?) got a single video card.

FYI my computer here has 15 entries there from 0000 to 0014. 0000 is the Intel integrated graphics drivers that were originally installed. 0001 is an old ATI 9700 driver. 0002 is the same, but labeled “- Secondary” (BTW you can have OpenGL accelleration on a 2nd monitor as long as it is one video card which treats the desktop as a single really wide resolution.) 0003 is a GeForce2 and 0004 is my current 9700 driver, which is what I think corresponds to my current video card.

So… If you search 0000 it’ll be wrong. If you somehow detected I had a ATI 9700 and search all of them for ATI and 9700 you’d come up with four entries. I guess you could just do that and choose the newest version…

FWIW, I believe all recent ATI OpenGL drivers append a GL driver version onto the end of the version string. I am not sure if other vendors do this, but if they do this would obviously provide a more simple/robust solution to the issue.

For those planning on searching the path provided by the registry or looking in system32, be aware that a dll in the local directory can over-ride this. It isn’t that common a case, but you should be aware of the potential problem.

-Evan

[Edit for spelling]

[This message has been edited by ehart (edited 06-11-2003).]

btw, have you heard of DEVMODE structure in windows and the function EnumDisplaySettings? well, it can give you the info about the current display device and the info about driver version, as well as current or either registry settings

This might not be the best/most accurate alternative but it’s fairly simple.

When your app has a valid glcontext(your ogl icd is loaded for sure) enumerate dlls loaded in your process. Find dlls/modules that export some common function,such as DrvSetPixelFormat. Might be more than one if you have multiple video cards. Then get the filename and retrieve file version info.

NOTE: On MS OSs that lack the process status api(psapi) enumerating dlls might require some work. For older OSs check out the toolhelp32 api.

[This message has been edited by roffe (edited 06-11-2003).]

Originally posted by matt_weird:
btw, have you heard of DEVMODE structure in windows and the function EnumDisplaySettings? well, it can give you the info about the current display device and the info about driver version, as well as current or either registry settings

Just took a look. It effectively can. I pulled out the ‘dmDeviceName’ and ‘dmDriverVersion’ subfields. Now, the problem is that the documentation for EnumDisplaySettings says that “sets values for the following five DEVMODE members: dmBitsPerPel, dmPelsWidth, dmPelsHeight, dmDisplayFlags, dmDisplayFrequency”. Looks that in fact it also update these two and there are the results I am getting:

Device name = NV4_DISP
Driver version = 1025

This looks even more misterious to me. BTW, it may be the version of the GDI acceleration driver (if any)… I don’t know.

Originally posted by titan:
So… If you search 0000 it’ll be wrong. If you somehow detected I had a ATI 9700 and search all of them for ATI and 9700 you’d come up with four entries. I guess you could just do that and choose the newest version…

This was exactly the kind of reply I hoped to get. I would like to investigate more but I don’t have so much video adapters here so, can you tell us something more?
For example, my key “{4D36E968-E325-11CE-BFC1-08002BE10318}” contains a value called “Class” which is set on “Display”.
Maybe the current/primary card has a something set so we can recognize it (maybe “MatchingDeviceId”)?
The idea that you suggest (taking the highest number) looks promising and takes little time to implement. However, if correct it would mean that video driver informations are placed here in order of installation.
So you had intel integrated (and you said it’s ok), then the 9700 primary and secondary… then a GeForce2? another 9700? Looks strange. Is that really what you installed on your PC in that order?

The ‘official’ way of finding the driver dll is the following:

The key:
HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\VIDEO

contains a string:
\Device\Video0

The value points to another key, in my case:
\REGISTRY\Machine\System\ControlSet001\Services
v\Device0

This key always contains this string:
InstalledDisplayDrivers

In my case, the value is:
nv4_disp

The just do a GetFileVersionInfo() with .dll appended and there’s your version.

Source: http://support.microsoft.com/?kbid=200435

For my Radeon 9000, the version number of ati2dvag.dll (found using kansler’s method) is different from that of atioglxx.dll (the file we’re actually interested in).

– Tom

But the version of ati2dvag.dll is the version which ATI uses for it’s driver packages. So it’s usable as a test for current driver version. As stated in the first article of this post, the OpenGL version can be found by using glGetString().