• Olli Etuaho's avatar
    Get NVIDIA driver version from NVML on 64-bit Windows · 1241aea5
    Olli Etuaho authored
    NVML provides a more reliable way to query for the NVIDIA driver
    version. It also provides a query for NVIDIA CUDA compute capability
    which corresponds to the GPU generation. This is a good value to use
    for filtering GPUs based on hardware properties.
    
    We now query NVML for driver version and CUDA compute capability in
    case an NVIDIA GPU is encountered on Windows. NVML is loaded
    dynamically from %ProgramW6432%/NVIDIA Corporation/NVSMI/nvml.dll.
    In recent drivers the library is only shipped as a 64-bit binary, so
    it won't load in case the 32-bit build of Chromium is used.
    
    As a fallback, the actual NVIDIA driver version is parsed from the
    driver version in the Windows registry. This best-effort parsing
    should work for most versions, though every single version may not
    conform to the expected format.
    
    NVML has been present in NVIDIA drivers since version 270 published in
    2011. Some functionality in NVML is exclusive to professional Quadro
    or Tesla GPUs, but basic functionality like the queries used here are
    available across NVIDIA GPU brands.
    
    BUG=693090
    
    Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
    Change-Id: I31b44021e00426fcfb2b850fea5d63c114c4569c
    Reviewed-on: https://chromium-review.googlesource.com/1108199Reviewed-by: default avatarWill Harris <wfh@chromium.org>
    Reviewed-by: default avatarNico Weber <thakis@chromium.org>
    Reviewed-by: default avatarScott Violet <sky@chromium.org>
    Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
    Reviewed-by: default avatarDominick Ng <dominickn@chromium.org>
    Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
    Cr-Commit-Position: refs/heads/master@{#581820}
    1241aea5
LICENSE 1.69 KB