Struct amdgpu_sysfs::hw_mon::HwMon
source · [−]pub struct HwMon { /* private fields */ }
Expand description
Reprepesents a hardware monitor. Hardware monitors are used to report real-time information about the device, such as temperatures and power usage.
Implementations
sourceimpl HwMon
impl HwMon
sourcepub async fn new_from_path(path: PathBuf) -> Result<Self, HwMonError>
pub async fn new_from_path(path: PathBuf) -> Result<Self, HwMonError>
Most of the time you may want to access HwMon
s through the
GpuHandle they’re bound to.
sourcepub async fn get_temps(&self) -> HashMap<String, Temperature>
pub async fn get_temps(&self) -> HashMap<String, Temperature>
Returns a HashMap of temperatures(in degress celsius), indexed by the labels (example: “edge”).
sourcepub async fn get_gpu_clockspeed(&self) -> Option<u64>
pub async fn get_gpu_clockspeed(&self) -> Option<u64>
Gets the current GFX/compute clockspeed in MHz.
sourcepub async fn get_vram_clockspeed(&self) -> Option<u64>
pub async fn get_vram_clockspeed(&self) -> Option<u64>
Gets the current memory clockspeed in MHz.
sourcepub async fn get_power_average(&self) -> Option<f64>
pub async fn get_power_average(&self) -> Option<f64>
Gets the average power (currently) used by the GPU in watts.
sourcepub async fn get_power_cap(&self) -> Option<f64>
pub async fn get_power_cap(&self) -> Option<f64>
Gets the current power cap of the GPU in watts.
sourcepub async fn get_power_cap_max(&self) -> Option<f64>
pub async fn get_power_cap_max(&self) -> Option<f64>
Gets the maximum possible power cap for the GPU in watts. If overclocking is disabled, this is probably the same as the default cap.
sourcepub async fn get_power_cap_min(&self) -> Option<f64>
pub async fn get_power_cap_min(&self) -> Option<f64>
Gets the minimum possible power cap for the GPU in watts.
sourcepub async fn get_power_cap_default(&self) -> Option<f64>
pub async fn get_power_cap_default(&self) -> Option<f64>
Gets the default power cap for the GPU in watts.
sourcepub async fn get_fan_pwm(&self) -> Option<u8>
pub async fn get_fan_pwm(&self) -> Option<u8>
Gets the pulse width modulation fan level.
sourcepub async fn get_fan_current(&self) -> Option<u32>
pub async fn get_fan_current(&self) -> Option<u32>
Gets the current fan speed in RPM.
sourcepub async fn get_fan_max(&self) -> Option<u32>
pub async fn get_fan_max(&self) -> Option<u32>
Gets the maximum possible fan speed in RPM.
sourcepub async fn get_fan_min(&self) -> Option<u32>
pub async fn get_fan_min(&self) -> Option<u32>
Gets the minimum possible fan speed in RPM.
sourcepub async fn get_fan_target(&self) -> Option<u32>
pub async fn get_fan_target(&self) -> Option<u32>
Gets the currently desired fan speed in RPM.
sourcepub async fn get_fan_control_method(&self) -> Option<FanControlMethod>
pub async fn get_fan_control_method(&self) -> Option<FanControlMethod>
Gets the pulse width modulation control method.
Trait Implementations
sourceimpl SysFS for HwMon
impl SysFS for HwMon
fn get_path(&self) -> &Path
sourcefn read_file<'life0, 'life1, 'async_trait>(
&'life0 self,
file: &'life1 str
) -> Pin<Box<dyn Future<Output = Option<String>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
fn read_file<'life0, 'life1, 'async_trait>(
&'life0 self,
file: &'life1 str
) -> Pin<Box<dyn Future<Output = Option<String>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
Reads the content of a file in the SysFS.
sourcefn write_file<'life0, 'life1, 'async_trait, C>(
&'life0 self,
file: &'life1 str,
contents: C
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
C: 'async_trait + AsRef<[u8]> + Send,
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
fn write_file<'life0, 'life1, 'async_trait, C>(
&'life0 self,
file: &'life1 str,
contents: C
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
C: 'async_trait + AsRef<[u8]> + Send,
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
Write to a file in the SysFS.
Auto Trait Implementations
impl RefUnwindSafe for HwMon
impl Send for HwMon
impl Sync for HwMon
impl Unpin for HwMon
impl UnwindSafe for HwMon
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more