Skip to content

GPU Node ID (gni) is a rust based library for creating a unique identifier for the set of GPUs running on the host. The ID is generated by hashing (blake3) all GPU UUIDs sorted lexicographically.

License

Notifications You must be signed in to change notification settings

facebookresearch/gni

GNI

GPU Node ID (GNI) is a rust based library for creating an identifier for the set of GPUs running on the host. The ID is generated by hashing (blake3) all GPU UUIDs sorted lexicographically. GNI provides a consistent implementation for calculating and retrieving the ID, with bindings to a set of languages (Python, Go, C, CPP) to ensure a consistent and startardized approach to using this ID.

Rust Build and Running GNI

Prerequisites

  • Rust & Cargo: Make sure you have a recent version of Rust (and the built-in Cargo tool) installed. You can check by running:
$ rustc --version
$ cargo --version

If you need to install Rust, visit rustup.rs.

Build

$ cargo build

See build artifacts in the target/debug directory.

Run

$ cargo run
...
Usage: gni [OPTIONS]

Options:
  -c, --cache-filepath <CACHE_FILEPATH>  Filepath to cache ID [default: /tmp/gni]
  -s, --stdout                           Print ID to stdout
  -h, --help                             Print help
  -V, --version                          Print version

Non Rust usage

GNI offers the same core functionality for each supported language, provides bindings, and you can build from source for:

Note: If you’d like support for another language, please open an issue or submit a pull request!

Contributing

Read our contributing guide to learn about our development process, how to propose bugfixes and feature requests, and how to build your changes.

Facebook has adopted a Code of Conduct that we expect project participants to adhere to. Please read the full text so that you can understand what actions will and will not be tolerated.

License

GNI is licensed under the Apache 2.0 license.

About

GPU Node ID (gni) is a rust based library for creating a unique identifier for the set of GPUs running on the host. The ID is generated by hashing (blake3) all GPU UUIDs sorted lexicographically.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published