Does anyone have any suggestions on the best way to programmatically (C++) retrieve the video (nvidia/ati) driver version installed on a machine?
Currently I am using WMI queries to ask for the Win32_VideoController and then taking the “DriverVersion” and “AdapterRam” from there. For the most part this seems to retrieve accurate information.
However on some systems (particularly WinXp it seems) the driver version it returns is often “null” and/or a static file version number that never changes (no matter which driver you install). This is undesirable.
Does anyone know of a better way to get the driver version number?
If you’re happy to live in Windows-only land you could create a Direct3D object (before initializing OpenGL) and query that, but I don’t think it’ll give you exactly the info you’re looking for. Something like this is all you need anyway:
This gives the driver version in the long format (6.14.12.5896), where the last 5 digits is the same as the short format (258.96) that NVIDIA usually quotes.
If OpenCL support is included in the driver then you can call clGetDeviceInfo with the CL_DRIVER_VERSION enum.
Another possibility is to get the name of the driver file from:
SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\RIVATNT\dll
and then use GetFileVersionInfo/VerQueryValue to query the version.
Dark Photon - Most of our customers are on Windows, some on the Mac… none on Linux (although we dev guys keep a linux port)
mhagain - I had thought about doing that, at least for information such as Adapter ram (OpenGL/DirectX… no matter its the same ram).
Simon Arbon - I had thought about checking the registry but it seems that some systems don’t have that key? I found a Microsoft page mentioning that key as reserved for Video adapters though so at least I can search for it and if it is there I can use it (and if not then fall back on the WMI query).