- client: if an app version needs OpenCL/CUDA/CAL,

make sure that the GPU supports it
    (fix bug where sometimes, e.g. CUDA detection fails
    but OpenCL succeeds, and we have a CUDA app).


svn path=/trunk/boinc/; revision=25630
This commit is contained in:
David Anderson 2012-04-30 21:38:25 +00:00
parent 331114d961
commit d89b665ae0
2 changed files with 49 additions and 6 deletions

View File

@ -3663,3 +3663,12 @@ David 30 Apr 2012
client_state.h
cs_scheduler.cpp
cpu_sched.cpp
David 30 Apr 2012
- client: if an app version needs OpenCL/CUDA/CAL,
make sure that the GPU supports it
(fix bug where sometimes, e.g. CUDA detection fails
but OpenCL succeeds, and we have a CUDA app).
client/
client_types.cpp

View File

@ -723,6 +723,7 @@ int FILE_INFO::gunzip(char* md5_buf) {
int APP_VERSION::parse(XML_PARSER& xp) {
FILE_REF file_ref;
double dtemp;
int rt;
strcpy(app_name, "");
strcpy(api_version, "");
@ -745,7 +746,40 @@ int APP_VERSION::parse(XML_PARSER& xp) {
needs_network = false;
while (!xp.get_tag()) {
if (xp.match_tag("/app_version")) return 0;
if (xp.match_tag("/app_version")) {
rt = gpu_usage.rsc_type;
if (rt) {
if (strstr(plan_class, "opencl")) {
if (!coprocs.coprocs[rt].have_opencl) {
msg_printf(0, MSG_INFO,
"App version needs OpenCL but GPU doesn't support it"
);
missing_coproc = true;
missing_coproc_usage = gpu_usage.usage;
strcpy(missing_coproc_name, coprocs.coprocs[rt].type);
}
} else if (strstr(plan_class, "cuda")) {
if (!coprocs.coprocs[rt].have_cuda) {
msg_printf(0, MSG_INFO,
"App version needs CUDA but GPU doesn't support it"
);
missing_coproc = true;
missing_coproc_usage = gpu_usage.usage;
strcpy(missing_coproc_name, coprocs.coprocs[rt].type);
}
} else if (strstr(plan_class, "ati")) {
if (!coprocs.coprocs[rt].have_cal) {
msg_printf(0, MSG_INFO,
"App version needs CAL but GPU doesn't support it"
);
missing_coproc = true;
missing_coproc_usage = gpu_usage.usage;
strcpy(missing_coproc_name, coprocs.coprocs[rt].type);
}
}
}
return 0;
}
if (xp.parse_str("app_name", app_name, sizeof(app_name))) continue;
if (xp.match_tag("file_ref")) {
file_ref.parse(xp);
@ -775,15 +809,15 @@ int APP_VERSION::parse(XML_PARSER& xp) {
COPROC_REQ cp;
int retval = cp.parse(xp);
if (!retval) {
int rt = rsc_index(cp.type);
if (rt > 0) {
gpu_usage.rsc_type = rt;
gpu_usage.usage = cp.count;
} else {
rt = rsc_index(cp.type);
if (rt <= 0) {
missing_coproc = true;
missing_coproc_usage = cp.count;
strcpy(missing_coproc_name, cp.type);
continue;
}
gpu_usage.rsc_type = rt;
gpu_usage.usage = cp.count;
} else {
msg_printf(0, MSG_INTERNAL_ERROR, "Error parsing <coproc>");
}