Skip to content

scheduler: add <gpu_type_regex> plan class option.#7047

Merged
AenBleidd merged 2 commits intomasterfrom
dpa_plan_class2
Apr 29, 2026
Merged

scheduler: add <gpu_type_regex> plan class option.#7047
AenBleidd merged 2 commits intomasterfrom
dpa_plan_class2

Conversation

@davidpanderson
Copy link
Copy Markdown
Contributor

@davidpanderson davidpanderson commented Apr 29, 2026

If the client detects (via OpenCL) a GPU that's not one of the original 4 (NVIDIA, AMD, Intel, Apple)
it reports it to the scheduler with its model name as its 'type'.

A GPU plan class can now specify its GPU type with a regular expression that's matched against this.

This allows BOINC to use new GPU types -
such as integrated GPUs on ARM chips -
with no changes to client or server software.
All that's needed is for projects to develop applications, and to create plan classes with appropriate <gpu_type_regex>


Summary by cubic

Add gpu_type_regex to GPU plan classes so the scheduler can match OpenCL device model names and schedule apps on new GPU types (e.g., ARM iGPUs) without client updates. Also update the OpenCL summary JSON to report vendor and name (model).

  • New Features

    • Parse and compile gpu_type_regex; version selection tries it first, then gpu_type, with clearer debug logs.
    • Regex-matched devices now run the same GPU RAM and FLOPS checks as typed matches.
    • OpenCL summary JSON now emits vendor and name instead of a generic type.
  • Migration

    • Add gpu_type_regex (e.g., Mali|Adreno) to plan classes to enable new GPU families.
    • No client changes needed.

Written for commit 41785ec. Summary will update on new commits. Review in cubic

Copilot AI review requested due to automatic review settings April 29, 2026 09:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for selecting “other” (non-NVIDIA/AMD/Intel/Apple) OpenCL GPU types in scheduler plan classes using a <gpu_type_regex> match against the coprocessor-reported type/model, enabling projects to target emerging GPU vendors/models without client/server code changes.

Changes:

  • Extend PLAN_CLASS_SPEC to store and parse a compiled <gpu_type_regex> for GPU type matching.
  • Update plan class selection logic to pick an OpenCL coprocessor by regex when applicable.
  • Adjust OpenCL GPU JSON summarization to report vendor + model (instead of a generic "opencl" type).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
sched/plan_class_spec.h Adds have_gpu_type_regex and compiled regex_t storage in plan class spec.
sched/plan_class_spec.cpp Parses <gpu_type_regex> and uses it during plan class compatibility checks.
lib/opencl_boinc.h Clarifies that OPENCL_DEVICE_PROP::name represents the device model.
lib/coproc.cpp Changes JSON summary for non-core OpenCL devices to emit vendor as type and device name as model.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread sched/plan_class_spec.h
Comment on lines +87 to +88
bool have_gpu_type_regex;
regex_t gpu_type_regex;
Comment thread sched/plan_class_spec.cpp
Comment on lines +875 to +889
} else if (have_gpu_type_regex) {
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;
}
}
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 thread sched/plan_class_spec.cpp
Comment on lines +901 to 909
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", gpu_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());
}
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 4 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="sched/plan_class_spec.cpp">

<violation number="1" location="sched/plan_class_spec.cpp:875">
P1: Regex-matched GPUs bypass the general GPU validation block because that block is still gated by `strlen(gpu_type)`. Plan classes using only `gpu_type_regex` may skip RAM/driver-related constraints.</violation>

<violation number="2" location="sched/plan_class_spec.cpp:904">
P2: When the `have_gpu_type_regex` branch (or NVIDIA/AMD/Intel/Apple branches) sets `cpp`, `gpu_type` is empty, so this log message will print "OpenCL coproc  found" with a blank name. Use `cpp->type` or `cpp->opencl_prop.name` instead to produce a meaningful diagnostic.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread sched/plan_class_spec.cpp
Comment thread sched/plan_class_spec.cpp Outdated
If the client detects (via OpenCL) a GPU that's not one of the original 4
(NVIDIA, AMD, Intel, Apple)
it reports it to the scheduler with its model name as its 'type'.

A GPU plan class can now specify its GPU type with a regular expression
that's matched against this.

This allows BOINC to use new GPU types -
such as integrated GPUs on ARM chips -
with no changes to client or server software.
All that's needed is for projects to develop applications,
and to create plan classes with appropriate <gpu_type_regex>
Copilot AI review requested due to automatic review settings April 29, 2026 22:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds support for matching “other” OpenCL GPU devices via a new <gpu_type_regex> plan-class option, and adjusts OpenCL device reporting to expose vendor/name information for better scheduling on new GPU families.

Changes:

  • Introduce gpu_type_regex to plan class parsing and selection logic for OpenCL GPUs.
  • Apply the same GPU RAM/FLOPS checks to regex-matched devices as for typed devices.
  • Modify OpenCL summary JSON emission to output vendor/name rather than the previous generic type.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
sched/plan_class_spec.h Adds stored state for compiled GPU type regex.
sched/plan_class_spec.cpp Parses/compiles <gpu_type_regex> and uses it during GPU selection and validation.
lib/coproc.cpp Changes the OpenCL JSON summary fields to report vendor and model name.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread sched/plan_class_spec.cpp
Comment on lines +1274 to +1283
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 thread sched/plan_class_spec.cpp
Comment on lines +876 to +881
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 thread sched/plan_class_spec.cpp
if (!cpp) {
if (config.debug_version_select) {
log_messages.printf(MSG_NORMAL,
"[version] plan_class_spec: No gpu_type match found\n"
Comment thread sched/plan_class_spec.cpp
Comment on lines +901 to 910
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 thread lib/coproc.cpp
Comment on lines 239 to 246
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,
@AenBleidd AenBleidd merged commit c9237c2 into master Apr 29, 2026
471 checks passed
@AenBleidd AenBleidd deleted the dpa_plan_class2 branch April 29, 2026 23:48
@github-project-automation github-project-automation Bot moved this from In progress to Merged in Client/Manager Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Merged

Development

Successfully merging this pull request may close these issues.

3 participants