Expand description
Cross-platform GPU memory (VRAM) detection with no vendor SDKs.
gpu_probe reports the GPUs visible on the host and how much memory each
has, using only facilities the OS or driver already ship:
- NVIDIA (Linux, Windows): NVML (
libnvidia-ml) vianvml-wrapper, loaded at runtime. The CUDA toolkit is not required and nothing links at build time. Behind the defaultnvidiafeature. - AMD & Intel (Linux): DRM sysfs under
/sys/class/drm. Discrete cards report dedicated VRAM; integrated GPUs report the shared system-memory ceiling (seeGpuInfo::total_bytes). - Apple/macOS:
system_profiler+sysctl(Apple Silicon reports unified memory).
Detection is best-effort: detect returns an empty Vec when no GPU is
found or the platform is unsupported — never an error.
for gpu in gpu_probe::detect() {
println!("{gpu}");
}Structs§
- Compute
Capability - CUDA compute capability, e.g.
8.6forsm_86. - Cuda
Host - Host-wide CUDA properties reported by the NVIDIA driver.
- Cuda
Version - A CUDA version, e.g.
12.9. - GpuInfo
- A single detected GPU and its memory.
Enums§
- Vendor
- GPU hardware vendor.