Client: fix nvidia_driver_version dlopen()

On Debian only the versioned object can be opened. It usually is a symlink to the actual file.
This commit is contained in:
Christian Beer 2016-04-05 07:43:22 +02:00
parent 2d5b8a246b
commit dcd9eb3c2e
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");