#amd-gpu #intel #cross-platform #amd #nvidia #gpu

gfxinfo

Rust library for querying GPU information

3 releases

Uses new Rust 2024

new 0.1.2 Mar 24, 2025
0.1.1 Mar 24, 2025
0.1.0 Mar 23, 2025

#335 in Hardware support

Download history 184/week @ 2025-03-19

184 downloads per month

Apache-2.0

25KB
665 lines

gfxinfo

Rust library for querying GPU information

TL;DR

use gfxinfo::active_gpu;

let gpu = active_gpu();
println!("GPU vendor: {}", gpu.vendor());
println!("GPU model: {}", gpu.model());
println!("GPU family: {}", gpu.family());
println!("GPU device ID: {}", gpu.device_id());

// And with `gpu_info` feature enabled
let info = gpu.info();
println!("Total VRAM: {} bytes", info.total_vram());
println!("Used VRAM: {} bytes", info.used_vram());
println!("Load: {}%", info.load_pct());
println!("Temperature: {} C", info.temperature() / 1000);

Features

  • Cross-platform, cross-vendor support
  • Plenty of feature flags
  • Low dependency count

Feature flags

Feature Description Default
default Enables all features Yes
amd Enables AMD GPU support Yes
nvidia Enables Nvidia GPU support Yes
intel Enables Intel GPU support Yes
gpu_info Enables the GpuInfo trait, which provides query functions for things like VRAM usage Yes

TODO

(Windows support is speculative, as it uses the Windows API and I don't have a Windows machine to test on. It did work partially in a VM using the basic display driver!)

  • Cross-platform vendor support
    • Nvidia
      • Windows
      • Linux
    • AMD
      • Windows
      • Linux
    • Intel
      • Windows
      • Linux
    • Generic/Other
      • Apple/MacOS
  • Supported information
    • Vendor
    • Model
    • Family
    • Device ID
    • Total VRAM
    • Used VRAM
    • Load percentage
    • Temperature

Dependencies

~0–35MB
~508K SLoC