Skip to content

client: code cleanup in GPU detection#7046

Merged
AenBleidd merged 5 commits intomasterfrom
dpa_opencl2
Apr 29, 2026
Merged

client: code cleanup in GPU detection#7046
AenBleidd merged 5 commits intomasterfrom
dpa_opencl2

Conversation

@davidpanderson
Copy link
Copy Markdown
Contributor

@davidpanderson davidpanderson commented Apr 29, 2026

Don't confuse CUDA_DEVICE_PROP and OPENCL_DEVICE_PROP by having variables called 'prop'.

Remove unused code for Intel GPU detection.


Summary by cubic

Separate CUDA and OpenCL device properties, remove native Intel GPU detection, make Docker cleanup non-verbose, and drop an obsolete macOS VRAM workaround. This clarifies GPU detection, fixes macOS builds, and cleans up logs and XML/JSON output.

  • Refactors
    • Renamed prop to cuda_prop/opencl_prop across client, lib, and sched; updated comparisons, peak FLOPS, and JSON/XML parsing and writing.
    • Removed Intel GPU native get()/correlate() and unused fields; Intel GPUs now detected via OpenCL only; JSON/XML now use OpenCL name and driver version; removed Intel name/version fields from XML.
    • Standardized OpenCL handling; tightened NVIDIA/OpenCL correlation; propagated memory/clock data; deleted macOS ATI VRAM OpenGL workaround to resolve Mac builds.
    • Set Docker cleanup commands (ps --all, images) to non-verbose output.

Written for commit 5694c59. Summary will update on new commits. Review in cubic

We have two structures for GPU properties:
OPENCL_DEVICE_PROP and CUDA_DEVICE_PROP.
Let's not confuse them.
Change variables/fields called 'prop'
to either 'opencl_prop' or 'cuda_prop'.

COPROC_INTEL had fields 'name' and 'version'.
The former was a duplicate of the OpenCL name, the latter wasn't used.
Remove them.
they're detected only via OpenCL

Make Docker cleanup commands non-verbose
Copilot AI review requested due to automatic review settings April 29, 2026 00:21
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.

No issues found across 10 files

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

This PR focuses on GPU-detection code clarity by disambiguating CUDA vs OpenCL property naming and removing unused Intel-specific detection paths, while adjusting a small Docker cleanup behavior.

Changes:

  • Rename COPROC_NVIDIA::prop to cuda_prop and update scheduler/client usage accordingly.
  • Remove unused Intel GPU detection fields/methods and rely on OpenCL-based Intel GPU info.
  • Minor cleanup: clarify OpenCL device prop comments and reduce verbosity for Docker “list” commands.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
sched/sched_send.cpp Use cuda_prop for NVIDIA GPU RAM reporting.
sched/sched_customize.cpp Use cuda_prop for NVIDIA compute capability / SM count checks.
sched/plan_class_spec.cpp Use cuda_prop for NVIDIA compute capability and RAM.
lib/opencl_boinc.h Comment cleanup for OpenCL device name/vendor fields.
lib/coproc.h Rename NVIDIA CUDA prop member to cuda_prop; remove unused Intel fields/stubs; clarify COPROC::type meaning.
lib/coproc.cpp Update JSON summaries and NVIDIA XML/description/parse paths for cuda_prop; remove Intel name/version XML.
client/gpu_opencl.cpp Rename local OpenCL device variable to opencl_prop; remove unused test logic; update CUDA/OpenCL correlation assignments.
client/gpu_nvidia.cpp Update NVIDIA detection/compare logic to use cuda_prop.
client/gpu_detect.cpp Remove Intel get()/correlate() calls; rely on OpenCL detection/correlation.
client/cs_apps.cpp Make Docker “ps/images” listing non-verbose while keeping removal commands verbose.

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

Comment thread client/gpu_opencl.cpp Outdated
intel_gpu_opencls.push_back(opencl_prop);
intel_gpus.push_back(c);
#ifdef __APPLE__
} else if (is_apple(prop.vendor)) {
Copy link

Copilot AI Apr 29, 2026

Choose a reason for hiding this comment

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

In the Apple OpenCL branch, this still references prop.vendor, but the local variable was renamed to opencl_prop. This will fail to compile on APPLE. Update this condition to use the renamed variable (or avoid referencing an out-of-scope identifier).

Suggested change
} else if (is_apple(prop.vendor)) {
} else if (is_apple(opencl_prop.vendor)) {

Copilot uses AI. Check for mistakes.
Comment thread client/gpu_detect.cpp
Comment on lines 252 to 256
#if !defined(_M_ARM) && !defined(_M_ARM64)
nvidia.correlate(use_all, ignore_gpu_instance[PROC_TYPE_NVIDIA_GPU]);
#endif
ati.correlate(use_all, ignore_gpu_instance[PROC_TYPE_AMD_GPU]);
intel_gpu.correlate(use_all, ignore_gpu_instance[PROC_TYPE_INTEL_GPU]);
#ifdef __APPLE__
Copy link

Copilot AI Apr 29, 2026

Choose a reason for hiding this comment

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

This function still contains nvidia_gpus[i].prop.* references under #ifdef __APPLE__ later in the same function (e.g., the CUDA-driver >= 6.5 alert). Since COPROC_NVIDIA::prop was renamed to cuda_prop, those remaining uses will break Apple builds; update them to the new member name.

Copilot uses AI. Check for mistakes.
Also remove kludge workaround for problem that no longer exists
@AenBleidd
Copy link
Copy Markdown
Member

@davidpanderson, there is still a build issue on MacOS:

/Users/runner/work/boinc/boinc/client/gpu_opencl.cpp:694:33: error: use of undeclared identifier 'prop'
  694 |             } else if (is_apple(prop.vendor)) {
      |                                 ^
1 error generated.

Copilot AI review requested due to automatic review settings April 29, 2026 02:23
@davidpanderson
Copy link
Copy Markdown
Contributor Author

davidpanderson commented Apr 29, 2026 via email

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

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


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

Comment thread client/gpu_opencl.cpp
Comment on lines +138 to +141
if (NVIDIA_GPU_Index1 >= (int)nvidia_gpus.size()) return false;
// Should never happen
if (NVIDIA_GPU_Index2 >= (int)nvidia_gpus.size()) return false;
// Should never happen
Copy link

Copilot AI Apr 29, 2026

Choose a reason for hiding this comment

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

The indentation here is misleading (the comments appear visually associated with an if body that doesn’t exist) and can trigger compiler warnings like -Wmisleading-indentation. Prefer either moving the comment onto the same line, unindenting it, or adding braces around the if blocks so the structure is unambiguous.

Suggested change
if (NVIDIA_GPU_Index1 >= (int)nvidia_gpus.size()) return false;
// Should never happen
if (NVIDIA_GPU_Index2 >= (int)nvidia_gpus.size()) return false;
// Should never happen
if (NVIDIA_GPU_Index1 >= (int)nvidia_gpus.size()) {
// Should never happen
return false;
}
if (NVIDIA_GPU_Index2 >= (int)nvidia_gpus.size()) {
// Should never happen
return false;
}

Copilot uses AI. Check for mistakes.
Comment thread client/gpu_opencl.cpp
opencl_device_index++; // Another OpenCL device from same vendor
if (!strcmp(other_opencls[coproc_index].vendor, opencl_prop.vendor)) {
opencl_device_index++;
// Another OpenCL device from same vendor
Copy link

Copilot AI Apr 29, 2026

Choose a reason for hiding this comment

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

The over-indented comment on line 727 makes the block harder to read and looks like it belongs to a different nesting level. Align the comment with opencl_device_index++; (or attach it to that line) to avoid confusion during future edits.

Suggested change
// Another OpenCL device from same vendor
// Another OpenCL device from same vendor

Copilot uses AI. Check for mistakes.
Comment thread lib/opencl_boinc.h
Comment on lines +40 to +43
char name[256]; // model name
// e.g. Intel(R) UHD Graphics 630
char vendor[256]; // vendor
// e.g. Intel(R) Corporation
Copy link

Copilot AI Apr 29, 2026

Choose a reason for hiding this comment

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

The example lines are indented more than the surrounding struct members, which makes the documentation look like it’s nested code and reduces readability. Consider aligning these example comments with the member declarations (or folding them into the end-of-line comment) for consistent formatting.

Copilot uses AI. Check for mistakes.
@github-project-automation github-project-automation Bot moved this to In progress in Client/Manager Apr 29, 2026
@github-project-automation github-project-automation Bot moved this to Backlog in Server Apr 29, 2026
@AenBleidd AenBleidd added this to the Client/Manager 8.2.13 milestone Apr 29, 2026
@AenBleidd AenBleidd merged commit 39aaaf5 into master Apr 29, 2026
810 of 811 checks passed
@AenBleidd AenBleidd deleted the dpa_opencl2 branch April 29, 2026 21:44
@github-project-automation github-project-automation Bot moved this from In progress to Merged in Client/Manager Apr 29, 2026
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Server Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Merged
Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants