Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hmem/cuda: avoid stub loading at runtime #10365

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions fabtests/common/hmem_cuda.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ int ft_cuda_init(void)
goto err;
}

cuda_handle = dlopen("libcuda.so", RTLD_NOW);
cuda_handle = dlopen("libcuda.so.1", RTLD_NOW);
if (!cuda_handle) {
FT_ERR("Failed to dlopen libcuda.so\n");
FT_ERR("Failed to dlopen libcuda.so.1\n");
goto err_dlclose_cudart;
}

Expand Down
15 changes: 5 additions & 10 deletions src/hmem_cuda.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,22 +487,17 @@ static int cuda_hmem_dl_init(void)
return -FI_ENOSYS;
}

cuda_attr.driver_handle = dlopen("libcuda.so", RTLD_NOW);
cuda_attr.driver_handle = dlopen("libcuda.so.1", RTLD_NOW);
if (!cuda_attr.driver_handle) {
FI_WARN(&core_prov, FI_LOG_CORE,
"Failed to dlopen libcuda.so\n");
"Failed to dlopen libcuda.so.1\n");
goto err_dlclose_cuda_runtime;
}

cuda_attr.nvml_handle = dlopen("libnvidia-ml.so", RTLD_NOW);
cuda_attr.nvml_handle = dlopen("libnvidia-ml.so.1", RTLD_NOW);
if (!cuda_attr.nvml_handle) {
FI_INFO(&core_prov, FI_LOG_CORE,
"Failed to dlopen libnvidia-ml.so. Trying libnvidia-ml.so.1\n");
cuda_attr.nvml_handle = dlopen("libnvidia-ml.so.1", RTLD_NOW);
if (!cuda_attr.nvml_handle) {
FI_WARN(&core_prov, FI_LOG_CORE,
"Failed to dlopen libnvidia-ml.so or libnvidia-ml.so.1, bypassing nvml calls\n");
}
FI_WARN(&core_prov, FI_LOG_CORE,
"Failed to dlopen libnvidia-ml.so.1, bypassing nvml calls\n");
}

CUDA_DRIVER_FUNCS_DEF(CUDA_DRIVER_FUNCS_DLOPEN)
Expand Down
Loading