37 lines
818 B
C
37 lines
818 B
C
#include <unistd.h>
|
|
#include <dirent.h>
|
|
#include <string.h>
|
|
#include <stdio.h>
|
|
#include <fcntl.h>
|
|
#include <stdlib.h>
|
|
|
|
#include "icx3.h"
|
|
#include "evga-card.h"
|
|
|
|
#define MAX_GPUS 16
|
|
|
|
int main (int argc, char **argv)
|
|
{
|
|
struct card_info gpus[MAX_GPUS];
|
|
int num_gpus;
|
|
|
|
num_gpus = find_evga_gpu_i2cs(gpus, MAX_GPUS);
|
|
|
|
if (num_gpus == -1) {
|
|
printf("Error scanning I2C devices\n");
|
|
return -1;
|
|
} else if (num_gpus == 0) {
|
|
printf("No supported GPUs found.\nAre you root or do you have udev access to i2c devices?\nDo you need to run `modprobe i2c-dev`?\n");
|
|
return -1;
|
|
}
|
|
|
|
for (int i = 0; i < num_gpus; i++){
|
|
printf("#%d: %s (%s) @ %s\n", i, gpus[i].card_name, gpus[i].i2c_dev_path, gpus[i].pci_id);
|
|
print_icx3_fans(gpus[i].i2c_dev_path);
|
|
print_icx3_temps(gpus[i].i2c_dev_path);
|
|
printf("\n");
|
|
}
|
|
|
|
}
|
|
|