Blackwell die, system, and VRAM temps.
Code reorganization to better support non-iCX cards.
This commit is contained in:
+13
-23
@@ -13,10 +13,8 @@
|
||||
#include "nvidia-dcgm.h"
|
||||
#endif
|
||||
|
||||
#ifdef USE_LIBPCI
|
||||
#include "gddr6.h"
|
||||
#endif
|
||||
|
||||
#include "blackwell-sensors.h"
|
||||
#include "gddr6.h"
|
||||
#include "icx3.h"
|
||||
#include "evga-card.h"
|
||||
#include "board-sensors.h"
|
||||
@@ -150,6 +148,8 @@ int main (int argc, char **argv)
|
||||
|
||||
/* Scan for supported GPUs */
|
||||
gpu_count = find_evga_gpu_i2cs(gpus, MAX_GPUS, i2c_bus);
|
||||
/* Scan for supported Blackwell GPUs */
|
||||
gpu_count = find_blackwell_gpus(gpus, gpu_count, MAX_GPUS);
|
||||
|
||||
/* Check for no GPUs found or other errors */
|
||||
if (gpu_count == -1) {
|
||||
@@ -202,12 +202,6 @@ int main (int argc, char **argv)
|
||||
init_dcgm();
|
||||
#endif
|
||||
|
||||
/* PCI init for VRAM/hotspot temps */
|
||||
#ifdef USE_LIBPCI
|
||||
for (int i = 0; i < gpu_count; i++)
|
||||
init_gddr6(&gpus[i]);
|
||||
#endif
|
||||
|
||||
/* print sensor info */
|
||||
if (print_info) {
|
||||
do {
|
||||
@@ -216,21 +210,25 @@ int main (int argc, char **argv)
|
||||
|
||||
if (print_board_sensors)
|
||||
print_board_info(board_sensors, board_sensor_count);
|
||||
|
||||
#ifdef USE_DCGM
|
||||
print_dcgm(compact, overwrite);
|
||||
#endif
|
||||
|
||||
if (gpu_num == -1) {
|
||||
/* No GPU specified on command line, loop over all supported GPUs */
|
||||
for (int i = 0; i < gpu_count; i++){
|
||||
if (i > 0)
|
||||
printf("\n");
|
||||
print_gpu_info(i, &gpus[i]);
|
||||
if (gpus[i].i2c_dev_path == NULL) {
|
||||
print_blackwell_info(compact, overwrite, &gpus[i]);
|
||||
} else {
|
||||
print_gpu_info(i, &gpus[i]);
|
||||
}
|
||||
}
|
||||
} else if (gpu_num <= gpu_count - 1) {
|
||||
print_gpu_info(gpu_num, &gpus[gpu_num]);
|
||||
}
|
||||
|
||||
#ifdef USE_DCGM
|
||||
print_dcgm(compact, overwrite);
|
||||
#endif
|
||||
|
||||
if (!overwrite)
|
||||
printf("\n"); /* Print line break at the end for continuous output */
|
||||
@@ -344,16 +342,12 @@ void print_gpu_info(int gpu_num, struct card_info *gpu)
|
||||
for (int i = 0; i < ICX3_NUM_TEMP_SENSORS; i++) {
|
||||
if (i > 0 && strncmp(icx3_temp_sensor_names[i], icx3_temp_sensor_names[i-1], 3))
|
||||
printf("%s %.3s%s", header_start, icx3_temp_sensor_names[i], header_end);
|
||||
#ifdef USE_LIBPCI
|
||||
if (strncmp(icx3_temp_sensor_names[i], "MEM1", 4) == 0)
|
||||
printf(" %3.0f", get_vram_temp(gpu)); /* Print the VRAM temp before the rest of the memory sensors */
|
||||
#endif
|
||||
printf(" %3.0f", icx_temp_sensors[i]);
|
||||
}
|
||||
|
||||
#ifdef USE_LIBPCI
|
||||
printf("%s HOT%s %3.0f", header_start, header_end, get_hotspot_temp(gpu));
|
||||
#endif
|
||||
|
||||
printf("°C ");
|
||||
|
||||
@@ -378,18 +372,14 @@ void print_gpu_info(int gpu_num, struct card_info *gpu)
|
||||
float icx_temp_sensors[ICX3_NUM_TEMP_SENSORS] = {};
|
||||
get_temp_sensors(icx_temp_sensors, gpu);
|
||||
for (int i = 0; i < ICX3_NUM_TEMP_SENSORS; i++) {
|
||||
#ifdef USE_LIBPCI
|
||||
if (strncmp(icx3_temp_sensor_names[i], "MEM1", 4) == 0)
|
||||
printf("VRAM: +%.0f°C\n", get_vram_temp(gpu)); /* Print the VRAM temp before the rest of the memory sensors */
|
||||
#endif
|
||||
printf("%s: %+.1f°C\n",
|
||||
icx3_temp_sensor_names[i],
|
||||
icx_temp_sensors[i]);
|
||||
}
|
||||
|
||||
#ifdef USE_LIBPCI
|
||||
printf("HotSpot: +%.0f°C\n", get_hotspot_temp(gpu));
|
||||
#endif
|
||||
|
||||
#ifdef USE_NVML
|
||||
printf("Mem util: %d%%\n", get_nvml_mem_util(gpu));
|
||||
|
||||
Reference in New Issue
Block a user