#[non_exhaustive]pub struct GpuInfo {
pub name: String,
pub vendor: Vendor,
pub total_bytes: u64,
pub free_bytes: Option<u64>,
pub used_bytes: Option<u64>,
pub arch_target: Option<ArchTarget>,
}Expand description
A single detected GPU and its memory.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringHuman-readable name (e.g. "NVIDIA GeForce RTX 4090").
vendor: VendorHardware vendor.
total_bytes: u64Total memory in bytes. For discrete GPUs this is dedicated VRAM; for integrated/unified GPUs (Intel iGPUs, AMD APUs, Apple Silicon) it is the shared system-memory ceiling available to the GPU, not a dedicated pool.
An AMD APU reports its BIOS VRAM carveout plus the GTT pool the driver
allocates from — the latter sized by the kernel’s ttm.pages_limit —
since the carveout alone is far below what the part can actually hand
out (512 MiB of 14.5 GiB on one such part).
free_bytes: Option<u64>Free device memory in bytes, when known.
used_bytes: Option<u64>Used device memory in bytes, when known.
arch_target: Option<ArchTarget>The architecture a prebuilt artifact must target to run on this GPU:
ArchTarget::Gfx on AMD, from KFD sysfs, and ArchTarget::Sm on
NVIDIA, from NVML.
None when neither driver reports one — an Apple or Intel GPU, an AMD
card on a kernel without KFD, or the nvidia feature disabled. The
NVIDIA value also appears on CudaHost, which reports device 0’s
alongside the host driver version; this field is per-GPU.