diff --git a/client/gpu_detect.cpp b/client/gpu_detect.cpp index feb1eddef0b..90b5cae0184 100644 --- a/client/gpu_detect.cpp +++ b/client/gpu_detect.cpp @@ -833,7 +833,7 @@ void COPROCS::bound_counts() { } void gpu_warning(vector &warnings, const char* msg) { - fprintf(stderr, "%s\n", msg); + fprintf(stderr, "[%s] %s\n", time_to_string(dtime()), msg); warnings.push_back(msg); } diff --git a/client/gpu_nvidia.cpp b/client/gpu_nvidia.cpp index d8b4985e098..ce033552bc7 100644 --- a/client/gpu_nvidia.cpp +++ b/client/gpu_nvidia.cpp @@ -584,7 +584,7 @@ static void get_available_nvidia_ram(COPROC_NVIDIA &cc, vector& 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; @@ -592,24 +592,28 @@ static void get_available_nvidia_ram(COPROC_NVIDIA &cc, vector& warnings 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) { - retval = (*p_cuMemGetInfo_v2)(&memfree, &memtotal); - } - else { + // cuMemGetInfo_v2() always returns 201 (no context) + if (p_cuMemGetInfo) { retval = (*p_cuMemGetInfo)(&memfree, &memtotal); - } - if (retval) { snprintf(buf, sizeof(buf), - "[coproc] cuMemGetInfo(%d) returned %d", cc.device_num, retval + "cuMemGetInfo() returned %d; dev %d free %zu total %zu", + retval, cc.device_num, memfree, memtotal ); gpu_warning(warnings, buf); - (*p_cuCtxDestroy)(ctx); - return; + } else if (p_cuMemGetInfo_v2) { + retval = (*p_cuMemGetInfo_v2)(&memfree, &memtotal); + snprintf(buf, sizeof(buf), + "cuMemGetInfo_v2() returned %d; dev %d free %zu total %zu", + retval, cc.device_num, memfree, memtotal + ); + gpu_warning(warnings, buf); + } else { + gpu_warning(warnings, "No MemGetInfo function available"); } (*p_cuCtxDestroy)(ctx); cc.available_ram = (double) memfree; diff --git a/client/gpu_opencl.cpp b/client/gpu_opencl.cpp index 27c5b3c7162..1008e5d9606 100644 --- a/client/gpu_opencl.cpp +++ b/client/gpu_opencl.cpp @@ -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"); prop.peak_flops = GPU_DEFAULT_PEAK_FLOPS; }