Add temperature to standard output where possible and use more compact output.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
diff --git a/main.c b/main.c
index 88a7ed8..36da7cd 100644
--- a/main.c
+++ b/main.c
@@ -1669,6 +1669,17 @@ static void text_print_status(int thr_id)
{
struct cgpu_info *cgpu = thr_info[thr_id].cgpu;
+#ifdef HAVE_ADL
+ if (cgpu->has_adl) {
+ int gpu = cgpu->cpu_gpu;
+
+ printf("GPU %d: [%.1f °C] [%.1f/%.1f Mh/s] [Q:%d A:%d R:%d HW:%d E:%.0f%% U:%.2f/m]\n",
+ cgpu->cpu_gpu, gpu_temp(gpu), cgpu->rolling,
+ cgpu->total_mhashes / total_secs, cgpu->getworks,
+ cgpu->accepted, cgpu->rejected, cgpu->hw_errors,
+ cgpu->efficiency, cgpu->utility);
+ } else
+#endif
printf(" %sPU %d: [%.1f / %.1f Mh/s] [Q:%d A:%d R:%d HW:%d E:%.0f%% U:%.2f/m]\n",
cgpu->is_gpu ? "G" : "C", cgpu->cpu_gpu, cgpu->rolling,
cgpu->total_mhashes / total_secs, cgpu->getworks,
@@ -1724,6 +1735,10 @@ static void curses_print_status(int thr_id)
wmove(statuswin, gpucursor + gpu, 0);
wprintw(statuswin, " GPU %d: ", gpu);
+#ifdef HAVE_ADL
+ if (cgpu->has_adl)
+ wprintw(statuswin, "[%.1f °C] ", gpu_temp(gpu));
+#endif
if (cgpu->status == LIFE_DEAD)
wprintw(statuswin, "[DEAD ");
else if (cgpu->status == LIFE_SICK)
@@ -1731,8 +1746,8 @@ static void curses_print_status(int thr_id)
else if (!gpu_devices[gpu])
wprintw(statuswin, "[DISABLED ");
else
- wprintw(statuswin, "[%.1f ", cgpu->rolling);
- wprintw(statuswin, "/ %.1f Mh/s] [Q:%d A:%d R:%d HW:%d E:%.0f%% U:%.2f/m]",
+ wprintw(statuswin, "[%.1f", cgpu->rolling);
+ wprintw(statuswin, "/%.1f Mh/s] [Q:%d A:%d R:%d HW:%d E:%.0f%% U:%.2f/m] ",
cgpu->total_mhashes / total_secs,
cgpu->getworks, cgpu->accepted, cgpu->rejected, cgpu->hw_errors,
cgpu->efficiency, cgpu->utility);
@@ -1746,7 +1761,7 @@ static void curses_print_status(int thr_id)
wmove(statuswin, cpucursor + cpu, 0);
- wprintw(statuswin, " CPU %d: [%.1f / %.1f Mh/s] [Q:%d A:%d R:%d E:%.0f%% U:%.2f/m]",
+ wprintw(statuswin, " CPU %d: [%.2f/%.2f Mh/s] [Q:%d A:%d R:%d E:%.0f%% U:%.2f/m] ",
cpu, cgpu->rolling, cgpu->total_mhashes / total_secs,
cgpu->getworks, cgpu->accepted, cgpu->rejected,
cgpu->efficiency, cgpu->utility);
@@ -1921,10 +1936,20 @@ static bool submit_upstream_work(const struct work *work)
if (!opt_realquiet)
print_status(thr_id);
- if (!want_per_device_stats)
+ if (!want_per_device_stats) {
+#ifdef HAVE_ADL
+ if (cgpu->has_adl) {
+ int gpu = cgpu->cpu_gpu;
+
+ applog(LOG_INFO, "GPU %d %.1f°C Q:%d A:%d R:%d HW:%d E:%.0f%% U:%.2f/m",
+ gpu, gpu_temp(gpu), cgpu->getworks, cgpu->accepted,
+ cgpu->rejected, cgpu->hw_errors, cgpu->efficiency, cgpu->utility);
+ } else
+#endif
applog(LOG_INFO, "%sPU %d Q:%d A:%d R:%d HW:%d E:%.0f%% U:%.2f/m",
cgpu->is_gpu? "G" : "C", cgpu->cpu_gpu, cgpu->getworks, cgpu->accepted,
cgpu->rejected, cgpu->hw_errors, cgpu->efficiency, cgpu->utility);
+ }
json_decref(val);
@@ -3166,23 +3191,45 @@ static void hashmeter(int thr_id, struct timeval *diff,
gettimeofday(&now, NULL);
timeval_subtract(&elapsed, &now, &thr->cgpu->last_message_tv);
if (opt_log_interval <= elapsed.tv_sec) {
+ struct cgpu_info *cgpu = thr->cgpu;
- thr->cgpu->last_message_tv = now;
+ cgpu->last_message_tv = now;
+#ifdef HAVE_ADL
+ if (cgpu->has_adl) {
+ int gpu = cgpu->cpu_gpu;
+
+ sprintf(
+ statusline,
+ "[GPU%d %.1f °C (%ds):%.1f (avg):%.1f Mh/s] [Q:%d A:%d R:%d HW:%d E:%.0f%% U:%.2f/m]",
+ cgpu->cpu_gpu,
+ gpu_temp(gpu),
+ opt_log_interval,
+ cgpu->rolling,
+ cgpu->total_mhashes / total_secs,
+ cgpu->getworks,
+ cgpu->accepted,
+ cgpu->rejected,
+ cgpu->hw_errors,
+ cgpu->efficiency,
+ cgpu->utility
+ );
+ } else
+#endif
sprintf(
statusline,
"[%sPU%d (%ds):%.1f (avg):%.1f Mh/s] [Q:%d A:%d R:%d HW:%d E:%.0f%% U:%.2f/m]",
- thr->cgpu->is_gpu ? "G" : "C",
- thr->cgpu->cpu_gpu,
+ cgpu->is_gpu ? "G" : "C",
+ cgpu->cpu_gpu,
opt_log_interval,
- thr->cgpu->rolling,
- thr->cgpu->total_mhashes / total_secs,
- thr->cgpu->getworks,
- thr->cgpu->accepted,
- thr->cgpu->rejected,
- thr->cgpu->hw_errors,
- thr->cgpu->efficiency,
- thr->cgpu->utility
+ cgpu->rolling,
+ cgpu->total_mhashes / total_secs,
+ cgpu->getworks,
+ cgpu->accepted,
+ cgpu->rejected,
+ cgpu->hw_errors,
+ cgpu->efficiency,
+ cgpu->utility
);
if (!curses_active) {
@@ -4533,7 +4580,7 @@ static void *watchdog_thread(void *userdata)
float temp = 0, vddc = 0;
if (gpu_stats(gpu, &temp, &engineclock, &memclock, &vddc, &activity, &fanspeed, &fanpercent, &powertune))
- applog(LOG_DEBUG, "T: %.1f°C F: %d%%(%dRPM) E: %dMHz M: %dMhz V: %.3fV A: %d%% P: %d%%",
+ applog(LOG_DEBUG, "%.1f°C F: %d%%(%dRPM) E: %dMHz M: %dMhz V: %.3fV A: %d%% P: %d%%",
temp, fanpercent, fanspeed, engineclock, memclock, vddc, activity, powertune);
}
#endif
@@ -4573,6 +4620,17 @@ static void log_print_status(int thr_id)
struct cgpu_info *cgpu;
cgpu = thr_info[thr_id].cgpu;
+#ifdef HAVE_ADL
+ if (cgpu->has_adl) {
+ int gpu = cgpu->cpu_gpu;
+
+ applog(LOG_WARNING, " GPU %d: [%.1f °C] [%.1f/%.1f Mh/s] [Q:%d A:%d R:%d HW:%d E:%.0f%% U:%.2f/m]",
+ gpu, gpu_temp(gpu), cgpu->rolling,
+ cgpu->total_mhashes / total_secs, cgpu->getworks,
+ cgpu->accepted, cgpu->rejected, cgpu->hw_errors,
+ cgpu->efficiency, cgpu->utility);
+ } else
+#endif
applog(LOG_WARNING, " %sPU %d: [%.1f / %.1f Mh/s] [Q:%d A:%d R:%d HW:%d E:%.0f%% U:%.2f/m]",
cgpu->is_gpu ? "G" : "C", cgpu->cpu_gpu, cgpu->rolling,
cgpu->total_mhashes / total_secs, cgpu->getworks,