|
Packit Service |
a1973e |
The PAPI NVML component provides an interface to the nVidia Management Library (nvml, libnvidia-ml).
|
|
Packit Service |
a1973e |
|
|
Packit Service |
a1973e |
In versions 8 and later part of the CUDA Toolkit, The NVIDIA
|
|
Packit Service |
a1973e |
Management Library is no longer a separate download is installed with
|
|
Packit Service |
a1973e |
CUDA. On Linux/x86 platforms, it is often found in
|
|
Packit Service |
a1973e |
/usr/lib64/nvidia/libnvidia-ml.so
|
|
Packit Service |
a1973e |
|
|
Packit Service |
a1973e |
Other download packages may be available at
|
|
Packit Service |
a1973e |
https://developer.nvidia.com/gpu-deployment-kit
|
|
Packit Service |
a1973e |
|
|
Packit Service |
a1973e |
Before running the NVML component, the configure script for the NVML component
|
|
Packit Service |
a1973e |
must be executed in order to generate the Makefile which contains the
|
|
Packit Service |
a1973e |
configuration settings. This script needs to be executed only once.
|
|
Packit Service |
a1973e |
|
|
Packit Service |
a1973e |
% cd < papi_dir >/src/components/nvml
|
|
Packit Service |
a1973e |
% ./configure --with-nvml-libdir=<NVMLDIR>> --with-nvml-incdir=<NVMLDIR> --with-cuda-dir=<CUDADIR>
|
|
Packit Service |
a1973e |
|
|
Packit Service |
a1973e |
For example, one configuration may look like this
|
|
Packit Service |
a1973e |
%./configure --with-nvml-libdir=/usr/lib64/nvidia --with-nvml-incdir=/usr/local/cuda/include --with-cuda-dir=/usr/local/cuda
|
|
Packit Service |
a1973e |
|
|
Packit Service |
a1973e |
The NVML component is added to PAPI during the configuration of PAPI
|
|
Packit Service |
a1973e |
by adding the '--with-components=nvml' command line option to
|
|
Packit Service |
a1973e |
configure.
|
|
Packit Service |
a1973e |
|
|
Packit Service |
a1973e |
% ./configure --with-components="nvml"
|
|
Packit Service |
a1973e |
|
|
Packit Service |
a1973e |
At build-time the nVidia compiler, nvcc, needs to be in your path, as does the cuda run-time library (libcudart.so).
|
|
Packit Service |
a1973e |
|
|
Packit Service |
a1973e |
Please refer to http://developer.download.nvidia.com/assets/cuda/files/CUDADownloads/NVML/nvml.pdf
|
|
Packit Service |
a1973e |
for details about NVML library.
|
|
Packit Service |
a1973e |
|
|
Packit Service |
a1973e |
|
|
Packit Service |
a1973e |
|
|
Packit Service |
a1973e |
Note: Power Limiting using NVML (aka power capping) requires root.
|
|
Packit Service |
a1973e |
|
|
Packit Service |
a1973e |
PAPI has added support for power limiting using NVML (on supported
|
|
Packit Service |
a1973e |
devices from the Kepler family or later). The executable needs to
|
|
Packit Service |
a1973e |
have root permissions to change the power limits on the device.
|
|
Packit Service |
a1973e |
|
|
Packit Service |
a1973e |
The power_management_limit can be written to set a limit (in
|
|
Packit Service |
a1973e |
milliWatts) to the power consumption by DEVICE. The value that can
|
|
Packit Service |
a1973e |
be written needs to be between the
|
|
Packit Service |
a1973e |
power_management_limit_constraint_min and
|
|
Packit Service |
a1973e |
power_management_limit_constraint_max.
|
|
Packit Service |
a1973e |
|
|
Packit Service |
a1973e |
nvml:::DEVICE:power_management_limit
|
|
Packit Service |
a1973e |
nvml:::DEVICE:power_management_limit_constraint_min
|
|
Packit Service |
a1973e |
nvml:::DEVICE:power_management_limit_constraint_max
|
|
Packit Service |
a1973e |
|
|
Packit Service |
a1973e |
A test for writing of the power_management_limit can be found in the
|
|
Packit Service |
a1973e |
nvml/tests.
|