Skip to content

Commit

Permalink
client (Unix): use dlerror() for GPU library failures; shows the file…
Browse files Browse the repository at this point in the history
…name
  • Loading branch information
davidpanderson committed Dec 5, 2015
1 parent a41adf9 commit bc8b9a5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion client/gpu_amd.cpp
Expand Up @@ -160,7 +160,8 @@ void COPROC_ATI::get(

void* callib = dlopen("libaticalrt.so", RTLD_NOW);
if (!callib) {
warnings.push_back("No ATI library found");
sprintf(buf, "ATI: %s", dlerror());
warnings.push_back(buf);
return;
}

Expand Down
3 changes: 2 additions & 1 deletion client/gpu_nvidia.cpp
Expand Up @@ -287,7 +287,8 @@ void* cudalib = NULL;
cudalib = dlopen("libcuda.so", RTLD_NOW);
#endif
if (!cudalib) {
warnings.push_back("No NVIDIA library found");
sprintf(buf, "NVIDIA: %s", dlerror());
warnings.push_back(buf);
return;
}
__cuDeviceGetCount = (int(*)(int*)) dlsym(cudalib, "cuDeviceGetCount");
Expand Down
3 changes: 2 additions & 1 deletion client/gpu_opencl.cpp
Expand Up @@ -185,7 +185,8 @@ void COPROCS::get_opencl(
}
#endif
if (!opencl_lib) {
warnings.push_back("No OpenCL library found");
sprintf(buf, "OpenCL: %s", dlerror());
warnings.push_back(buf);
return;
}
__clGetPlatformIDs = (cl_int(*)(cl_uint, cl_platform_id*, cl_uint*)) dlsym( opencl_lib, "clGetPlatformIDs" );
Expand Down

0 comments on commit bc8b9a5

Please sign in to comment.