client (Unix): use dlerror() for GPU library failures; shows the filename

This commit is contained in:
David Anderson 2015-12-04 17:54:34 -08:00
parent a41adf92ab
commit bc8b9a5d9e
3 changed files with 6 additions and 3 deletions

View File

@ -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;
}

View File

@ -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");

View File

@ -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" );