A high-performance system monitoring tool specifically designed for Rockchip SoC devices (RK3588, RK3399, etc.), written in Rust using the Ratatui TUI framework.
- CPU: Per-core usage, frequencies, time breakdown (user/system/iowait/idle)
- GPU (Mali): Utilization percentage and frequency
- NPU: Per-core load and frequency
- RGA: Graphics accelerator scheduler load (shows all RGA cores)
- Memory: RAM, Swap, and ZRAM usage with detailed statistics
- Temperatures: All thermal sensors (CPU, GPU, NPU, etc.)
- Network & Disk I/O: Real-time transfer rates per adapter
- Interactive Sorting: Sort by CPU, Memory, PID, or Name (ascending/descending)
- Detailed Metrics: PID, User, Nice level, CPU core affinity, Runtime, CPU%, Memory%
- Dynamic Display: Shows as many processes as fit in the terminal
- System uptime and load average
- CPU governor and frequency ranges (per cluster)
- Running and blocked process counts
- Context switches, interrupts, and softirqs per second
- External TCP connection count
- NPU kernel driver version
- RGA kernel driver version
- RKNN Runtime library version
- RKLLM Runtime library version
Optimized for minimal CPU overhead:
- <1% CPU usage during normal operation
- Cached static information (versions, hardware availability)
- UID-to-username caching (eliminates process spawns)
- Throttled refresh rates (1s/2s/3s/5s for different data types)
- Efficient hardware detection (checks availability once at startup)
- Rockchip SoC-based device (RK3588, RK3399, etc.)
- Linux with sysfs and debugfs mounted
- Rust toolchain (for installing from crates.io or building from source)
The easiest way to install rktop is via cargo:
cargo install rktopThis will download, compile, and install the latest version from crates.io.
# Clone the repository
git clone https://github.com/ajokela/rktop.git
cd rktop
# Build release binary
cargo build --release
# Binary will be at target/release/rktop# If installed via cargo
# Binary is already in ~/.cargo/bin/ (ensure it's in your PATH)
# If built from source, copy to system path
sudo cp target/release/rktop /usr/local/bin/
sudo chmod +x /usr/local/bin/rktop# Run with root privileges (required for debugfs access)
sudo rktop| Key | Action |
|---|---|
q, Q, Esc |
Quit |
c |
Toggle CPU sort (ascending/descending) |
m |
Toggle Memory sort (ascending/descending) |
p |
Toggle PID sort (ascending/descending) |
n |
Toggle Name sort (ascending/descending) |
You can grant specific capabilities to avoid requiring root:
# Grant file read and process trace capabilities
sudo setcap cap_dac_read_search,cap_sys_ptrace=eip /usr/local/bin/rktop
# Now you can run without sudo
rktopNote: Capabilities are removed if the binary is modified. Re-run setcap after updates.
- Per-core usage bars with frequency
- CPU time breakdown (User, System, IOWait, Idle percentages)
- Frequency ranges for each CPU cluster (big.LITTLE)
- Running and blocked process counts
- Context switches, interrupts, and softirqs per second
- RAM usage (used + cached / total)
- Swap usage
- ZRAM usage with compression ratio
- Detailed breakdown (Total, Free, Used, Cache, Shared)
- Mali GPU utilization percentage
- Current GPU frequency
- Per-core NPU load (0-2 cores typical)
- NPU frequency
- Per-scheduler load for all RGA cores
- RK3588 example: rga3_0, rga3_1, rga2_2
- Board name and SoC model
- NPU driver version
- RGA driver version
- RKNN Runtime version
- RKLLM Runtime version
- System uptime
- Load average (1/5/15 min)
- CPU governor
- Total process count
- External TCP connections
- Disk read/write rates
- Network RX/TX rates (total)
- Per-adapter network rates
- All thermal sensors
- Real-time temperature readings
- PID - Process ID
- User - Username
- NI - Nice level (priority)
- C - Current CPU core (0-7)
- Time - Process runtime (MM:SS or HH:MM:SS)
- Name - Process name
- CPU% - CPU usage
- Mem% - Memory usage
- src/main.rs - Main application, TUI rendering, event loop, state management
- src/hardware.rs - Rockchip-specific hardware detection and monitoring
- src/sysinfo_ext.rs - Extended system information (processes, ZRAM, TCP stats)
Caching for Performance
- Static information cached at startup (board name, versions, hardware availability)
- Hardware availability checks prevent unnecessary sysfs reads every frame
- UID-to-username mapping cached to eliminate process spawns
Throttled Refresh Intervals
- CPU/Memory: 1 second
- Network/Disk I/O: 2 seconds
- Processes: 3 seconds
- Stats (uptime, load, governor, TCP): 5 seconds
Graceful Hardware Detection
- Functions return
Option<T>or empty values when hardware unavailable - UI panels conditionally render based on cached availability checks
- Works on non-Rockchip systems (shows basic CPU/memory/process info)
- RK3588 (tested on Orange Pi 5 Max)
- RK3399
- Other Rockchip SoCs with Mali GPU, NPU, and/or RGA
The tool reads from Rockchip-specific kernel interfaces:
Debugfs (requires root or capabilities):
/sys/kernel/debug/mali0/- GPU utilization/sys/kernel/debug/rknpu/- NPU load and version/sys/kernel/debug/rkrga/- RGA load and version
Sysfs (standard access):
/sys/devices/platform/fb000000.gpu-panthor/devfreq/- GPU frequency/sys/class/devfreq/fdab0000.npu/- NPU frequency/sys/devices/system/cpu/cpu*/cpufreq/- CPU frequencies
Device Tree:
/proc/device-tree/model- Board name and SoC detection
CPU Clusters:
- CPU 0-3: Big cores (typically 1800-2400 MHz)
- CPU 4-7: LITTLE cores (408-2256 MHz)
RGA Cores:
- 3 schedulers total: 2× RGA3 + 1× RGA2
- Displayed as: rga3_0, rga3_1, rga2_2
NPU Cores:
- 3 cores (Core 0, Core 1, Core 2)
- Each with independent load monitoring
The tool needs access to debugfs. Either:
- Run with
sudo rktop - Grant capabilities:
sudo setcap cap_dac_read_search,cap_sys_ptrace=eip /usr/local/bin/rktop
- Ensure debugfs is mounted:
mount | grep debugfs - Check kernel drivers are loaded:
lsmod | grep -E "mali|npu|rga" - Some boards may not have all accelerators
- Ensure runtime libraries are installed in
/usr/lib/ - Library paths may vary by distribution
- Parses binary ELF files directly to extract versions
- Normal usage should be <1% CPU
- If higher, check
straceoutput:sudo strace -c -p $(pgrep rktop) - Verify caching is working (no excessive file opens)
Rust Crates:
ratatui(0.28) - Terminal UI frameworkcrossterm(0.28) - Terminal manipulation and event handlingsysinfo(0.32) - System and process informationregex(1.11) - Regular expression parsing for hardware dataanyhow(1.0) - Error handlingnix(0.29) - Unix system calls (for root check)
System Requirements:
- Linux kernel with sysfs and debugfs support
- For full features: Mali GPU, NPU, and RGA drivers loaded
From profiling with strace -c:
- Zero subprocess spawns during normal operation (after startup)
- Minimal file I/O through aggressive caching
- <1% CPU usage on RK3588 (Orange Pi 5 Max)
- Reads
/proc/[pid]/statfor nice level and CPU core affinity - Uses sysinfo crate for CPU/memory usage
- Implements global UID-to-username cache (Mutex-wrapped HashMap)
- Reduces process spawns from 260+/sec to 0-2/sec
- Parses
/proc/statfor context switches, interrupts, softirqs - Calculates per-second rates from deltas
- Computes CPU time percentages (user/system/iowait/idle)
- Per-adapter RX/TX rate calculation
- Refreshed every 2 seconds to reduce file I/O
- Shows both aggregate and per-adapter statistics
- Reads from
/sys/class/thermal/thermal_zone*/ - Also checks
/sys/class/hwmon/for additional sensors - Filters out duplicate thermal zones
- Rockchip-specific: Some features only work on Rockchip SoCs
- Debugfs access: Requires root or capabilities for full functionality
- Library versions: Library paths may vary by distribution
- No NPU process mapping: Cannot show which process uses which NPU core (kernel limitation)
- yarktop - Python-based predecessor
This project is licensed under the BSD 3-Clause License - see the LICENSE file for details.
Developed for Rockchip SBC enthusiasts who want detailed hardware monitoring with minimal overhead.
