Gitlab@AEI Hannover will go down for maintenance on 2020-09-21 at 4:00 UTC. The service will be unavailable for up to 24 hours. If you have questions about this please contact

Unverified Commit 86458f2b authored by Vitalii Koshura's avatar Vitalii Koshura Committed by GitHub

Merge pull request #3897 from AenBleidd/dpa_nvidia_vers_clean

When parsing NVIDIA driver version, max minor version with 99.
parents e5c69dc7 fe67cd96
......@@ -103,7 +103,8 @@ static int nvidia_driver_version() {
int (*nvml_init)() = NULL;
int (*nvml_finish)() = NULL;
int (*nvml_driver)(char *f, unsigned int len) = NULL;
int dri_ver = 0;
int dri_ver = 0;
int major=0, minor=0;
void *handle = NULL;
char driver_string[81];
......@@ -122,8 +123,11 @@ static int nvidia_driver_version() {
if (nvml_init()) goto end;
if (nvml_driver(driver_string, 80)) goto end;
dri_ver = (int) (100. * atof(driver_string));
sscanf(driver_string, "%d.%d", &major, &minor);
dri_ver = major*100 + std::min(minor, 99);
// minor can in fact be > 99, at least on Linux
// encoding as MMnn doesn't work.
// this is a temporary workaround.
if (nvml_finish) nvml_finish();
if (handle) dlclose(handle);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment