From dcd9eb3c2ec1f729b12983bf5ee6395565871a22 Mon Sep 17 00:00:00 2001 From: Christian Beer Date: Tue, 5 Apr 2016 07:43:22 +0200 Subject: [PATCH] Client: fix nvidia_driver_version dlopen() On Debian only the versioned object can be opened. It usually is a symlink to the actual file. --- client/gpu_nvidia.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/client/gpu_nvidia.cpp b/client/gpu_nvidia.cpp index 5ca1640c3f..b7a8f5202e 100644 --- a/client/gpu_nvidia.cpp +++ b/client/gpu_nvidia.cpp @@ -105,8 +105,13 @@ static int nvidia_driver_version() { void *handle = NULL; char driver_string[81]; - handle = dlopen("libnvidia-ml.so", RTLD_NOW); - if (!handle) goto end; + handle = dlopen("libnvidia-ml.so.1", RTLD_NOW); + if (!handle) { + handle = dlopen("libnvidia-ml.so", RTLD_NOW); + if (!handle) { + goto end; + } + } nvml_driver = (int(*)(char *, unsigned int)) dlsym(handle, "nvmlSystemGetDriverVersion"); nvml_init = (int(*)(void)) dlsym(handle, "nvmlInit");