Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 5 of 5

Thread: Retrieve Video (Nvidia/ATI) Driver Version

  1. #1
    Junior Member Regular Contributor
    Join Date
    Apr 2005
    Location
    Toronto
    Posts
    126

    Retrieve Video (Nvidia/ATI) Driver Version

    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?

  2. #2
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    4,156

    Re: Retrieve Video (Nvidia/ATI) Driver Version

    Quote Originally Posted by PickleWorld
    Does anyone have any suggestions on the best way to programmatically (C++) retrieve the video (nvidia/ati) driver version installed on a machine?
    Not sure about Windows methods, but on Linux here are some options:

    * nvidia-settings -q NVidiaDriverVersion (or just run and look at GUI)
    * Look at the "OpenGL version string" in glxinfo output
    * Use libXNVCtrl and query NV_CTRL_STRING_NVIDIA_DRIVER_VERSION (see below for an example)
    * Look at /proc/driver/nvidia/version (slightly ugly)
    * Look in /var/log/Xorg.0.log (really ugly)

    Code :
      char *driver_name;
      XNVCTRLQueryStringAttribute( dpy, scr, 0, 
                                   NV_CTRL_STRING_NVIDIA_DRIVER_VERSION,
                                   &driver_name );
      printf( "GPU Driver     = %s\n", driver_name );

  3. #3
    Senior Member OpenGL Pro
    Join Date
    Jan 2007
    Posts
    1,716

    Re: Retrieve Video (Nvidia/ATI) Driver Version

    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:
    Code :
    D3DADAPTER_IDENTIFIER9 adapterinfo;
    LPDIRECT3D9 d3d_Object;
     
    d3d_Object = Direct3DCreate9 (D3D_SDK_VERSION);
    d3d_Object->GetAdapterIdentifier (D3DADAPTER_DEFAULT, 0, &adapterinfo);
    d3d_Object->Release ();
    Then check the members of your adapterinfo struct.

  4. #4
    Junior Member Regular Contributor
    Join Date
    Aug 2007
    Location
    Adelaide, South Australia
    Posts
    208

    Re: Retrieve Video (Nvidia/ATI) Driver Version

    My XP system stores the driver version in the registry under:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\
    Class\{4D36E968-E325-11CE-BFC1-08002BE10318)\0000\DriverVersion

    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.

  5. #5
    Junior Member Regular Contributor
    Join Date
    Apr 2005
    Location
    Toronto
    Posts
    126

    Re: Retrieve Video (Nvidia/ATI) Driver Version

    Thanks for the suggestions guys.

    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).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •