pub struct GpuInfo {
pub index: u8,
pub vendor: GpuVendor,
pub name: String,
pub arch: GpuArch,
pub total_memory_mb: u64,
}Expand description
One GPU’s identity, capability and VRAM.
Fields§
§index: u8The vendor tool’s device index (0-based). Matches the index libtorch would assign with no visibility mask set. NVML and amd-smi queries must use this too: neither honors a mask.
vendor: GpuVendorWhich stack this device belongs to. Separate from the device
string libtorch is handed, which is CUDA for AMD as well as
NVIDIA. See GpuVendor.
name: StringMarketing name (e.g. "NVIDIA GeForce RTX 5060 Ti").
arch: GpuArchArchitecture, in the vendor’s own shape. See GpuArch.
total_memory_mb: u64Total VRAM in MiB.
On a unified-memory part (an APU whose GPU and system RAM are one pool) this is a slice of host RAM, not a separate budget. Nothing in flodl reads it that way yet, which is a known gap.
Implementations§
Source§impl GpuInfo
impl GpuInfo
Sourcepub fn arch_label(&self) -> String
pub fn arch_label(&self) -> String
Vendor-neutral architecture label: "sm_120", "gfx1030".
What display and report code wants.
Sourcepub fn sm_version(&self) -> Option<String>
pub fn sm_version(&self) -> Option<String>
NVIDIA compute capability as "sm_NN", or None on any other
vendor. Use GpuInfo::arch_label for display; this is for the
NVIDIA-specific consumers (nvcc gencode flags, CUDA variant
naming) that genuinely cannot proceed without the numeric pair.
Sourcepub fn sm_major(&self) -> Option<u32>
pub fn sm_major(&self) -> Option<u32>
NVIDIA compute-capability major, None on any other vendor.
Sourcepub fn sm_minor(&self) -> Option<u32>
pub fn sm_minor(&self) -> Option<u32>
NVIDIA compute-capability minor, None on any other vendor.
Sourcepub fn vram_bytes(&self) -> u64
pub fn vram_bytes(&self) -> u64
Total VRAM in bytes.
Sourcepub fn short_name(&self) -> String
pub fn short_name(&self) -> String
name with the common vendor prefixes stripped, which is kinder
on eprintln!-style banners.
Sourcepub fn covered_by(&self, archs: &str) -> bool
pub fn covered_by(&self, archs: &str) -> bool
Whether a libtorch variant compiled for archs covers this
device. Delegates to GpuArch::covered_by, whose matching
rules are vendor-specific.
Trait Implementations§
impl Eq for GpuInfo
impl StructuralPartialEq for GpuInfo
Auto Trait Implementations§
impl Freeze for GpuInfo
impl RefUnwindSafe for GpuInfo
impl Send for GpuInfo
impl Sync for GpuInfo
impl Unpin for GpuInfo
impl UnsafeUnpin for GpuInfo
impl UnwindSafe for GpuInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.