Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion client/gpu_detect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ void COPROCS::bound_counts() {
}

void gpu_warning(vector<string> &warnings, const char* msg) {
fprintf(stderr, "%s\n", msg);
fprintf(stderr, "[%s] %s\n", time_to_string(dtime()), msg);
warnings.push_back(msg);
Comment on lines 835 to 837

Copilot AI Apr 13, 2026

Copy link

Choose a reason for hiding this comment

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

gpu_warning() now calls time_to_string(dtime()), but this file doesn't include str_util.h where time_to_string() is declared. This will fail to compile; include str_util.h (or otherwise ensure time_to_string is declared) in this translation unit.

Copilot uses AI. Check for mistakes.
}

Expand Down
19 changes: 10 additions & 9 deletions client/gpu_nvidia.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -584,30 +584,31 @@ static void get_available_nvidia_ram(COPROC_NVIDIA &cc, vector<string>& warnings
retval = (*p_cuDeviceGet)(&device, cc.device_num);
if (retval) {
snprintf(buf, sizeof(buf),
"[coproc] cuDeviceGet(%d) returned %d", cc.device_num, retval
"cuDeviceGet(%d) returned %d", cc.device_num, retval
);
gpu_warning(warnings, buf);
return;
}
retval = (*p_cuCtxCreate)(&ctx, 0, device);
if (retval) {
snprintf(buf, sizeof(buf),
"[coproc] cuCtxCreate(%d) returned %d", cc.device_num, retval
"cuCtxCreate(%d) returned %d", cc.device_num, retval
);
gpu_warning(warnings, buf);
return;
}
if (p_cuMemGetInfo_v2) {
// cuMemGetInfo_v2() always returns 201 (no context)
if (false && p_cuMemGetInfo_v2) {
retval = (*p_cuMemGetInfo_v2)(&memfree, &memtotal);
}
else {
} else {
retval = (*p_cuMemGetInfo)(&memfree, &memtotal);
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
Outdated
}
snprintf(buf, sizeof(buf),
"cuMemGetInfo() returned %d; dev %d free %zu total %zu",
retval, cc.device_num, memfree, memtotal
);
gpu_warning(warnings, buf);
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
Outdated
if (retval) {
snprintf(buf, sizeof(buf),
"[coproc] cuMemGetInfo(%d) returned %d", cc.device_num, retval
);
gpu_warning(warnings, buf);
(*p_cuCtxDestroy)(ctx);
return;
}
Expand Down
14 changes: 8 additions & 6 deletions client/gpu_opencl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -745,13 +745,15 @@ void COPROCS::get_opencl(
double freq = ((double)prop.max_clock_frequency) * MEGA;
prop.peak_flops = ((double)prop.max_compute_units) * freq;
}
char buf2[256];
snprintf(buf2, sizeof(buf2),
"OpenCL generic: peak FLOPS %f; Max units %u, max freq %u MHz",
prop.peak_flops,
prop.max_compute_units, prop.max_clock_frequency
);
gpu_warning(warnings, buf2);
if (prop.peak_flops <= 0 || prop.peak_flops > GPU_MAX_PEAK_FLOPS) {
char buf2[256];
snprintf(buf2, sizeof(buf2),
"OpenCL generic: bad peak FLOPS; Max units %u, max freq %u MHz",
prop.max_compute_units, prop.max_clock_frequency
);
gpu_warning(warnings, buf2);
gpu_warning(warnings, "bad peak flops value; using default");
Comment on lines +749 to +756

Copilot AI Apr 13, 2026

Copy link

Choose a reason for hiding this comment

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

This hunk introduces tab-indented lines (prop.peak_flops argument and the subsequent gpu_warning call), which are inconsistent with the surrounding space indentation and make the block harder to read/maintain. Replace the tabs with spaces to match the file’s existing indentation style.

Copilot uses AI. Check for mistakes.
prop.peak_flops = GPU_DEFAULT_PEAK_FLOPS;
Comment on lines 755 to 757

Copilot AI Apr 13, 2026

Copy link

Choose a reason for hiding this comment

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

The new warning message "bad peak flops value; using default" is ambiguous on its own (it doesn’t identify the device/vendor or the rejected value). Consider including at least the computed peak_flops (and/or vendor/name) so logs make sense when multiple devices are enumerated.

Copilot uses AI. Check for mistakes.
}

Expand Down
Loading