#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

#909 in Unix APIs

Download history 47/week @ 2024-07-22 133/week @ 2024-07-29 124/week @ 2024-08-05 127/week @ 2024-08-12 133/week @ 2024-08-19 120/week @ 2024-08-26 127/week @ 2024-09-02 109/week @ 2024-09-09 68/week @ 2024-09-16 153/week @ 2024-09-23 98/week @ 2024-09-30 113/week @ 2024-10-07 102/week @ 2024-10-14 120/week @ 2024-10-21 93/week @ 2024-10-28 84/week @ 2024-11-04

413 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.6–1MB
~23K SLoC