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 atlas_admin@aei.mpg.de

Unverified Commit fe67cd96 authored by David Anderson's avatar David Anderson Committed by Vitalii Koshura

When parsing NVIDIA driver version, max minor version with 99.

I guess we thought these would never exceed 99, but they do.
This is a temp workaround.
parent e5c69dc7
......@@ -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.
end:
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