4 Commits
Author SHA1 Message Date
moosecrap af2ceec405 Readme update for hwmon sensors 2025-06-08 02:40:23 -07:00
moosecrap 083d296f5b Help string fix 2025-04-13 02:34:56 -07:00
moosecrap f7021d7197 Fixes for overwriting console output in compact mode 2025-04-09 08:21:53 -07:00
moosecrap a9f8754922 Added support for latest kernel i2c sysfs 2025-03-27 04:32:55 -07:00
4 changed files with 19 additions and 11 deletions
+3
View File
@@ -36,6 +36,9 @@ Add the make flag `USE_NVML=1` and the it will also display the main GPU tempera
### VRAM and Hotspot temperature
Add the make flag `USE_LIBPCI=1` and you can also read the VRAM and "hotspot" temperatures. These require direct memory access to the PCI device so you must run as root and also enable the kernel parameter `iomem=relaxed`. These sensors are **extremely** undocumented so I can't say anything about their accuracy.
### Hardware monitoring
This program can also monitor hardware sensors using the standard linux `hwmon` API. See board-sensors.h for examples of how to configure these, they must be staticlly compiled in.
## Usage
Note that when controlling fans directly through iCX3 they will fall offline from the Nvidia driver and show as 0 RPM until you return them to automatic mode.
+14 -9
View File
@@ -10,9 +10,10 @@
and respond with the correct iCX3 version information */
int find_evga_gpu_i2cs(struct card_info *infos, int max_gpus, int i2c_bus)
{
char i2c_devices_path[NAME_MAX];
char device_path[NAME_MAX];
char dev_file[NAME_MAX];
char i2c_devices_path[PATH_MAX];
char device_path[PATH_MAX];
char dev_file[PATH_MAX];
char pci_path[PATH_MAX];
char *pci_addr;
FILE *test_fd;
@@ -55,10 +56,14 @@ int find_evga_gpu_i2cs(struct card_info *infos, int max_gpus, int i2c_bus)
continue;
/* Read the PCI info for the underlying device */
pci_vendor = read_pci_id(device_path, "/device/vendor");
pci_device = read_pci_id(device_path, "/device/device");
pci_subsystem_vendor = read_pci_id(device_path, "/device/subsystem_vendor");
pci_subsystem_device = read_pci_id(device_path, "/device/subsystem_device");
strcat(device_path, "/../");
if (realpath(device_path, pci_path) == NULL)
continue;
pci_vendor = read_pci_id(pci_path, "/vendor");
pci_device = read_pci_id(pci_path, "/device");
pci_subsystem_vendor = read_pci_id(pci_path, "/subsystem_vendor");
pci_subsystem_device = read_pci_id(pci_path, "/subsystem_device");
/* See if it's a matching device for a supported EVGA card */
for (int i = 0; i < (sizeof(evga_pci_ids) / sizeof(struct gpu_pci_info)); i++) {
@@ -97,7 +102,7 @@ int find_evga_gpu_i2cs(struct card_info *infos, int max_gpus, int i2c_bus)
unsigned short read_pci_id(char *device_path, char *field)
{
char buf[16];
char file_path[NAME_MAX];
char file_path[PATH_MAX];
strcpy(file_path, device_path);
strcat(file_path, field);
@@ -119,7 +124,7 @@ unsigned short read_pci_id(char *device_path, char *field)
char *read_nvidia_pci_address(char *device_path)
{
char file_path[NAME_MAX];
char file_path[PATH_MAX];
char *ret = calloc(16 + 1, sizeof(char)); /* assuming pci ids could look as large as 00000000:0C:00.0 */
+1 -1
View File
@@ -46,7 +46,7 @@ static const char helpstring[] = "Available options:\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 clock reasons (can cause stuttering)\n"
"--board : Also print temperatures from the CPU, motherboard, and other sensors";
"--board : Also print temperatures from the CPU, motherboard, and other sensors\n";
void print_gpu_info(int gpu_num, struct card_info gpus[]);
void print_board_info(struct hwmon_avail_sensor *board_sensors, int num_sensors);
+1 -1
View File
@@ -36,7 +36,7 @@ void print_nvml_clock_reason(int compact, struct card_info *card)
single_reason = 0;
if (compact)
printf("%s", clock_reason_names[i].short_name);
printf("%-15s", clock_reason_names[i].short_name);
else
printf("%s", clock_reason_names[i].long_name);
}