Units and Sampling Intervals for Jetson Orin Power Measurements

I am logging power consumption data, while running a load on the Jetson Orin Nano.

In the NVIDIA Jetson Developer Guide r39.2, it is mentioned that^

The Jetson Orin NX series and Jetson Orin Nano series modules have a 3-channel INA3221 power monitor at the 0x40 I2C address. The sysfs nodes to read for rail names, voltage, current, and the instantaneous and average current limit are available

Additionally, inside the INA3221 datasheet, it states:

The INA3221 has programmable conversion times for both the shunt- and bus-voltage measurements. The selectable conversion times for these measurements range from 140μs to 8.244ms.

Questions:

  • Where can I find the documented units for voltage, current and power provided by tegrastats?
  • What is the set conversation time for the INA3221?
  • For the instantaneous/average power, what are the sampling intervals? I would assume this is calculated on the Jetson, since the INA3221 does not provide this.

^The description for Channel 2 should be Total power consumed by CPU, GPU… not Total power consumed by CPU, CPU… 🙏

Hi,

I think there are two different timing concepts here that are easy to mix up: the INA3221 conversion/update rate and the tegrastats reporting interval.

For the units, according to the NVIDIA tegrastats documentation:

the power rails are reported as:

VDD_X current_mW/average_mW

So both values are in mW. The first one is the current power value and the second one is the average power value.

Regarding the INA3221 sampling time, the Linux driver documentation explains that the effective update interval depends on the number of enabled channels, averaging samples, bus conversion time and shunt conversion time:

The formula used there is basically:

update_interval = channels * samples * (bus_conversion_time + shunt_conversion_time)

The upstream Linux driver supports conversion times from 140 us up to 8244 us and averaging from 1 to 1024 samples:

The default config in the upstream driver is 0x7127, which corresponds to 1.1 ms for bus voltage and 1.1 ms for shunt voltage, with no averaging.

If all 3 channels are enabled, that would give around:

3 * (1.1 ms + 1.1 ms) = 6.6 ms

for one full measurement cycle.

That said, I would not assume Jetson is always using exactly that configuration. It would be better to check the actual runtime settings under /sys/class/hwmon/.

For example:

for h in /sys/class/hwmon/hwmon*; do
    if [ "$(cat "$h/name" 2>/dev/null)" = "ina3221" ]; then
        echo "$h"
        cat "$h/update_interval" 2>/dev/null
        cat "$h/samples" 2>/dev/null
    fi
done

One important thing is that tegrastats --interval 1000 does not mean the INA3221 is sampling every 1000 ms. That option only changes how often tegrastats prints/reports the values.

For example:

sudo tegrastats --interval 1000

means one report every 1000 ms, while the INA3221 can still be doing conversions much faster in the background.

Also, the INA3221 itself measures bus voltage and shunt voltage. Current is calculated from the shunt voltage and shunt resistance, and power is calculated from voltage and current in software. This is also described in the Linux INA3221 driver documentation:

The only part I am not completely sure about is how the second average value from tegrastats is implemented internally on the current Jetson Linux release.

NVIDIA has mentioned in previous forum threads that the average corresponds to measurements over the tegrastats interval, but I don’t think it is clearly documented whether tegrastats accumulates every INA3221 conversion or polls the hwmon interface at some other internal rate.

So if the question is specifically about the exact number of hardware samples included in something like a 1000 ms tegrastats average, I think NVIDIA would need to confirm the internal implementation.

David Badilla
Embedded SW Engineer at RidgeRun
Contact us: support@ridgerun.com
Developers wiki: https://developer.ridgerun.com
Website: www.ridgerun.com

Yes, thanks for splitting the timing into the INA3221 and tegrastats components.

Thanks for pointing to the Tegrastats utility page. The mW units are indeed provided. If this is the source, then the time period over which the average / current power is calculated should be mention too.

At the bottom of the page, it points to an --interval option, but this is for the logging interval (as you highlighted).

Note: The linked version of the documentation you provided is for r38.2 which does not support the Jetson Orin Nano. The latest version of the Tegrastats Utility documention for r39.2 can be found here


Thanks for pointing to the upstream kernel driver. I will need to read this in more detail. What I understand now is that the INA3221 provides a wide operating window, and it is up to the configured setting via I2C to determine the sampling time. Would appreciate if someone from NVIDIA can comment on how the average value for tegrastats is calculated.


To partially answer my own questions, with this new insight:

  1. Where can I find the documented units for voltage, current and power provided by tegrastats?
  2. What is the set conversation time for the INA3221?
  3. For the instantaneous/average power, what are the sampling intervals? I would assume this is calculated on the Jetson, since the INA3221 does not provide this.

Thanks for taking your time to write such a detailed response @david.badilla 😊