Skip to content

Commit

Permalink
Fix crash on systems with cuda but not libnvidia-ml.so.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sthibaul committed Apr 2, 2024
1 parent 0818b90 commit 7d883b4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/drivers/cuda/driver_cuda.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,12 @@ void _starpu_cuda_discover_devices(struct _starpu_machine_config *config)
#ifdef STARPU_HAVE_NVML_H
void *nvml = dlopen("libnvidia-ml.so.1", RTLD_LAZY);

_starpu_nvmlInit = dlsym(nvml, "nvmlInit_v2");
if (!_starpu_nvmlInit)
_starpu_nvmlInit = dlsym(nvml, "nvmlInit");
if (nvml)
{
_starpu_nvmlInit = dlsym(nvml, "nvmlInit_v2");
if (!_starpu_nvmlInit)
_starpu_nvmlInit = dlsym(nvml, "nvmlInit");
}
if (_starpu_nvmlInit)
{
_starpu_nvmlDeviceGetNvLinkState = dlsym(nvml, "nvmlDeviceGetNvLinkState");
Expand Down

0 comments on commit 7d883b4

Please sign in to comment.