NVML API Reference#
The NVIDIA Management Library (NVML) is a C-based programmatic interface for monitoring and managing
various states within NVIDIA GPUs. It is intended to be a platform for building 3rd party
applications, and is also the underlying library for the NVIDIA-supported nvidia-smi tool. NVML
is thread-safe so it is safe to make simultaneous NVML calls from multiple threads.
API Documentation#
Supported operating systems and products:
For the list of supported operating systems and Data Center GPU products corresponding to your driver version, refer to the NVIDIA Data Center Documentation. NVML also has limited support for newer non-data-center GPUs (for example, NVIDIA® GeForce® or NVIDIA® RTX® GPUs).
The NVML library can be found at the following locations on Windows:
Standard driver install:
%ProgramW6432%\"NVIDIA Corporation"\NVSMI\DCH driver install:
\Windows\System32
Note that these libraries will not be added to the path on Windows. To dynamically link to NVML, add
this path to the PATH environmental variable. To dynamically load NVML, call LoadLibrary with
this path.
On Linux, the NVML library is named “libnvidia-ml.so” and can be found on the standard library
path. To link against the NVML library, add the -lnvidia-ml flag to your linker command.
The NVML API is divided into five categories:
Support Methods:
Initialization and Cleanup
Query Methods:
System QueriesDevice QueriesUnit Queries
Control Methods:
Unit CommandsDevice Commands
Event Handling Methods:
Event Handling Methods
Error Reporting Methods:
Error Reporting