From a8bea7b62c32e62c5d6e3a924c2365e75099eba5 Mon Sep 17 00:00:00 2001 From: moosecrap Date: Wed, 30 Sep 2026 00:35:04 -0700 Subject: [PATCH] Fixes to overwrite mode --- blackwell-sensors.c | 5 ----- evga-icx.c | 14 ++++++++++++-- nvidia-dcgm.c | 5 ----- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/blackwell-sensors.c b/blackwell-sensors.c index 755ef89..7c83804 100644 --- a/blackwell-sensors.c +++ b/blackwell-sensors.c @@ -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; } } diff --git a/evga-icx.c b/evga-icx.c index e019bd3..47bf18f 100644 --- a/evga-icx.c +++ b/evga-icx.c @@ -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); diff --git a/nvidia-dcgm.c b/nvidia-dcgm.c index 24fe29e..db25a50 100644 --- a/nvidia-dcgm.c +++ b/nvidia-dcgm.c @@ -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)