Commit 306dad9fdb0f2e18a5e16997b25a78a06327d882

Con Kolivas 2011-09-04T10:27:21

Add gpu statistics to debugging output via the watchdog thread.

diff --git a/main.c b/main.c
index 08773ac..ef8e664 100644
--- a/main.c
+++ b/main.c
@@ -4368,8 +4368,18 @@ static void *watchdog_thread(void *userdata)
 				break;
 			thr = &thr_info[i];
 			gpu = thr->cgpu->cpu_gpu;
+#ifdef HAVE_ADL
 			if (adl_active)
 				gpu_autotune(gpu);
+			if (opt_debug && gpus[gpu].has_adl) {
+				int engineclock = 0, memclock = 0, activity = 0, fanspeed = 0, fanpercent = 0;
+				float temp = 0, vddc = 0;
+
+				if (gpu_stats(gpu, &temp, &engineclock, &memclock, &vddc, &activity, &fanspeed, &fanpercent))
+					applog(LOG_DEBUG, "T: %.1f°C  F: %d%%(%dRPM)  E: %dMHz  M: %dMhz  V: %.3fV  A: %d%%",
+					temp, fanpercent, fanspeed, engineclock, memclock, vddc, activity);
+			}
+#endif
 			/* Thread is waiting on getwork or disabled */
 			if (thr->getwork || !gpu_devices[gpu])
 				continue;