Merge pull request #1522 from BOINC/nvidia_version-fix

Client: fix nvidia_driver_version dlopen()
This commit is contained in:
Rom Walton 2016-04-05 07:11:33 -04:00
commit a2a1ee720d
1 changed files with 7 additions and 2 deletions

View File

@ -105,8 +105,13 @@ static int nvidia_driver_version() {
void *handle = NULL; void *handle = NULL;
char driver_string[81]; char driver_string[81];
handle = dlopen("libnvidia-ml.so", RTLD_NOW); handle = dlopen("libnvidia-ml.so.1", RTLD_NOW);
if (!handle) goto end; if (!handle) {
handle = dlopen("libnvidia-ml.so", RTLD_NOW);
if (!handle) {
goto end;
}
}
nvml_driver = (int(*)(char *, unsigned int)) dlsym(handle, "nvmlSystemGetDriverVersion"); nvml_driver = (int(*)(char *, unsigned int)) dlsym(handle, "nvmlSystemGetDriverVersion");
nvml_init = (int(*)(void)) dlsym(handle, "nvmlInit"); nvml_init = (int(*)(void)) dlsym(handle, "nvmlInit");