Table

Struct Table 

Source
pub struct Table {
    pub current_sclk_range: Range,
    pub sclk_offset: Option<i32>,
    pub current_mclk_range: Range,
    pub vddc_curve: Vec<ClocksLevel>,
    pub voltage_offset: Option<i32>,
    pub od_range: OdRange,
}
Expand description

Vega20 clocks table.

Fields§

§current_sclk_range: Range

The current core clock range.

§sclk_offset: Option<i32>

The current core clock offset (RDNA4+)

§current_mclk_range: Range

The current memory clock range. Empty on iGPUs.

§vddc_curve: Vec<ClocksLevel>

The current voltage curve. May be empty if the GPU does not support it.

§voltage_offset: Option<i32>

Voltage offset(in mV) applied on target voltage calculation. This is available for Sienna Cichlid, Navy Flounder and Dimgrey Cavefish.

Note: editing this value directly does not check if it’s in the allowed range!

§od_range: OdRange

The allowed ranges for clockspeeds and voltages.

Implementations§

Source§

impl Table

Source

pub fn set_voltage_offset(&mut self, offset: i32) -> Result<(), Error>

Sets the voltage offset, checking if it’s in range if the GPU provided one

Note: RDNA2 GPUs use a voltage offset but do not provide a range

Source§

impl Table

Source

pub fn clear(&mut self)

Clears the table of all “applicable” values.

This removes all values except the allowed range and voltage curve. You can use it to avoid overwriting the table with already present values, as it can be problematic on some cards. It is intended to be used before calling set_* functions and generating commands/writing the table.

Source

pub fn normalize_vddc_curve(&mut self)

Normalizes the VDDC curve making sure all of the values are within the allowed range. This is needed as some GPUs have default values outside of the allowed range.

Trait Implementations§

Source§

impl ClocksTable for Table

Source§

fn write_commands<W: Write>( &self, writer: &mut W, previous_table: &ClocksTableGen, ) -> Result<(), Error>

Writes commands needed to apply the state that is in the table struct on the GPU.
Source§

fn get_max_sclk_range(&self) -> Option<Range>

Gets the core clock range usable at the highest power level.
Source§

fn get_min_sclk_range(&self) -> Option<Range>

Gets the core clock range usable at the lowest power level.
Source§

fn get_max_mclk_range(&self) -> Option<Range>

Gets the memory clock range usable at the highest power level.
Source§

fn get_min_mclk_range(&self) -> Option<Range>

Gets the memory clock range usable at the lowest power level.
Source§

fn get_max_voltage_range(&self) -> Option<Range>

Gets the voltage range usable at the highest power level.
Source§

fn get_min_voltage_range(&self) -> Option<Range>

Gets the voltage range usable at the lowest power level.
Source§

fn get_current_voltage_range(&self) -> Option<Range>

Gets the current voltage range.
Source§

fn get_current_sclk_range(&self) -> Range

Gets the current range of values for core clocks.
Source§

fn get_current_mclk_range(&self) -> Range

Gets the current range of values for memory clocks.
Source§

fn set_max_sclk_unchecked(&mut self, clockspeed: i32) -> Result<(), Error>

Sets the maximum core clock (without checking if it’s in the allowed range).
Source§

fn set_min_sclk_unchecked(&mut self, clockspeed: i32) -> Result<(), Error>

Sets the minimum core clock (without checking if it’s in the allowed range).
Source§

fn set_max_mclk_unchecked(&mut self, clockspeed: i32) -> Result<(), Error>

Sets the maximum memory clock (without checking if it’s in the allowed range).
Source§

fn set_min_mclk_unchecked(&mut self, clockspeed: i32) -> Result<(), Error>

Sets the minimum memory clock (without checking if it’s in the allowed range).
Source§

fn set_max_voltage_unchecked(&mut self, voltage: i32) -> Result<(), Error>

Sets the voltage to be used at the maximum clockspeed (without checking if it’s in the allowed range).
Source§

fn set_min_voltage_unchecked(&mut self, voltage: i32) -> Result<(), Error>

Sets the voltage to be used at the minimum clockspeed (without checking if it’s in the allowed range).
Source§

fn get_max_sclk_voltage(&self) -> Option<i32>

Gets the current maximum voltage (used on maximum clockspeed).
Source§

fn get_commands( &self, previous_table: &ClocksTableGen, ) -> Result<Vec<String>, Error>

Gets the list of commands that will apply the current state of the clocks table. write_commands should generally be preferred instead.
Source§

fn get_max_sclk(&self) -> Option<i32>

Gets the current maximum core clock.
Source§

fn set_max_sclk(&mut self, clockspeed: i32) -> Result<(), Error>

Sets the maximum core clock.
Source§

fn set_min_sclk(&mut self, clockspeed: i32) -> Result<(), Error>

Sets the minimum core clock.
Source§

fn get_max_mclk(&self) -> Option<i32>

Gets the current maximum memory clock.
Source§

fn set_max_mclk(&mut self, clockspeed: i32) -> Result<(), Error>

Sets the maximum memory clock.
Source§

fn set_min_mclk(&mut self, clockspeed: i32) -> Result<(), Error>

Sets the minimum memory clock.
Source§

fn set_max_voltage(&mut self, voltage: i32) -> Result<(), Error>

Sets the voltage to be used at the maximum clockspeed.
Source§

fn set_min_voltage(&mut self, voltage: i32) -> Result<(), Error>

Sets the voltage to be used at the minimum clockspeed.
Source§

impl Clone for Table

Source§

fn clone(&self) -> Table

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Table

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<Table> for ClocksTableGen

Source§

fn from(v: Table) -> ClocksTableGen

Converts to this type from the input type.
Source§

impl FromStr for Table

Source§

type Err = Error

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, Error>

Parses a string s to return a value of this type. Read more
Source§

impl TryInto<Table> for ClocksTableGen

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<Table, <Self as TryInto<Table>>::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl Freeze for Table

§

impl RefUnwindSafe for Table

§

impl Send for Table

§

impl Sync for Table

§

impl Unpin for Table

§

impl UnwindSafe for Table

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.