AGX Xavier: Jetpack5 Rail power iio vs hwmon

We are migrating from JP4.4 to JP5.0.

The 4.9 kernel had these devices:

/sys/bus/iio/devices/iio:device0 (INA3221 chip #1)
/sys/bus/iio/devices/iio:device1 (INA3221 chip #2)

The 5.10 kernel has the INA3221 chips mapped as hwmon devices instead of iio devices:

/sys/bus/i2c/drivers/ina3221/1-0040/hwmon/hwmon1/
/sys/bus/i2c/drivers/ina3221/1-0041/hwmon/hwmon2/

The JP4.4 docs explained how to read the rail power:

I can’t find any explanation in the JP5.0 docs on how to get the power measurements.

Do these need to be calculated or can they be read from somewhere?

hello tjk,

it’s change to use hwmon, you may check the sysfs with $ cat hwmon*/name to understand the rail name.
please see-also developer guide, Software-Based Power Consumption Modeling for details.
thanks

I guess my question is, why is there no longer a power value that can be read directly in milliwatts? Should I just do the math in userspace (i.e Power = in_current x in_voltage)?

hello tjk,

yes, please do simple math for checking milliwatts.
here’s an example to read 1-0040/channel-1, it’s voltage and current of GPU’s power rail.

$ cat /sys/bus/i2c/drivers/ina3221/1-0040/hwmon/hwmon2/in1_label
VDD_GPU_SOC
$ cat /sys/bus/i2c/drivers/ina3221/1-0040/hwmon/hwmon2/in1_input
20000
$ cat /sys/bus/i2c/drivers/ina3221/1-0040/hwmon/hwmon2/curr1_input
140

BTW, you may check Tegrastats Utility — Jetson Linux<br/>Developer Guide 34.1 documentation.
it’ll also show the runtime power consumption in milliwatts.
for example,
$ sudo tegrastats
... VDD_GPU_SOC 3200mW/3200mW VDD_CPU_CV 400mW/400mW VIN_SYS_5V0 3220mW/3220mW NC 0mW/0mW VDDQ_VDD2_1V8AO 704mW/704mW NC 0mW/0mW

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.