pub struct GpuHandle {
    pub hw_monitors: Vec<HwMon>,
    /* private fields */
}
Expand description

A GpuHandle 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 GpuHandle 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 the pci slot name of the card.

Gets the current PCIe link speed.

Gets the current PCIe link width.

Gets the maximum possible PCIe link speed.

Gets the maximum possible PCIe link width.

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.

Returns the currently forced performance level.

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. T is the type that values should be deserialized into.

Gets clocks levels.

Gets clocks levels.

Gets clocks levels.

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.

Reads the clocks table from pp_od_clk_voltage.

Writes and commits the given clocks table to pp_od_clk_voltage.

Resets the clocks table to the default configuration.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Gets the path of the current SysFS.
Reads the content of a file in the SysFS.
Reads the content of a file and then parses it
Write to a file in the SysFS.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.