#gpu #hip #rocm #api-bindings #radeon #rsmi

rocm_smi_lib

easy to use crate for using rocm-smi from rust

6 releases

0.2.5 Nov 27, 2024
0.2.2 Apr 13, 2024
0.2.0 Mar 9, 2024
0.1.15 Dec 31, 2023
0.1.14 Oct 8, 2023

#194 in Hardware support

Download history 233/week @ 2024-08-24 24/week @ 2024-08-31 31/week @ 2024-09-14 15/week @ 2024-09-21 31/week @ 2024-09-28 2/week @ 2024-10-05 1/week @ 2024-10-12 128/week @ 2024-11-23 23/week @ 2024-11-30

151 downloads per month

MIT/Apache

46KB
1K SLoC

rocm_smi_lib_rs

Crate bringing support for rocm-smi liblary from C

Compatibility

Crate version Rocm version
<2.0 <6.0
2.1 - 2.2 PROVEN BROKEN
2.3 6.0-6.3

Requirements

To use this crate you have to install rocm-smi liblaries

Check out How to install ROCM

Usage / Examples

Example of printing the name of your GPU:

fn print_gpu_name() -> Result<(), RocmErr> {
    let rocm = RocmSmi::init()?;
    let name = rocm.get_device_identifiers(0)?.name;
    println!("{}", name);
    Ok(())
}    

Same thing as above but with creation of device object

fn print_gpu_name() -> Result<(), RocmErr> {
    let rocm = RocmSmi::init()?.into_first_device()?; // into first devic requires enabling `device` feature
    let name = rocm.get_identifiers()?.name;
    println!("{}", name);
    Ok(())
}    

RC versions

Please consider testing rc versions and report bugs in them, api is large and it takes a lot of time to test everything alone on many GPU's.

Tested hardware:

  • RX 7600
  • RX 7600XT
  • RX 6950XT
  • RX 5700XT
  • RX Vega 7 (mobile)
  • RX 470

Developed on hardware:

  • RX 7600
  • RX 5700XT
  • RX 470

TODO

  • setters (it will not be done until i have som testing crew and/or figure out automatic tests across different gpu's)

Dependencies

~0.2–4.5MB