#intel #linux #pstate

intel-pstate

Fetch and modify Intel pstate kernel parameters

8 releases (2 stable)

1.0.1 Feb 25, 2022
0.2.3 Nov 17, 2021
0.2.2 Apr 23, 2021
0.2.1 Apr 29, 2020
0.1.1 Dec 26, 2018

#912 in Unix APIs

Download history 62/week @ 2024-02-26 80/week @ 2024-03-04 120/week @ 2024-03-11 125/week @ 2024-03-18 78/week @ 2024-03-25 109/week @ 2024-04-01 73/week @ 2024-04-08 69/week @ 2024-04-15 95/week @ 2024-04-22 136/week @ 2024-04-29 109/week @ 2024-05-06 108/week @ 2024-05-13 111/week @ 2024-05-20 50/week @ 2024-05-27 66/week @ 2024-06-03 56/week @ 2024-06-10

292 downloads per month

MIT license

9KB
144 lines

intel-pstate

Rust crate for fetching and modifying intel_pstate kernel parameters.

use std::io;
use intel_pstate::PState;

fn main() -> io::Result<()> {
    if let Ok(pstate) = PState::new() {
        pstate.set_min_perf_pct(50)?;
        pstate.set_max_perf_pct(100)?;
        pstate.set_no_turbo(false)?;
    }

    Ok(())
}

lib.rs:

Crate for fetching and modifying the intel_pstate kernel parameters.

Example

use intel_pstate::{PState, PStateError};

fn main() -> Result<(), PStateError> {
    let pstate = PState::new()?;

    let _ = pstate.set_hwp_dynamic_boost(true);
    pstate.set_min_perf_pct(50)?;
    pstate.set_max_perf_pct(100)?;
    pstate.set_no_turbo(false)?;

    Ok(())
}

Dependencies

~0.7–1.2MB
~26K SLoC