#gpu #nano #temperature #cpu-gpu #power #jetson #monitoring

app jetson_nano_monitor

A Rust-based monitoring tool for Jetson Nano to track CPU, GPU, RAM, and temperature metrics

2 releases

0.1.5 Dec 4, 2024
0.1.4 Dec 4, 2024

#93 in Machine learning

Download history 236/week @ 2024-12-02 35/week @ 2024-12-09

271 downloads per month

MIT license

10KB
78 lines

jetson_nano_monitor

jetson_nano_monitor is a lightweight Rust-based system monitoring tool designed specifically for NVIDIA Jetson Nano, while also supporting other ARM-based SBCs and Linux systems. It provides real-time stats for CPU usage, memory usage, board temperature, and Jetson Nano-specific GPU and power mode monitoring.

Features

  • CPU Usage:

    • Displays per-core usage percentages.
  • Memory Usage:

    • Reports total and used memory.
  • Board Temperature:

    • Dynamically detects and reports board temperature using Linux thermal zone files.
  • Jetson Nano-Specific GPU and Power Mode Monitoring:

    • GPU Stats: Uses the Jetson Nano's tegrastats utility to report GPU utilization and memory controller usage.
    • Power Mode: Displays the current Jetson Nano power mode (e.g., 5W, 10W).
  • Tailored for Jetson Nano: Provides unique GPU and power mode stats specific to NVIDIA Jetson devices.

  • Lightweight: No external dependencies aside from Rust crates.

  • Cross-Platform: Works on other Linux systems (e.g., Raspberry Pi), but shines on Jetson Nano.

  • Open Source: Built to empower the open-source community with a simple and extensible monitoring tool.

Installation

Clone the repository:

   git clone https://github.com/bensantora1/Rust.git
   cd jetson_monitor

Build the project using Cargo:

cargo build --release

Run the binary:

./target/release/jetson_nano_monitor

Usage

Simply run the binary to display system stats:

./jetson_nano_monitor

Example Output:

Jetson Nano Monitor:
--------------------
CPU Usage (per core): [1.5, 2.0, 3.0, 4.5]
Memory Usage: 1024000/4096000 KB
Board Temperature: 48.5 °C
GPU and Power Stats:
RAM 1481/3965MB (lfb 629x4MB) SWAP 0/3965MB (cached 0MB) IRAM 0/252kB(lfb 252kB) CPU [3%@102,off,off,off] EMC_FREQ 3%@1600 GR3D_FREQ 7%@921 NVDEC 115 NVJPG 23
Current Power Mode: MODE_10W

If no temperature file is found, you’ll see:

Board Temperature: Unavailable

If tegrastats is not installed or not in your PATH, you’ll see:

GPU Stats: Unable to retrieve. Ensure `tegrastats` is installed.

How It Works

CPU and Memory Stats: Uses the sysinfo crate to gather real-time CPU and memory usage.

Temperature: Dynamically scans /sys/class/thermal/thermal_zoneX/ files to retrieve board temperature. Specifically looks for soc or cpu-thermal zones on Jetson Nano devices.

GPU Stats: Uses the tegrastats utility (pre-installed on Jetson Nano) to report GPU and memory controller utilization, power usage, and other unique stats.

Power Mode: Reads the current power mode directly from /sys/devices/virtual/soc/.../mode, which is unique to Jetson Nano.

Known Limitations Temperature Support: The tool depends on Linux's thermal zone files (/sys/class/thermal/thermal_zoneX/temp). If these files are missing or inaccessible, the temperature will display as "Unavailable."

tegrastats Dependency: GPU stats require the tegrastats utility, which is pre-installed on official NVIDIA JetPack images. Ensure this utility is available and in your PATH.

Jetson-Specific Features: Features like GPU stats and power mode monitoring are only available on NVIDIA Jetson devices. On other Linux systems, these fields will be skipped.

Future Improvements

JSON Output: Add a --json flag to display stats in JSON format for integration with other tools.

Custom Refresh Intervals: Add a --interval flag to allow users to control the refresh rate.

Fan Speed Monitoring: Extend support to display fan speeds on Jetson devices.

Web Dashboard: Build an optional web UI to visualize the stats in real time.

License

This project is licensed under the MIT License.

Author

Ben Santora - Cape Ann MA

Dependencies

~1–24MB
~354K SLoC