#nvidia #gpu #monitoring #hardware #managment

sys nvml-wrapper-sys

Generated bindings to the NVIDIA Management Library

6 releases (3 breaking)

0.4.1 Sep 12, 2019
0.4.0 Sep 11, 2019
0.3.1 Apr 9, 2019
0.3.0 Jul 20, 2017
0.1.0 May 17, 2017

#50 in Hardware support

Download history 8/week @ 2019-05-30 18/week @ 2019-06-06 8/week @ 2019-06-13 22/week @ 2019-06-20 12/week @ 2019-06-27 18/week @ 2019-07-04 15/week @ 2019-07-11 8/week @ 2019-07-18 13/week @ 2019-08-01 8/week @ 2019-08-08 1/week @ 2019-08-15 59/week @ 2019-08-22 20/week @ 2019-08-29 46/week @ 2019-09-05

81 downloads per month
Used in 1 crate




Crates.io version Crates.io downloads Docs.rs docs

Rust bindings for the NVIDIA Management Library (NVML), a C-based programmatic interface for monitoring and managing various states within NVIDIA (primarily Tesla) GPUs.

It is intended to be a platform for building 3rd-party applications, and is also the underlying library for NVIDIA's nvidia-smi tool.

NVML supports the following platforms:

  • Windows
    • Windows Server 2008 R2 64-bit
    • Windows Server 2012 R2 64-bit
    • Windows 7 64-bit
    • Windows 8 64-bit
    • Windows 10 64-bit
  • Linux
    • 64-bit
    • 32-bit
  • Hypervisors
    • Windows Server 2008R2/2012 Hyper-V 64-bit
    • Citrix XenServer 6.2 SP1+
    • VMware ESX 5.1/5.5

And the following products:

  • Full Support
    • Tesla products Fermi architecture and up
    • Quadro products Fermi architecture and up
    • GRID products Kepler architecture and up
    • Select GeForce Titan products
  • Limited Support
    • All GeForce products Fermi architecture and up


The NVML library comes with the NVIDIA drivers and is essentially present on any system with a functioning NVIDIA graphics card. The compilation steps vary between Windows and Linux, however.


I have been able to successfully compile and run the tests for these bindings' wrapper using both the GNU and MSVC toolchains. An import library (nvml.lib) is included for compilation with the MSVC toolchain.

The NVML library dll can be found at %ProgramW6432%\NVIDIA Corporation\NVSMI\ (which is C:\Program Files\NVIDIA Corporation\NVSMI\ on my machine). I had to add this folder to my PATH or place a copy of the dll in the same folder as the executable in order to have everything work properly at runtime with the GNU toolchain. You may need to do the same; I'm not sure if the MSVC toolchain needs this step or not.


The NVML library can be found at /usr/lib/nvidia-<driver-version>/libnvidia-ml.so; on my system with driver version 375.51 installed, this puts the library at /usr/lib/nvidia-375/libnvidia-ml.so.

The sys crates' build script will automatically add the appropriate directory to the paths searched for the library, so you shouldn't have to do anything manually in theory.

NVML Support

These bindings were generated for NVML version 10.1. Each new version of NVML is guaranteed to be backwards-compatible according to NVIDIA, so these bindings should be useful regardless of NVML version bumps.

Rust Version Support

Currently supports Rust 1.19.0 or greater. The target version is the latest stable version; I do not intend to pin to an older one at any time.


Licensed under either of

at your option.


Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

No runtime deps