Fixes to overwrite mode

This commit is contained in:
2026-09-30 00:35:04 -07:00
parent 3f3e03755f
commit a8bea7b62c
3 changed files with 12 additions and 12 deletions
-5
View File
@@ -165,11 +165,6 @@ void print_blackwell_info(int compact, int overwrite, struct card_info *gpu)
printf("DRAM min: %+.0f°C\n", (float)dram_min);
printf("DRAM max: %+.0f°C\n", (float)dram_max);
}
if (overwrite)
printf("\x1b[1G");
else
printf("\n");
return;
}
}
+12 -2
View File
@@ -227,6 +227,8 @@ int main (int argc, char **argv)
}
#ifdef USE_DCGM
if (compact && (gpu_count > 0))
printf("\n");
print_dcgm(compact, overwrite);
#endif
@@ -234,9 +236,17 @@ int main (int argc, char **argv)
printf("\n"); /* Print line break at the end for continuous output */
if (overwrite && compact) {
int total_lines = 0;
if (print_board_sensors) total_lines++;
if (gpu_count > 0) {
total_lines += (gpu_num == -1) ? gpu_count : 1;
}
#ifdef USE_DCGM
total_lines++;
#endif
printf("\x1b[1G"); /* Move cursor back to column 1 */
if (gpu_count > 1 || print_board_sensors)
printf("\x1b[%dA", gpu_count-1+print_board_sensors); /* Move cursor back up to the top of gpu list */
if (total_lines > 1)
printf("\x1b[%dA", total_lines - 1); /* Move cursor back up to the top */
}
fflush(stdout);
-5
View File
@@ -102,11 +102,6 @@ void print_dcgm(int compact, int overwrite)
printf(" (0x%llx)", clock_reasons);
else
printf("%-15s", " ");
if (overwrite)
printf("\x1b[1G");
else
printf("\n");
}
int update_field_values(unsigned int gpu_id, dcgmFieldValue_v1 *values, int num_values, void *userdata)