Cryovalent

Lightweight, zero-dependency PID-based CPU thermal and power management daemon for Linux.

System Utility MIT License Rust (Allocation-free loop) Active Status

Overview

Cryovalent runs a deterministic, 50 Hz closed-loop Proportional-Integral-Derivative (PID) controller that tracks CPU core temperature and dynamically throttles the hardware package power limit through the Linux powercap RAPL sysfs interface.

It works identically on both Intel and AMD x86-64 processors using universal kernel abstractions — removing any need for vendor-specific tools like ryzenadj or intel-undervolt.

Key Features

Advanced Thermal Control

  • PID Loop Feedback: Dynamic proportional, integral (with anti-windup clamping), and derivative (reacts to rate of error change) terms stabilize heat output proactively.
  • Adaptive Power Limits: Swaps power limits mid-flight within one control tick (~20 ms) when workload spikes occur.

Ultra-Lean Architecture

  • Zero Allocations: The critical 50 Hz execution path is entirely heap-allocation-free; all telemetry and communication buffers are pre-allocated at startup to minimize CPU and scheduling overhead.
  • Pure Rust Standard Library: Zero external dependency crate tree ensures minimal binary size and optimal memory footprints.

Production Hardening

  • Security Sandbox: The systemd unit restricts write privileges globally via ProtectSystem=strict and runs without root capabilities by locking down RAPL operations explicitly.
  • Hot-Reload: Swap configuration profiles dynamically mid-flight by sending a SIGHUP signal to the daemon.

Installation & Running

Cryovalent is distributed as a native Debian package (.deb) that detects desktop versus headless server contexts on installation.

1. Install Debian Package

bash - dpkg Install
# Install downloaded package locally sudo dpkg -i cryovalent_0.1.0_amd64.deb # Verify daemon service status systemctl status cryovalent.service

2. Build and Run from Source

Ensure you have the Rust compiler toolchain (stable, version 1.70 or newer) installed on your system:

bash - Rust Cargo Build
# Clone and enter the workspace git clone https://gitlab.com/quantum-hue/cryovalent.git cd cryovalent # Build and run tests cargo test --workspace # Compile optimized release binaries cargo build --release --workspace

Configuration Spec

The daemon configures profiles inside the /etc/cryovalent.conf file:

ini - cryovalent.conf
[system] default_profile = balanced poll_interval_ms = 20 # 50 Hz loop [profile.balanced] kp = 2.0 ki = 0.10 kd = 1.2 setpoint_c = 75.0 # Target temperature (°C) min_power_uw = 8_000_000 # 8W Floor max_power_uw = 45_000_000 # 45W Ceiling