Skip to content
Merged
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 lib/coproc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ void COPROCS::summary_string_json(string &out) {
if (!strlen(cp.opencl_prop.name)) continue;
if (!out.empty()) out += ",\n";
summary_json(buf2,
"opencl",
cp.type,
cp.opencl_prop.vendor,
cp.opencl_prop.name,
cp.count,
(int)((double)cp.opencl_prop.global_mem_size/MEGA),
cp.opencl_prop.opencl_device_version,
Comment on lines 239 to 246
Expand Down
53 changes: 43 additions & 10 deletions sched/plan_class_spec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -870,8 +870,23 @@ bool PLAN_CLASS_SPEC::check(
}
}

// custom GPU type
// other (OpenCL) GPU type
//
} else if (have_gpu_type_regex) {
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
for (int i=1; i<sreq.coprocs.n_rsc; i++) {
if (!regexec(&(gpu_type_regex), sreq.coprocs.coprocs[i].type, 0, NULL, 0)) {
cpp = &sreq.coprocs.coprocs[i];
break;
}
}
Comment on lines +876 to +881
if (!cpp) {
if (config.debug_version_select) {
log_messages.printf(MSG_NORMAL,
"[version] plan_class_spec: No gpu_type match found\n"
);
}
return false;
}
Comment on lines +875 to +889
} else if (strlen(gpu_type)) {
cpp = sreq.coprocs.lookup_type(gpu_type);
if (!cpp) {
Expand All @@ -882,12 +897,14 @@ bool PLAN_CLASS_SPEC::check(
}
return false;
}
}
if (cpp) {
if (config.debug_version_select) {
log_messages.printf(MSG_NORMAL,
"[version] plan_class_spec: Custom coproc %s found\n", gpu_type
"[version] plan_class_spec: OpenCL coproc %s found\n", cpp->type
);
}
if (cpp->bad_gpu_peak_flops("Custom GPU", msg)) {
if (cpp->bad_gpu_peak_flops("OpenCL coproc", msg)) {
log_messages.printf(MSG_NORMAL, "%s\n", msg.c_str());
}
Comment on lines +901 to 909
}
Comment on lines +901 to 910
Expand Down Expand Up @@ -934,7 +951,7 @@ bool PLAN_CLASS_SPEC::check(

// general GPU
//
if (strlen(gpu_type)) {
if (cpp) {

// GPU RAM
//
Expand Down Expand Up @@ -1028,10 +1045,10 @@ bool PLAN_CLASS_SPEC::check(
} else if (!strcmp(gpu_type, "nvidia")) {
hu.proc_type = PROC_TYPE_NVIDIA_GPU;
hu.gpu_usage = gpu_usage;
} else if (strstr(gpu_type, "intel")==gpu_type) {
} else if (strstr(gpu_type, "intel") == gpu_type) {
hu.proc_type = PROC_TYPE_INTEL_GPU;
hu.gpu_usage = gpu_usage;
} else if (strstr(gpu_type, "apple_gpu")==gpu_type) {
} else if (strstr(gpu_type, "apple_gpu") == gpu_type) {
hu.proc_type = PROC_TYPE_APPLE_GPU;
hu.gpu_usage = gpu_usage;
} else {
Expand Down Expand Up @@ -1221,6 +1238,8 @@ int PLAN_CLASS_SPEC::parse(XML_PARSER& xp) {
if (xp.parse_bool("project_prefs_default_true", project_prefs_default_true)) continue;
if (xp.parse_double("avg_ncpus", avg_ncpus)) continue;

// GPU info
//
if (xp.parse_double("cpu_frac", cpu_frac)) continue;
if (xp.parse_double("min_gpu_ram_mb", min_gpu_ram_mb)) continue;
if (xp.parse_double("gpu_ram_used_mb", gpu_ram_used_mb)) continue;
Expand All @@ -1231,10 +1250,6 @@ int PLAN_CLASS_SPEC::parse(XML_PARSER& xp) {
if (xp.parse_int("min_driver_version", min_driver_version)) continue;
if (xp.parse_int("max_driver_version", max_driver_version)) continue;
if (xp.parse_str("gpu_utilization_tag", gpu_utilization_tag, sizeof(gpu_utilization_tag))) continue;
if (xp.parse_long("min_wu_id", min_wu_id)) {wu_restricted_plan_class = true; continue;}
if (xp.parse_long("max_wu_id", max_wu_id)) {wu_restricted_plan_class = true; continue;}
if (xp.parse_long("min_batch", min_batch)) {wu_restricted_plan_class = true; continue;}
if (xp.parse_long("max_batch", max_batch)) {wu_restricted_plan_class = true; continue;}

if (xp.parse_bool("need_ati_libs", need_ati_libs)) continue;
if (xp.parse_bool("need_amd_libs", need_amd_libs)) continue;
Expand All @@ -1256,14 +1271,31 @@ int PLAN_CLASS_SPEC::parse(XML_PARSER& xp) {
if (xp.parse_bool("double_precision_fp", double_precision_fp)) continue;

if (xp.parse_int("min_metal_support", min_metal_support)) continue;
if (xp.parse_str("gpu_type_regex", buf, sizeof(buf))) {
if (regcomp(&(gpu_type_regex), buf, REG_EXTENDED|REG_NOSUB) ) {
log_messages.printf(MSG_CRITICAL,
"BAD GPU TYPE REGEXP: %s\n", buf
);
return ERR_XML_PARSE;
}
have_gpu_type_regex = true;
continue;
}
Comment on lines +1274 to +1283

// Virtualbox
//
if (xp.parse_int("min_vbox_version", min_vbox_version)) continue;
if (xp.parse_int("max_vbox_version", max_vbox_version)) continue;
if (xp.parse_int("exclude_vbox_version", i)) {
exclude_vbox_version.push_back(i);
continue;
}
if (xp.parse_bool("vm_accel_required", vm_accel_required)) continue;

if (xp.parse_long("min_wu_id", min_wu_id)) {wu_restricted_plan_class = true; continue;}
if (xp.parse_long("max_wu_id", max_wu_id)) {wu_restricted_plan_class = true; continue;}
if (xp.parse_long("min_batch", min_batch)) {wu_restricted_plan_class = true; continue;}
if (xp.parse_long("max_batch", max_batch)) {wu_restricted_plan_class = true; continue;}
}
return ERR_XML_PARSE;
}
Expand Down Expand Up @@ -1338,6 +1370,7 @@ PLAN_CLASS_SPEC::PLAN_CLASS_SPEC() {
min_driver_version = 0;
max_driver_version = 0;
strcpy(gpu_utilization_tag, "");
have_gpu_type_regex = false;

need_ati_libs = false;
need_amd_libs = false;
Expand Down
2 changes: 2 additions & 0 deletions sched/plan_class_spec.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ struct PLAN_CLASS_SPEC {
// the project prefs tag for user-supplied gpu_utilization factor
double min_gpu_peak_flops;
double max_gpu_peak_flops;
bool have_gpu_type_regex;
regex_t gpu_type_regex;
Comment on lines +87 to +88

// AMD/ATI apps
//
Expand Down