浏览代码

Additional nvidial-ml path to check

Daniel Hiltgen 1 年之前
父节点
当前提交
1d1eb1688c
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      gpu/gpu_info_cuda.c

+ 3 - 0
gpu/gpu_info_cuda.c

@@ -8,6 +8,7 @@
 const char *cuda_lib_paths[] = {
 const char *cuda_lib_paths[] = {
     "libnvidia-ml.so",
     "libnvidia-ml.so",
     "/usr/local/cuda/lib64/libnvidia-ml.so",
     "/usr/local/cuda/lib64/libnvidia-ml.so",
+    "/usr/lib/x86_64-linux-gnu/nvidia/current/libnvidia-ml.so",
     "/usr/lib/wsl/lib/libnvidia-ml.so.1",  // TODO Maybe glob?
     "/usr/lib/wsl/lib/libnvidia-ml.so.1",  // TODO Maybe glob?
     NULL,
     NULL,
 };
 };
@@ -40,6 +41,8 @@ void cuda_init(cuda_init_resp_t *resp) {
     resp->ch.handle = LOAD_LIBRARY(cuda_lib_paths[i], RTLD_LAZY);
     resp->ch.handle = LOAD_LIBRARY(cuda_lib_paths[i], RTLD_LAZY);
   }
   }
   if (!resp->ch.handle) {
   if (!resp->ch.handle) {
+    // TODO improve error message, as the LOAD_ERR will have typically have the
+    // final path that was checked which might be confusing.
     snprintf(buf, buflen,
     snprintf(buf, buflen,
              "Unable to load %s library to query for Nvidia GPUs: %s",
              "Unable to load %s library to query for Nvidia GPUs: %s",
              cuda_lib_paths[0], LOAD_ERR());
              cuda_lib_paths[0], LOAD_ERR());