jetson_nano_monitor

Crates.iojetson_nano_monitor
lib.rsjetson_nano_monitor
version
sourcesrc
created_at2024-12-04 18:34:54.779027
updated_at2024-12-04 19:19:12.960228
descriptionA Rust-based monitoring tool for Jetson Nano to track CPU, GPU, RAM, and temperature metrics.
homepage
repository
max_upload_size
id1472390
Cargo.toml error:TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
(bensantora1)

documentation

README

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

Commit count: 0

cargo fmt