Struct amdgpu_sysfs::gpu_controller::GpuController [−][src]
Expand description
A GpuController
represents a handle over a single GPU device, as exposed in the Linux SysFS.
Fields
hw_monitors: Vec<HwMon>
A collection of all HwMons bound to this GPU. They are used to expose real-time data.
Implementations
Initializes a new GpuController
from a given SysFS device path.
Normally, the path should look akin to /sys/class/drm/card0/device
,
and it needs to at least contain a uevent
file.
Gets the kernel driver used.
Gets the GPU’s PCI vendor and ID. This is the ID of your GPU chip, e.g. AMD Radeon RX 580.
Gets the Card’s PCI vendor and ID. This is the ID of your card model, e.g. Sapphire RX 580 Pulse.
Gets total VRAM size in bytes. May not be reported on some devices, such as integrated GPUs.
Gets how much VRAM is currently used, in bytes. May not be reported on some devices, such as integrated GPUs.
Returns the GPU busy percentage.
Returns the GPU VBIOS version. Empty if the GPU doesn’t report one.
Returns the currently forced performance level.
pub async fn set_power_force_performance_level(
&self,
level: PerformanceLevel
) -> Result<(), GpuControllerError>
pub async fn set_power_force_performance_level(
&self,
level: PerformanceLevel
) -> Result<(), GpuControllerError>
Forces a given performance level.
Retuns the list of power levels and index of the currently active level for a given kind of power state.
pub async fn set_enabled_power_levels(
&self,
kind: PowerStateKind,
levels: &[u8]
) -> Result<(), GpuControllerError>
pub async fn set_enabled_power_levels(
&self,
kind: PowerStateKind,
levels: &[u8]
) -> Result<(), GpuControllerError>
Sets the enabled power levels for a power state kind to a given list of levels. This means that only the given power levels will be allowed.
Can only be used if power_force_performance_level
is set to manual
.
Trait Implementations
Reads the content of a file in the SysFS.
Write to a file in the SysFS.