Skip to main content

Interactive system-monitor and process viewer for Rockchip SoC devices [RK3588, RK3588S, RK3568, RK3566, RK3399]

Project description

rockchip-stats

System monitor and control tool for Rockchip SoC devices

rockchip-stats demo


rockchip-stats is a monitoring and control package for Rockchip SoC boards. It can be used as a standalone terminal UI (rtop) or imported as a Python library.

Features:

  • Real-time monitoring of CPU, GPU, NPU, RGA, MPP, Memory, Temperature, Fan
  • Thermal trip points and cpufreq/devfreq throttle visibility
  • Fan speed and CPU governor control
  • Board and SoC auto-detection
  • Importable Python library
  • Docker-compatible via Unix socket
  • Graceful degradation — works even when some hardware is absent

Supported Hardware

SoC CPU GPU NPU
RK3588 / RK3588S / RK3588M 4× A76 + 4× A55 Mali-G610 6 TOPS (3 cores)
RK3582 2× A76 + 4× A55 Mali-G610
RK3576 4× A72 + 4× A53 Mali-G52 6 TOPS
RK3568 / RK3568J 4× A55 Mali-G52
RK3566 4× A55 Mali-G52
RK3399 / RK3399Pro 2× A72 + 4× A53 Mali-T860 3 TOPS (Pro only)

Install

sudo apt update && sudo apt install python3-pip -y
sudo pip3 install -U rockchip-stats          # standard
sudo pip3 install --break-system-packages -U rockchip-stats  # Ubuntu 24.04+

From source:

git clone https://github.com/batuhanberkayaydin/rockchip_stats.git
cd rockchip_stats
sudo pip3 install .

After install, reboot once so your user is added to the rtop group.


Usage

rtop
Key Page Description
1 ALL Overview dashboard
2 CPU Per-core load & frequency
3 GPU Mali GPU load & frequency
4 NPU NPU per-core utilization
5 ENG RGA & MPP hardware engines
6 MEM RAM, Swap, CMA
7 CTRL Temperature (with trip points), Throttle, Fan, Power
8 INFO Board & system information

Python Library

from rtop import rtop

with rtop() as r:
    while r.ok():
        cpu = r.cpu
        gpu = r.gpu
        print(f"CPU: {cpu.get('total', 0):.1f}%  GPU: {gpu.get('load', 0)}%")

Read all sensors once:

from rtop import rtop

with rtop() as r:
    if r.ok():
        for name, val in r.temperature.items():
            if isinstance(val, (int, float)):
                print(f"{name}: {val / 1000:.1f}°C")

        for zone, data in r.thermal.items():
            print(f"{zone}: {data['temp'] / 1000:.1f}°C")
            for tp in data.get('trip_points', []):
                print(f"  {tp['type']}: {tp['temp'] / 1000:.1f}°C")

        for i, core in enumerate(r.npu.get('cores', [])):
            print(f"NPU Core{i}: {core.get('load', 0)}%")

More examples in examples/.


Docker

Install rockchip-stats on the host, then pass the socket into your container:

docker run --rm -it \
  -v /run/rtop.sock:/run/rtop.sock \
  ghcr.io/batuhanberkayaydin/rockchip_stats:latest

Architecture

rockchip-stats runs as a background service (root) that reads sysfs/procfs/debugfs and exposes data over a Unix socket. The rtop client connects to the socket and renders the TUI.

┌──────────────────┐    /run/rtop.sock    ┌──────────────────┐
│  rtop (client)   │ ◄─────────────────► │  rtop (service)  │
│  curses TUI      │                      │  data collector  │
└──────────────────┘                      └────────┬─────────┘
                                                   │
                                          sysfs · procfs · debugfs

Development

Run directly from the repo without installing:

sudo python3 -m rtop                        # normal
sudo python3 -m rtop --debug 2>debug.log    # with debug output
sudo python3 -m rtop --no-service           # without socket
sudo python3 -m rtop --force                # start as service

To use repo changes immediately (editable install):

sudo pip3 install -e . --break-system-packages
sudo systemctl restart rtop

License

GNU Affero General Public License v3.0 — see LICENSE.


Acknowledgements

Inspired by jetson_stats by rbonghi.
Adapted and extended for Rockchip SoC platforms.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rockchip_stats-0.1.11.tar.gz (83.1 kB view details)

Uploaded Source

File details

Details for the file rockchip_stats-0.1.11.tar.gz.

File metadata

  • Download URL: rockchip_stats-0.1.11.tar.gz
  • Upload date:
  • Size: 83.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for rockchip_stats-0.1.11.tar.gz
Algorithm Hash digest
SHA256 1b272e1fe6f89aee74bd84a123008791fc864cce663c4ab02bd65ef33e66ee59
MD5 c22085e4b0e1a690e3fbdc39a5674738
BLAKE2b-256 fa7ddf98ae9be742e0f0750621a776513a4be130de70ca0f1143648905f2b67d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page