- client: fix bug that could erroneously cause a GPU to

be "blocked by config file".


svn path=/trunk/boinc/; revision=25590
This commit is contained in:
David Anderson 2012-04-22 06:28:47 +00:00
parent 643c731411
commit d65cf2cb8a
3 changed files with 55 additions and 48 deletions

View File

@ -3441,3 +3441,11 @@ David 20 Apr 2012
client/
work_fetch.cpp
cs_prefs.cpp
David 21 Apr 2012
- client: fix bug that could erroneously cause a GPU to
be "blocked by config file".
client/
work_fetch.cpp
coproc_detect.cpp

View File

@ -197,30 +197,30 @@ CL_INFO __clGetDeviceInfo = NULL;
void* opencl_lib = NULL;
cl_int (*__clGetPlatformIDs)(
cl_uint /* num_entries */,
cl_platform_id * /* platforms */,
cl_uint * /* num_platforms */
cl_uint, // num_entries,
cl_platform_id*, // platforms
cl_uint * // num_platforms
);
cl_int (*__clGetPlatformInfo)(
cl_platform_id /* platform */,
cl_platform_info /* param_name */,
size_t /* param_value_size */,
void * /* param_value */,
size_t * /* param_value_size_ret */
cl_platform_id, // platform
cl_platform_info, // param_name
size_t, // param_value_size
void*, // param_value
size_t* // param_value_size_ret
);
cl_int (*__clGetDeviceIDs)(
cl_platform_id /* platform */,
cl_device_type /* device_type */,
cl_uint /* num_entries */,
cl_device_id * /* devices */,
cl_uint * /* num_devices */
cl_platform_id, // platform
cl_device_type, // device_type
cl_uint, // num_entries
cl_device_id*, // devices
cl_uint* // num_devices
);
cl_int (*__clGetDeviceInfo)(
cl_device_id /* device */,
cl_device_info /* param_name */,
size_t /* param_value_size */,
void * /* param_value */,
size_t * /* param_value_size_ret */
cl_device_id, // device
cl_device_info, // param_name
size_t, // param_value_size
void*, // param_value
size_t* // param_value_size_ret
);
#endif
@ -670,6 +670,7 @@ cl_int COPROCS::get_opencl_info(
// the OpenCL info into the CAL or CUDA data for the "best" CAL or CUDA GPU.
// This assumes that, for each GPU, we have previously correlated its CAL
// or CUDA device_num with its opencl_device_index.
//
void COPROC::merge_opencl(
vector<OPENCL_DEVICE_PROP> &opencls,
vector<int>& ignore_dev
@ -703,6 +704,7 @@ void COPROC::merge_opencl(
}
// This is called for ATI GPUs without CAL or NVIDIA GPUs without CUDA
//
void COPROC::find_best_opencls(
bool use_all,
vector<OPENCL_DEVICE_PROP> &opencls,
@ -1624,10 +1626,7 @@ void COPROCS::get_ati_mem_size_from_opengl() {
CGOpenGLDisplayMask myMask = 1 << i;
CGDirectDisplayID displayID = CGOpenGLDisplayMaskToDisplayID(myMask);
theErr2 = CGLQueryRendererInfo (myMask,
&info,
&numRenderers);
theErr2 = CGLQueryRendererInfo(myMask, &info, &numRenderers);
if ((displayID != kCGNullDirectDisplay) && (theErr2 == kCGLNoError)) {
// Get the I/O Kit service port for the display
io_registry_entry_t dspPort = CGDisplayIOServicePort(displayID);
@ -1637,9 +1636,11 @@ void COPROCS::get_ati_mem_size_from_opengl() {
if (true == rv) { // if openCL-capable
// what is the renderer ID
CGLDescribeRenderer (info, j, kCGLRPRendererID, &rendererIDs[i]);
modelName[i] = (CFDataRef)IORegistryEntrySearchCFProperty(dspPort,
modelName[i] = (CFDataRef)IORegistryEntrySearchCFProperty(
dspPort,
kIOServicePlane, CFSTR("model"), kCFAllocatorDefault,
kIORegistryIterateRecursively | kIORegistryIterateParents);
kIORegistryIterateRecursively | kIORegistryIterateParents
);
}
if (modelName[i] != NULL) break;
}
@ -1647,9 +1648,7 @@ void COPROCS::get_ati_mem_size_from_opengl() {
}
} // End if (log_flags.coproc_debug) {
theErr2 = CGLQueryRendererInfo (0xffffffff,
&info,
&numRenderers);
theErr2 = CGLQueryRendererInfo( 0xffffffff, &info, &numRenderers);
if (theErr2 == kCGLNoError) {
CGLDescribeRenderer (info, 0, kCGLRPRendererCount, &numRenderers);
for (i = 0; i < numRenderers; i++) {
@ -1660,17 +1659,17 @@ void COPROCS::get_ati_mem_size_from_opengl() {
CGLDescribeRenderer (info, i, kCGLRPAcceleratedCompute, &rv);
if (true == rv) { // if openCL-capable
// what is the renderer ID
CGLDescribeRenderer (info, i, kCGLRPRendererID,
&rendererID);
CGLDescribeRenderer (info, i, kCGLRPRendererID, &rendererID);
// what is the VRAM?
CGLDescribeRenderer (info, i, kCGLRPVideoMemory,
&deviceVRAM);
CGLDescribeRenderer (info, i, kCGLRPVideoMemory, &deviceVRAM);
// build context and context specific info
CGLPixelFormatAttribute attribs[] = { kCGLPFARendererID,
CGLPixelFormatAttribute attribs[] = {
kCGLPFARendererID,
(CGLPixelFormatAttribute)rendererID,
kCGLPFAAllowOfflineRenderers,
(CGLPixelFormatAttribute)0 };
(CGLPixelFormatAttribute)0
};
CGLPixelFormatObj pixelFormat = NULL;
GLint numPixelFormats = 0;
CGLContextObj cglContext;

View File

@ -98,7 +98,7 @@ void set_no_rsc_config() {
}
p.no_rsc_config[j] = true;
for (int k=0; k<c.count; k++) {
if (allowed[k]) {
if (allowed[c.device_nums[k]]) {
p.no_rsc_config[j] = false;
break;
}