Is there a way to read the power consumption of the cpu, gpu, and perhaps any connected devices in watts? Perhaps similar to how one might read the temperature of the cpu from /sys/class/thermal/thermal_zone1/temp?
The easiest way to monitor power consuption is to use jtop. To install it, run this command:
sudo -H pip install -U jetson-stats
Then you can run:
Alternatively, if you are looking for a system file to get power consumption directly, run:
sudo cat /sys/bus/i2c/drivers/ina3221x/6-0040/iio:device0/in_power?_input
If you run this command with the question mark, you will get three values: total power consumption in mW (
in_power0_input), consumption by GPU in mW (
in_power1_input) and consumption by CPU in mW (
in_power2_input). If you have USB devices, real power consumption may be larger than reported by
Third way to monitor power consumption is by running:
Then look at
POM_5V_IN (total in mW)
POM_5V_GPU (GPU in mW) and
POM_5V_CPU (CPU in mW).
tegrastats show current and average power consumption (tegrastats shows this in
x is current power consumption and
y is average value).
Just curious, why might the real power consumption be larger than the reported power consumption if USB devices are connected?
It is just my experience: Jetson Nano without USB devices shows its power consumption with pretty good accuracy, but not anymore if USB devices are added. For example, I have 2.5K HDMI LCD powered by USB, its backlight alone consumes about 1W, not to mention consumption by HDMI controller. But Jetson Nano reports power consumption decrease of 375mW on average when I completely unplug the LCD, this is few times less than expected. When Jetson Nano is fully loaded and consumes almost 20W (due to all USB devices connected and overclocking), 1W makes little difference, but when Jetson Nano is in low power mode and consumes just 2.5-2.7W by itself, this difference of additional power consumption has very noticeable effect on battery life: for example, in this case, expected battery life should decrease by about 20% when the LCD is connected (based on power consumption increase measured by Jetson Nano), but it actually drops by more than 50% (as expected based on actual power consumption).
So total power consumption reported by Jetson Nano is only good as rough number to get an idea how much it approximately consumes but it is not useful to accurately measure power consumption by USB devices.
Obviously, if using a USB hub with external power, total power consumption becomes even less correct if USB devices are connected. Despite these issues, if USB devices do not consume too much energy relatively to Jetson Nano itself, its reported power consumption may be still useful for predicting approximate battery life and other purposes which do not require high accuracy.
To accurately measure total power consumption by Jetson Nano with USB devices, it is not enough to have typical USB power meter - it must have external power and not use power from Jetson Nano itself (most USB power meters do not support this, and therefore total power consumption reported by Nano + reported by typical USB meter will be higher than it actually is).
The simplest way to to measure total power consumption accurately without specialized devices, is to monitor current and voltage from the power supply, and multiply them to get power in watts.
From my Nano 2G Jetpack 4.5, no POW parameter in tegrastats? Do I need to specify and option to get Power?
~ $ sudo tegrastats
RAM 597/1979MB (lfb 100x4MB) SWAP 0/5085MB (cached 0MB) IRAM 0/252kB(lfb 252kB) CPU [1%@1224,2%@1224,0%@1224,0%@1224] EMC_FREQ 1%@1600 GR3D_FREQ 0%@76 VIC_FREQ 0%@140 APE 25 PLL@24.5C CPU@30.5C PMIC@100C GPU@27.5C AO@34.5C thermal@29C
In my Nano 2G Jetpack 4.5, there is no /6-0040 folder, only bind event unbind files where I do not have permission?
I have Jetson Nano B1 and do not have Jetson Nano 2G, so I do not know how to get power consumption on it directly. I recommend to try jtop, it will probably show power consumption if it is supported by 2G. If it does work but you need to get it yourself programatically instead of using jtop, you can look at jtop source code.
Thanks. Unfortunately jtop doesn’t list rail voltages or current either, so I’ll have to try an external method.