Skip to content

AISP-PL/aisp_jtop

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2,052 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

jetson-stats

jetson-stats

PyPI - Downloads PyPI version PyPI - Python Version PyPI - Format GitHub jetson-stats Docker Image Size (tag) Docker Pulls CI & CD CodeQL

Twitter Follow robo.panther Join our Discord

jetson-stats is a package for monitoring and control your NVIDIA Jetson [Thor, Orin, Xavier, Nano, TX] series.

jetson-stats is a powerful tool to analyze your board, you can use with a stand alone application with jtop or import in your python script, the main features are:

  • Decode hardware, architecture, L4T and NVIDIA Jetpack
  • Monitoring, CPU, GPU, Memory, Engines, fan
  • Control NVP model, fan speed, jetson_clocks
  • Importable in a python script
  • Dockerizable in a container
  • Do not need super user
  • Tested on many different hardware configurations
  • Works with all NVIDIA Jetpack

Install

sudo apt update
sudo apt install python3-pip python3-setuptools -y

Option 1: jetson-stats can be installed with pip, but need superuser:

sudo pip3 install -U jetson-stats

Option 2: Install directly from GitHub

sudo pip3 install git+https://github.com/rbonghi/jetson_stats.git

Option 3: Ubuntu 24.04

sudo pip3 install --break-system-packages -U jetson-stats

or

sudo pip3 install --break-system-packages git+https://github.com/rbonghi/jetson_stats.git

Option 4: Ubuntu 24.04 run jtop without sudo and without "--break-system-packages"

Download "scripts/install_jtop_torun_without_sudo.sh"
Make it executable: chmod +x install_jtop_torun_without_sudo.sh
Run "sudo -v"    -v, --validate does not run any command, but allows the use of sudo in the bash script.
Then install with   ./install_jtop_torun_without_sudo.sh

See the guide: How it "without sudo" works & why


Run

Start jtop it's pretty simple just write jtop!

jtop

A simple interface will appear on your terminal, more capabilities are documented at jtop page.

jtop

Library

You can use jtop such a python library to integrate in your software

from jtop import jtop

with jtop() as jetson:
    # jetson.ok() will provide the proper update frequency
    while jetson.ok():
        # Read tegra stats
        print(jetson.stats)

You can also use jtop with your virualenv!

More information available at advanced usage page.

Docker

JSON Exporter

Install systemd units manually after pip install

After sudo pip install ... run:

sudo jtop_install_services

This copies/enables:

  • jtop.service (IPC socket)
  • jtop_exporter.service (JSON stats exporter)

Then verify:

systemctl status jtop.service
systemctl status jtop_exporter.service

A lightweight systemd service jtop_exporter.service can periodically dump jtop statistics into a JSON file for external consumers.

Install jetson-stats (host, with sudo) and enable the exporter:

sudo systemctl enable --now jtop_exporter.service

Default output path:

/run/jtop/jtop_stats.json

Preview stats (pretty print):

jq . /run/jtop/jtop_stats.json

Update frequency: ~1s. Each write is atomic (temporary file rename) to avoid partial reads.

Change output path temporarily:

sudo systemctl stop jtop_exporter.service
sudo env JTOP_EXPORT_PATH=/run/jtop/custom.json systemctl start jtop_exporter.service

Or persist by editing the service file to add an Environment=JTOP_EXPORT_PATH=/path/file.json line, then:

sudo systemctl daemon-reload
sudo systemctl restart jtop_exporter.service

Docker usage: mount the JSON file read-only into a container:

docker run --rm -v /run/jtop/jtop_stats.json:/data/jtop_stats.json:ro alpine cat /data/jtop_stats.json

If you need higher frequency or alternative formats (e.g. Prometheus exposition), consider wrapping jtop_stats binary or extending jtop.stats_exporter.

You can run directly in Docker jtop, you need only to:

  1. Install jetson-stats on your host
  2. Install jetson-stats on your container as well
  3. Pass to your container /run/jtop.sock:/run/jtop.sock

You can try running this command

docker run --rm -it -v /run/jtop.sock:/run/jtop.sock rbonghi/jetson_stats:latest

More information available at docker documentation page.

Sponsorship

If your company benefits from this library, please consider πŸ’– sponsoring its development.

Documentation

jetson-stats has usage and reference documentation at https://rnext.it/jetson_stats, there is also a πŸ†˜ troubleshooting page.

Community

jetson-stats has a community Discord channel for asking questions and collaborating with other contributors. Drop by and say hello πŸ‘‹

About

πŸ“Š Simple package for monitoring and control your NVIDIA Jetson [Orin, Xavier, Nano, TX] series

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 91.2%
  • Shell 8.6%
  • Dockerfile 0.2%