Compare commits
No commits in common. "master" and "v2.1.2" have entirely different histories.
@ -55,7 +55,6 @@ Available options:
|
||||
--watch N : Keep printing output every N seconds
|
||||
--overwrite : Overwrite previously displayed info with --watch and --compact instead of continuously logging new lines
|
||||
--color : Print headers in color in --compact mode for better readability
|
||||
--no-reasons : Do not query NVML for clocks reasons (can cause stuttering)
|
||||
```
|
||||
|
||||
### Examples:
|
||||
|
26
evga-icx.c
26
evga-icx.c
@ -37,10 +37,9 @@ static const char helpstring[] = "Available options:\n"
|
||||
"--compact : Print sensor reading in a compact one-line per card format\n"
|
||||
"--watch N : Keep printing output every N seconds\n"
|
||||
"--overwrite : Overwrite previously displayed info with --watch and --compact instead of continuously logging\n"
|
||||
"--color : Print headers in color in --compact mode for better readability\n"
|
||||
"--no-reasons : Do not query NVML for clocks reasons (can cause stuttering)\n";
|
||||
"--color : Print headers in color in --compact mode for better readability\n";
|
||||
|
||||
void print_gpu_info(int gpu_num, struct card_info gpus[], int compact, int no_reasons);
|
||||
void print_gpu_info(int gpu_num, struct card_info gpus[], int compact);
|
||||
|
||||
int main (int argc, char **argv)
|
||||
{
|
||||
@ -51,7 +50,6 @@ int main (int argc, char **argv)
|
||||
int gpu_num = -1; /* Card to control */
|
||||
int i2c_bus = -1;
|
||||
int overwrite = 0;
|
||||
int no_reasons = 0;
|
||||
unsigned int watch = 0;
|
||||
char *fan_speed[ICX3_MAX_FANS] = {NULL};
|
||||
|
||||
@ -112,8 +110,6 @@ int main (int argc, char **argv)
|
||||
} else if (strcmp(argv[i], "--color") == 0) {
|
||||
header_start = HEADER_COLOR_START;
|
||||
header_end = HEADER_COLOR_END;
|
||||
} else if (strcmp(argv[i], "--no-reasons") == 0) {
|
||||
no_reasons = 1;
|
||||
} else {
|
||||
printf(helpstring);
|
||||
return 0;
|
||||
@ -188,10 +184,10 @@ int main (int argc, char **argv)
|
||||
for (int i = 0; i < gpu_count; i++){
|
||||
if (i > 0)
|
||||
printf("\n");
|
||||
print_gpu_info(i, &gpus[i], compact, no_reasons);
|
||||
print_gpu_info(i, &gpus[i], compact);
|
||||
}
|
||||
} else if (gpu_num <= gpu_count - 1) {
|
||||
print_gpu_info(gpu_num, &gpus[gpu_num], compact, no_reasons);
|
||||
print_gpu_info(gpu_num, &gpus[gpu_num], compact);
|
||||
}
|
||||
|
||||
if (!overwrite)
|
||||
@ -213,7 +209,7 @@ int main (int argc, char **argv)
|
||||
#endif
|
||||
}
|
||||
|
||||
void print_gpu_info(int gpu_num, struct card_info *gpu, int compact, int no_reasons) {
|
||||
void print_gpu_info(int gpu_num, struct card_info *gpu, int compact) {
|
||||
if (compact) {
|
||||
/* One line per GPU */
|
||||
printf("%s#%d FAN%s", header_start, gpu_num, header_end);
|
||||
@ -245,10 +241,8 @@ void print_gpu_info(int gpu_num, struct card_info *gpu, int compact, int no_reas
|
||||
#ifdef USE_NVML
|
||||
printf("%s MEM %s", header_start, header_end);
|
||||
printf("%3d%%", get_nvml_mem_util(gpu));
|
||||
if (!no_reasons) {
|
||||
printf("%s CLK %s", header_start, header_end);
|
||||
print_nvml_clock_reason(1, gpu);
|
||||
}
|
||||
printf("%s CLK %s", header_start, header_end);
|
||||
print_nvml_clock_reason(1, gpu);
|
||||
#endif
|
||||
|
||||
|
||||
@ -278,10 +272,8 @@ void print_gpu_info(int gpu_num, struct card_info *gpu, int compact, int no_reas
|
||||
|
||||
#ifdef USE_NVML
|
||||
printf("Mem util: %d%%\n", get_nvml_mem_util(gpu));
|
||||
if (!no_reasons) {
|
||||
printf("Clock reasons: ");
|
||||
print_nvml_clock_reason(0, gpu);
|
||||
}
|
||||
printf("Clock reasons: ");
|
||||
print_nvml_clock_reason(0, gpu);
|
||||
printf("\n");
|
||||
#endif
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user