General information
-------------------

The PAPI NVML component provides an interface to the NVIDIA Management 
LIBRARY (nvml). The default name of the library is libnvidia-ml.so.
 
This PAPI CUDA component has been developed and tested using CUDA
version 10.1 and the associated CUPTI library. CUPTI is released with
the CUDA Tools SDK.

How to install PAPI with the NVML component?
-------------------------------------------- 

The NVML component is provided by NVIDIA as a standard part of the
CUDA Toolkit download. Two of the same libraries are required for the
CUDA and NVML components. To avoid confusion or the use of multiple
versions of the same library, the NVML component uses the same
environment variable (PAPI_CUDA_ROOT) and overrides as CUDA. Those two
libraries are libcuda.so, and libcudart.so.

There is ONE required environment variable: PAPI_CUDA_ROOT. This is
required for both compiling, and at runtime. 

An example that works on ICL's Saturn system (at this writing):
export PAPI_CUDA_ROOT=/usr/local/cuda-10.1

Within PAPI_CUDA_ROOT, we expect the following standard directories:
PAPI_CUDA_ROOT/include
PAPI_CUDA_ROOT/lib64

For a standard installed system, this is the only environment variable
required for both compile and runtime. 

System configurations can vary. Some systems use Spack, a package
manager, to automatically keep paths straight. Others (like our own
ICL Saturn System) require "module load" commands to provide some
services, e.g. 'module load cuda-10.1', and these may also set
environment variables and change the LD_LIBRARY_PATH search order.

Users may require the help of sysadmin personnel to navigate these
facilities and gain access to the correct libraries.

Configure PAPI with NVML enabled. We presume you have navigated to the
directory papi/src. In that directory:
    % ./configure --with-components="nvml"

Build with PAPI_CUDA_ROOT specified (ICL's Saturn example again):
    % export PAPI_CUDA_ROOT=/usr/local/cuda-10.1
    % make 

TESTING the component is installed: Still from papi/src:
    % utils/papi_component_avail

For the NVML component to be operational, it must find the dynamic
libraries libcuda.so, libcudart.so, and libnvidia-ml.so.

If any of these are not found (or are not functional) then the
component will be listed as "disabled" with a reason explaining the
problem. If libraries were not found, then they are not in the
expected places. The component can be configured to look for each of
these libraries in a specific place, and using an alternate name if
desired. Detailed instructions are contained in the Rules.nvml file.
They are technical, users may wish to enlist the help of a sysadmin.

To find a list of NVML supported events:
    % utils/papi_native_avail | grep -i NVML
