| Crates.io | cpu_info |
| lib.rs | cpu_info |
| version | 0.1.0 |
| created_at | 2025-11-18 21:17:46.123216+00 |
| updated_at | 2025-11-18 21:17:46.123216+00 |
| description | A lightweight, cross-platform Rust library to retrieve CPU vendor, model, core topology, and hybrid distribution detection using pure Rust with no external commands. |
| homepage | https://github.com/CVALENDB/cpu_info |
| repository | https://github.com/CVALENDB/cpu_info |
| max_upload_size | |
| id | 1939009 |
| size | 25,790 |
A lightweight, cross-platform Rust library that retrieves detailed CPU information with zero unsafe FFI dependencies and without relying on system locale or external commands.
This crate is designed to work reliably on Linux and Windows (more platforms coming soon).
It parses standardized kernel interfaces (/sys, /proc) and CPUID instructions when available, delivering:
CPU vendor (Intel, AMD, ARM implementers, or custom vendor string)
CPU architecture (x86, x86-64, ARM, ARM64)
CPU model name (via CPUID on x86 or procfs on ARM)
Total logical cores
Total physical cores
Core grouping and distribution analysis
This crate is pure Rust and does not use any C libraries or bindings.
implementer ID from /proc/cpuinfoBased on Rust’s built-in compile-time constants (always correct).
Uses /sys/devices/system/cpu for reliable detection across all Linux distributions.
Detects P-cores and E-cores by analyzing clock frequency groups or core_type when available.
Does not rely on text labels like “model name”, which vary by language.
No calls to lscpu, nproc, dmidecode, etc.
The crate will soon include runtime CPU feature detection, such as:
This will allow applications and game engines to adapt dynamically to available instruction sets without relying on compile-time feature flags.
(Windows + Linux support planned; macOS may be added later.)
use cpu_info::CpuInfo;
fn main() {
let info = CpuInfo::new();
println!("{:#?}", info);
}