NVIDIA Tegra
NVIDIA DRIVE OS 5.1 Linux

Developer Guide
5.1.0.2 Release


 
tegrastats Utility
 
Reported Statistics
Running tegrastats
Re-Deploying tegrastats
tegrastats Options
This SDK provides the tegrastats utility, which reports memory usage and processor usage for Tegra-based devices.
You can find the utility in your package at the following location.
<top>/drive-t186ref-linux/bin-target/tegrastats
Reported Statistics
The following table shows the statistics the tegrastats utility reports.
Statistic
X
Y
Z
RAM X/Y (lfb NxZ)
Largest Free Block (lfb) is a statistic about the memory allocator. It refers to the largest contiguous block of physical memory that can currently be allocated: at most 4 MB. It can become smaller with memory fragmentation.
 
The physical allocations in virtual memory can be bigger.
Amount of RAM in use in MB.
Total amount of RAM available for applications.
Z is the size of the largest free block, N the number of free blocks of this size.
 
SWAP X/Y (cached Z)
Amount of SWAP in use in megabytes.
Total amount of SWAP available for applications.
Amount of SWAP cached in megabytes.
IRAM X/Y (lfb Z)
 
IRAM is memory local to the video hardware engine.
Amount of IRAM memory in use, in kilobytes.
Total amount of IRAM memory available.
Size of the largest free block.
CPU [X%,Y%, , ]@Z
or
CPU [X%@Z, Y%@Z,...]
 
X and Y are rough approximations based on time spent in the system idle process as reported by the Linux kernel in /proc/stat.
Load statistics for each of the CPU cores relative to the current running frequency Z, or 'off' in case a core is currently powered down.
Load statistics for each of the CPU cores relative to the current running frequency Z, or 'off' in case a core is currently powered down.
CPU frequency in megahertz. Goes up or down dynamically depending on the CPU workload.
APE Y
 
APE is the audio processing engine. The APE subsystem consists of ADSP (Cortex®-A9 CPU), mailboxes, AHUB, ADMA, etc.
N/A
APE frequency in megahertz.
N/A
GR3D X%@Y
 
GR3D is the GPU engine.
Percent of the GR3D that is being used, relative to the current running frequency.
GR3D frequency in megahertz
N/A
EMC X%@Y
 
EMC is the external memory controller, through which all sysmem/carve-out/GART memory accesses go.
Percent of EMC memory bandwidth being used, relative to the current running frequency.
EMC frequency in megahertz.
N/A
MSENC Y
 
MSENC is the video hardware encoding engine.
N/A
MSENC frequency in megahertz.
N/A
NVDEC Y
 
NVDEC is the video hardware decoding engine. It is shown only when hardware decoder/encoder engine is used.
N/A
NVDEC frequency in megahertz.
N/A
MTS fg X% bg Y%
Time spent in foreground tasks.
Time spent in background tasks.
N/A
[temp name] C
 
[temp name] is one of the names under the nodes /sys/devices/virtual/thermal/thermal_zoneX/type.
Temperature in degrees Celsius.
N/A
N/A
[VDD_name] X/Y
Current power consumption in milliwatts.
Average power consumption in milliwatts.
N/A
Example Output
Example Output for Tegra TX1
RAM 1179/3983MB (lfb 120x4MB) IRAM 0/252kB(lfb 252kB) CPU [1%@102,4%@102,0%@102,0%@102] EMC_FREQ 7%@408 GR3D_FREQ 0%@76 APE 25 AO@42.5C CPU@37.5C GPU@39C PLL@37C Tdiode@42.75C PMIC@100C Tboard@42C thermal@38.5C VDD_IN 2532/2698 VDD_CPU 76/178 VDD_GPU 19/19
Example Output for Jetson TX2
RAM 1345/7829MB (lfb 1290x4MB) SWAP 0/512MB (cached 0MB) CPU [2%@345,off,off,off,off,off] EMC_FREQ 13%@40 GR3D_FREQ 0%@114 APE 150 BCPU@35C MCPU@35C GPU@41C PLL@35C AO@35.5C Tboard@35C Tdiode@36C PMIC@100C thermal@35.5C VDD_IN 2003/2658 VDD_CPU 320/518 VDD_GPU 400/735 VDD_SOC 400/415 VDD_WIFI 0/0 VDD_DDR 240/348
Example Output for Jetson AGX Xavier
RAM 1903/15692MB (lfb 3251x4MB) CPU [1%@1190,1%@1190,2%@1190,0%@1190,0%@1190,0%@1190,0%@1190,0%@1190] EMC_FREQ 0% GR3D_FREQ 0% AO@32.5C GPU@32C Tboard@32C Tdiode@34.75C AUX@31.5C CPU@33.5C thermal@32.9C PMIC@100C GPU 0/0 CPU 216/216 SOC 864/864 CV 0/0 VDDRQ 144/144 SYS5V 1889/1889
Running tegrastats
When you run tegrastats on Linux devices, it prints statistics to stdout.
Example Log Print
RAM 2669/7846MB (lfb 1065x4MB) CPU [100%@345,100%@2419,100%@2419,100%@344,11%@346,100%@345] EMC_FREQ 17%@1600 GR3D_FREQ 0%@114 APE 150 MTS fg 0% bg 0% PLL@43C thermal@42.8C MCPU@43C Tboard@40C AO@42.5C GPU@49C PMIC@100C BCPU@43C Tdiode@43.5C VDD_IN 5224/3423 VDD_CPU 844/712 VDD_GPU 360/361 VDD_SOC 884/664 VDD_WIFI -114/-91 VDD_DDR 240/240
To run tegrastats
To run tegrastats in the background, execute the following command:
tegrastats --interval <int> --logfile <out_file> &
Where:
<int> is the interval between log prints in milliseconds.
<out_file> is the pathname of the output file to which tegrastats writes the log prints.
To run tegrastats in the foreground, omit the trailing ‘&’. You may also omit the --logfile option to allow log output to go to stdout:
tegrastats --interval <int>
To stop tegrastats
If tegrastats is running in the background, execute the following commands:
ps
kill -9 <pid>
Where <pid> is the process ID of tegrastats as reported by the ps command.
Alternatively, you may run:
tegrastats --stop
If tegrastats is running in the foreground, press CTRL+C in the window where it is running.
Re-Deploying tegrastats
The tegrastats utility is preinstalled. If you have removed tegrastats from the build, you can re-deploy it on the target at runtime.
To re-deploy tegrastats
Execute the following comnand from the host PC:
scp tegrastats nvidia@<TARGET_DEVICE_IP>:/home/nvidia/
tegrastats Options
tegrastats supports the following command line options.
Option
Meaning
--help
Prints this help screen.
--interval <millisec>
Samples the information in <milliseconds>.
--logfile <filename>
Dumps the output of tegrastats to <filename>.
--load_cfg <filename>
Loads the information from <filename>.
--save_cfg <filename>
Saves the information to <filename>.
--start
Runs tegrastats as a daemon process in the background.
--stop
Stops any running instances of tegrastats.
--verbose
Prints verbose message.