All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bytedeco.javacpp.nvml Maven / Gradle / Ivy

The newest version!
// Targeted by JavaCPP version 1.4.4: DO NOT EDIT THIS FILE

package org.bytedeco.javacpp;

import java.nio.*;
import org.bytedeco.javacpp.*;
import org.bytedeco.javacpp.annotation.*;

import static org.bytedeco.javacpp.cuda.*;

public class nvml extends org.bytedeco.javacpp.presets.nvml {
    static { Loader.load(); }

// Parsed from 

/*
 * Copyright 1993-2018 NVIDIA Corporation.  All rights reserved.
 *
 * NOTICE TO USER:   
 *
 * This source code is subject to NVIDIA ownership rights under U.S. and 
 * international Copyright laws.  Users and possessors of this source code 
 * are hereby granted a nonexclusive, royalty-free license to use this code 
 * in individual and commercial software.
 *
 * NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE 
 * CODE FOR ANY PURPOSE.  IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR 
 * IMPLIED WARRANTY OF ANY KIND.  NVIDIA DISCLAIMS ALL WARRANTIES WITH 
 * REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF 
 * MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
 * IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, 
 * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 
 * OF USE, DATA OR PROFITS,  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 
 * OR OTHER TORTIOUS ACTION,  ARISING OUT OF OR IN CONNECTION WITH THE USE 
 * OR PERFORMANCE OF THIS SOURCE CODE.  
 *
 * U.S. Government End Users.   This source code is a "commercial item" as 
 * that term is defined at  48 C.F.R. 2.101 (OCT 1995), consisting  of 
 * "commercial computer  software"  and "commercial computer software 
 * documentation" as such terms are  used in 48 C.F.R. 12.212 (SEPT 1995) 
 * and is provided to the U.S. Government only as a commercial end item.  
 * Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through 
 * 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the 
 * source code with only those rights set forth herein. 
 *
 * Any use of this source code in individual and commercial software must 
 * include, in the user documentation and internal comments to the code,
 * the above Disclaimer and U.S. Government End Users Notice.
 */

/* 
NVML API Reference

The NVIDIA Management Library (NVML) is a C-based programmatic interface for monitoring and 
managing various states within NVIDIA Tesla &tm; 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 platforms:
- Windows:     Windows Server 2008 R2 64bit, Windows Server 2012 R2 64bit, Windows 7 64bit, Windows 8 64bit, Windows 10 64bit
- Linux:       32-bit and 64-bit
- Hypervisors: Windows Server 2008R2/2012 Hyper-V 64bit, Citrix XenServer 6.2 SP1+, VMware ESX 5.1/5.5

Supported products:
- Full Support
    - All Tesla products, starting with the Fermi architecture
    - All Quadro products, starting with the Fermi architecture
    - All GRID products, starting with the Kepler architecture
    - Selected GeForce Titan products
- Limited Support
    - All Geforce products, starting with the Fermi architecture

The NVML library can be found at \%ProgramW6432\%\\"NVIDIA Corporation"\\NVSMI\\ on Windows. It is
not be added to the system path by default. 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 will be found on the standard library path. For 64 bit Linux, both the 32 bit
and 64 bit NVML libraries will be installed.

Online documentation for this library is available at http://docs.nvidia.com/deploy/nvml-api/index.html
*/

// #ifndef __nvml_nvml_h__
// #define __nvml_nvml_h__

// #ifdef __cplusplus
// #endif

/*
 * On Windows, set up methods for DLL export
 * define NVML_STATIC_IMPORT when using nvml_loader library
 */
// #if defined _WINDOWS
//     #if !defined NVML_STATIC_IMPORT
//         #if defined NVML_LIB_EXPORT
//             #define DECLDIR __declspec(dllexport)
//         #else
//             #define DECLDIR __declspec(dllimport)
//         #endif
//     #else
//         #define DECLDIR
//     #endif
// #else
//     #define DECLDIR
// #endif

/**
 * NVML API versioning support
 */
public static final int NVML_API_VERSION =            10;
public static final String NVML_API_VERSION_STR =        "10";
// #define nvmlInit                    nvmlInit_v2
// #define nvmlDeviceGetPciInfo        nvmlDeviceGetPciInfo_v3
// #define nvmlDeviceGetCount          nvmlDeviceGetCount_v2
// #define nvmlDeviceGetHandleByIndex  nvmlDeviceGetHandleByIndex_v2
// #define nvmlDeviceGetHandleByPciBusId nvmlDeviceGetHandleByPciBusId_v2
// #define nvmlDeviceGetNvLinkRemotePciInfo nvmlDeviceGetNvLinkRemotePciInfo_v2
// #define nvmlDeviceRemoveGpu         nvmlDeviceRemoveGpu_v2

/***************************************************************************************************/
/** \defgroup nvmlDeviceStructs Device Structs
 *  \{
 */
/***************************************************************************************************/

/**
 * Special constant that some fields take when they are not available.
 * Used when only part of the struct is not available.
 *
 * Each structure explicitly states when to check for this value.
 */
public static final int NVML_VALUE_NOT_AVAILABLE = (-1);

@Opaque public static class nvmlDevice_st extends Pointer {
    /** Empty constructor. Calls {@code super((Pointer)null)}. */
    public nvmlDevice_st() { super((Pointer)null); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public nvmlDevice_st(Pointer p) { super(p); }
}

/**
 * Buffer size guaranteed to be large enough for pci bus id
 */
public static final int NVML_DEVICE_PCI_BUS_ID_BUFFER_SIZE =      32;

/**
 * Buffer size guaranteed to be large enough for pci bus id for ::busIdLegacy
 */
public static final int NVML_DEVICE_PCI_BUS_ID_BUFFER_V2_SIZE =   16;

/**
 * PCI information about a GPU device.
 */
public static class nvmlPciInfo_t extends Pointer {
    static { Loader.load(); }
    /** Default native constructor. */
    public nvmlPciInfo_t() { super((Pointer)null); allocate(); }
    /** Native array allocator. Access with {@link Pointer#position(long)}. */
    public nvmlPciInfo_t(long size) { super((Pointer)null); allocateArray(size); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public nvmlPciInfo_t(Pointer p) { super(p); }
    private native void allocate();
    private native void allocateArray(long size);
    @Override public nvmlPciInfo_t position(long position) {
        return (nvmlPciInfo_t)super.position(position);
    }

    /** The legacy tuple domain:bus:device.function PCI identifier (& NULL terminator) */
    public native @Cast("char") byte busIdLegacy(int i); public native nvmlPciInfo_t busIdLegacy(int i, byte busIdLegacy);
    @MemberGetter public native @Cast("char*") BytePointer busIdLegacy();
    /** The PCI domain on which the device's bus resides, 0 to 0xffffffff */
    public native @Cast("unsigned int") int domain(); public native nvmlPciInfo_t domain(int domain);
    /** The bus on which the device resides, 0 to 0xff */
    public native @Cast("unsigned int") int bus(); public native nvmlPciInfo_t bus(int bus);
    /** The device's id on the bus, 0 to 31 */
    public native @Cast("unsigned int") int device(); public native nvmlPciInfo_t device(int device);
    /** The combined 16-bit device id and 16-bit vendor id */
    public native @Cast("unsigned int") int pciDeviceId(); public native nvmlPciInfo_t pciDeviceId(int pciDeviceId);

    // Added in NVML 2.285 API
    /** The 32-bit Sub System Device ID */
    public native @Cast("unsigned int") int pciSubSystemId(); public native nvmlPciInfo_t pciSubSystemId(int pciSubSystemId);

    /** The tuple domain:bus:device.function PCI identifier (& NULL terminator) */
    public native @Cast("char") byte busId(int i); public native nvmlPciInfo_t busId(int i, byte busId);
    @MemberGetter public native @Cast("char*") BytePointer busId();
}

/**
 * PCI format string for ::busIdLegacy
 */
public static final String NVML_DEVICE_PCI_BUS_ID_LEGACY_FMT =           "%04X:%02X:%02X.0";

/**
 * PCI format string for ::busId
 */
public static final String NVML_DEVICE_PCI_BUS_ID_FMT =                  "%08X:%02X:%02X.0";

/**
 * Utility macro for filling the pci bus id format from a nvmlPciInfo_t
 */
// #define NVML_DEVICE_PCI_BUS_ID_FMT_ARGS(pciInfo)    (pciInfo)->domain,
//                                                     (pciInfo)->bus,
//                                                     (pciInfo)->device

/**
 * Detailed ECC error counts for a device.
 *
 * @deprecated  Different GPU families can have different memory error counters
 *              See \ref nvmlDeviceGetMemoryErrorCounter
 */
public static class nvmlEccErrorCounts_t extends Pointer {
    static { Loader.load(); }
    /** Default native constructor. */
    public nvmlEccErrorCounts_t() { super((Pointer)null); allocate(); }
    /** Native array allocator. Access with {@link Pointer#position(long)}. */
    public nvmlEccErrorCounts_t(long size) { super((Pointer)null); allocateArray(size); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public nvmlEccErrorCounts_t(Pointer p) { super(p); }
    private native void allocate();
    private native void allocateArray(long size);
    @Override public nvmlEccErrorCounts_t position(long position) {
        return (nvmlEccErrorCounts_t)super.position(position);
    }

    /** L1 cache errors */
    public native @Cast("unsigned long long") long l1Cache(); public native nvmlEccErrorCounts_t l1Cache(long l1Cache);
    /** L2 cache errors */
    public native @Cast("unsigned long long") long l2Cache(); public native nvmlEccErrorCounts_t l2Cache(long l2Cache);
    /** Device memory errors */
    public native @Cast("unsigned long long") long deviceMemory(); public native nvmlEccErrorCounts_t deviceMemory(long deviceMemory);
    /** Register file errors */
    public native @Cast("unsigned long long") long registerFile(); public native nvmlEccErrorCounts_t registerFile(long registerFile);
}

/** 
 * Utilization information for a device.
 * Each sample period may be between 1 second and 1/6 second, depending on the product being queried.
 */
public static class nvmlUtilization_t extends Pointer {
    static { Loader.load(); }
    /** Default native constructor. */
    public nvmlUtilization_t() { super((Pointer)null); allocate(); }
    /** Native array allocator. Access with {@link Pointer#position(long)}. */
    public nvmlUtilization_t(long size) { super((Pointer)null); allocateArray(size); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public nvmlUtilization_t(Pointer p) { super(p); }
    private native void allocate();
    private native void allocateArray(long size);
    @Override public nvmlUtilization_t position(long position) {
        return (nvmlUtilization_t)super.position(position);
    }

    /** Percent of time over the past sample period during which one or more kernels was executing on the GPU */
    public native @Cast("unsigned int") int gpu(); public native nvmlUtilization_t gpu(int gpu);
    /** Percent of time over the past sample period during which global (device) memory was being read or written */
    public native @Cast("unsigned int") int memory(); public native nvmlUtilization_t memory(int memory);
}

/** 
 * Memory allocation information for a device.
 */
public static class nvmlMemory_t extends Pointer {
    static { Loader.load(); }
    /** Default native constructor. */
    public nvmlMemory_t() { super((Pointer)null); allocate(); }
    /** Native array allocator. Access with {@link Pointer#position(long)}. */
    public nvmlMemory_t(long size) { super((Pointer)null); allocateArray(size); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public nvmlMemory_t(Pointer p) { super(p); }
    private native void allocate();
    private native void allocateArray(long size);
    @Override public nvmlMemory_t position(long position) {
        return (nvmlMemory_t)super.position(position);
    }

    /** Total installed FB memory (in bytes) */
    public native @Cast("unsigned long long") long total(); public native nvmlMemory_t total(long total);
    /** Unallocated FB memory (in bytes) */
    public native @Cast("unsigned long long") long free(); public native nvmlMemory_t free(long free);
    /** Allocated FB memory (in bytes). Note that the driver/GPU always sets aside a small amount of memory for bookkeeping */
    public native @Cast("unsigned long long") long used(); public native nvmlMemory_t used(long used);
}

/**
 * BAR1 Memory allocation Information for a device
 */
public static class nvmlBAR1Memory_t extends Pointer {
    static { Loader.load(); }
    /** Default native constructor. */
    public nvmlBAR1Memory_t() { super((Pointer)null); allocate(); }
    /** Native array allocator. Access with {@link Pointer#position(long)}. */
    public nvmlBAR1Memory_t(long size) { super((Pointer)null); allocateArray(size); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public nvmlBAR1Memory_t(Pointer p) { super(p); }
    private native void allocate();
    private native void allocateArray(long size);
    @Override public nvmlBAR1Memory_t position(long position) {
        return (nvmlBAR1Memory_t)super.position(position);
    }

    /** Total BAR1 Memory (in bytes) */
    public native @Cast("unsigned long long") long bar1Total(); public native nvmlBAR1Memory_t bar1Total(long bar1Total);
    /** Unallocated BAR1 Memory (in bytes) */
    public native @Cast("unsigned long long") long bar1Free(); public native nvmlBAR1Memory_t bar1Free(long bar1Free);
    /** Allocated Used Memory (in bytes) */
    public native @Cast("unsigned long long") long bar1Used(); public native nvmlBAR1Memory_t bar1Used(long bar1Used);
}

/**
 * Information about running compute processes on the GPU
 */
public static class nvmlProcessInfo_t extends Pointer {
    static { Loader.load(); }
    /** Default native constructor. */
    public nvmlProcessInfo_t() { super((Pointer)null); allocate(); }
    /** Native array allocator. Access with {@link Pointer#position(long)}. */
    public nvmlProcessInfo_t(long size) { super((Pointer)null); allocateArray(size); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public nvmlProcessInfo_t(Pointer p) { super(p); }
    private native void allocate();
    private native void allocateArray(long size);
    @Override public nvmlProcessInfo_t position(long position) {
        return (nvmlProcessInfo_t)super.position(position);
    }

    /** Process ID */
    public native @Cast("unsigned int") int pid(); public native nvmlProcessInfo_t pid(int pid);
    /** Amount of used GPU memory in bytes. */
    public native @Cast("unsigned long long") long usedGpuMemory(); public native nvmlProcessInfo_t usedGpuMemory(long usedGpuMemory);
                                      /** Under WDDM, \ref NVML_VALUE_NOT_AVAILABLE is always reported
                                       *  because Windows KMD manages all the memory and not the NVIDIA driver */
}

/**
 * Enum to represent type of bridge chip
 */
/** enum nvmlBridgeChipType_enum */
public static final int
    NVML_BRIDGE_CHIP_PLX = 0,
    NVML_BRIDGE_CHIP_BRO4 = 1;

/**
 * Maximum number of NvLink links supported 
 */
public static final int NVML_NVLINK_MAX_LINKS = 6;

/**
 * Enum to represent the NvLink utilization counter packet units
 */
/** enum nvmlNvLinkUtilizationCountUnits_enum */
public static final int
    NVML_NVLINK_COUNTER_UNIT_CYCLES = 0,     // count by cycles
    NVML_NVLINK_COUNTER_UNIT_PACKETS = 1,     // count by packets
    NVML_NVLINK_COUNTER_UNIT_BYTES   = 2,     // count by bytes

    // this must be last
    NVML_NVLINK_COUNTER_UNIT_COUNT = 3;

/**
 * Enum to represent the NvLink utilization counter packet types to count
 *  ** this is ONLY applicable with the units as packets or bytes
 *  ** as specified in \a nvmlNvLinkUtilizationCountUnits_t
 *  ** all packet filter descriptions are target GPU centric
 *  ** these can be "OR'd" together 
 */
/** enum nvmlNvLinkUtilizationCountPktTypes_enum */
public static final int
    NVML_NVLINK_COUNTER_PKTFILTER_NOP        = 0x1,     // no operation packets
    NVML_NVLINK_COUNTER_PKTFILTER_READ       = 0x2,     // read packets
    NVML_NVLINK_COUNTER_PKTFILTER_WRITE      = 0x4,     // write packets
    NVML_NVLINK_COUNTER_PKTFILTER_RATOM      = 0x8,     // reduction atomic requests
    NVML_NVLINK_COUNTER_PKTFILTER_NRATOM     = 0x10,    // non-reduction atomic requests
    NVML_NVLINK_COUNTER_PKTFILTER_FLUSH      = 0x20,    // flush requests
    NVML_NVLINK_COUNTER_PKTFILTER_RESPDATA   = 0x40,    // responses with data
    NVML_NVLINK_COUNTER_PKTFILTER_RESPNODATA = 0x80,    // responses without data
    NVML_NVLINK_COUNTER_PKTFILTER_ALL        = 0xFF;     // all packets

/** 
 * Struct to define the NVLINK counter controls
 */
public static class nvmlNvLinkUtilizationControl_t extends Pointer {
    static { Loader.load(); }
    /** Default native constructor. */
    public nvmlNvLinkUtilizationControl_t() { super((Pointer)null); allocate(); }
    /** Native array allocator. Access with {@link Pointer#position(long)}. */
    public nvmlNvLinkUtilizationControl_t(long size) { super((Pointer)null); allocateArray(size); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public nvmlNvLinkUtilizationControl_t(Pointer p) { super(p); }
    private native void allocate();
    private native void allocateArray(long size);
    @Override public nvmlNvLinkUtilizationControl_t position(long position) {
        return (nvmlNvLinkUtilizationControl_t)super.position(position);
    }

    public native @Cast("nvmlNvLinkUtilizationCountUnits_t") int units(); public native nvmlNvLinkUtilizationControl_t units(int units);
    public native @Cast("nvmlNvLinkUtilizationCountPktTypes_t") int pktfilter(); public native nvmlNvLinkUtilizationControl_t pktfilter(int pktfilter);
}

/**
 * Enum to represent NvLink queryable capabilities
 */
/** enum nvmlNvLinkCapability_enum */
public static final int
    NVML_NVLINK_CAP_P2P_SUPPORTED = 0,     // P2P over NVLink is supported
    NVML_NVLINK_CAP_SYSMEM_ACCESS = 1,     // Access to system memory is supported
    NVML_NVLINK_CAP_P2P_ATOMICS   = 2,     // P2P atomics are supported
    NVML_NVLINK_CAP_SYSMEM_ATOMICS = 3,     // System memory atomics are supported
    NVML_NVLINK_CAP_SLI_BRIDGE    = 4,     // SLI is supported over this link
    NVML_NVLINK_CAP_VALID         = 5,     // Link is supported on this device
    // should be last
    NVML_NVLINK_CAP_COUNT = 6;

/**
 * Enum to represent NvLink queryable error counters
 */
/** enum nvmlNvLinkErrorCounter_enum */
public static final int
    NVML_NVLINK_ERROR_DL_REPLAY   = 0,     // Data link transmit replay error counter
    NVML_NVLINK_ERROR_DL_RECOVERY = 1,     // Data link transmit recovery error counter
    NVML_NVLINK_ERROR_DL_CRC_FLIT = 2,     // Data link receive flow control digit CRC error counter
    NVML_NVLINK_ERROR_DL_CRC_DATA = 3,     // Data link receive data CRC error counter

    // this must be last
    NVML_NVLINK_ERROR_COUNT = 4;

/**
 * Represents level relationships within a system between two GPUs
 * The enums are spaced to allow for future relationships
 */
/** enum nvmlGpuLevel_enum */
public static final int
    NVML_TOPOLOGY_INTERNAL           = 0, // e.g. Tesla K80
    NVML_TOPOLOGY_SINGLE             = 10, // all devices that only need traverse a single PCIe switch
    NVML_TOPOLOGY_MULTIPLE           = 20, // all devices that need not traverse a host bridge
    NVML_TOPOLOGY_HOSTBRIDGE         = 30, // all devices that are connected to the same host bridge
    NVML_TOPOLOGY_NODE               = 40, // all devices that are connected to the same NUMA node but possibly multiple host bridges
    NVML_TOPOLOGY_SYSTEM             = 50; // all devices in the system

    // there is purposefully no COUNT here because of the need for spacing above

/* Compatibility for CPU->NODE renaming */
public static final int NVML_TOPOLOGY_CPU = NVML_TOPOLOGY_NODE;

/* P2P Capability Index Status*/
/** enum nvmlGpuP2PStatus_enum */
public static final int
    NVML_P2P_STATUS_OK     = 0,
    NVML_P2P_STATUS_CHIPSET_NOT_SUPPORED = 1,
    NVML_P2P_STATUS_GPU_NOT_SUPPORTED = 2,
    NVML_P2P_STATUS_IOH_TOPOLOGY_NOT_SUPPORTED = 3,
    NVML_P2P_STATUS_DISABLED_BY_REGKEY = 4,
    NVML_P2P_STATUS_NOT_SUPPORTED = 5,
    NVML_P2P_STATUS_UNKNOWN = 6;

/* P2P Capability Index*/
/** enum nvmlGpuP2PCapsIndex_enum */
public static final int
    NVML_P2P_CAPS_INDEX_READ = 0,
    NVML_P2P_CAPS_INDEX_WRITE = 1,
    NVML_P2P_CAPS_INDEX_NVLINK = 2,
    NVML_P2P_CAPS_INDEX_ATOMICS = 3,
    NVML_P2P_CAPS_INDEX_PROP = 4,
    NVML_P2P_CAPS_INDEX_UNKNOWN = 5;

/**
 * Maximum limit on Physical Bridges per Board
 */
public static final int NVML_MAX_PHYSICAL_BRIDGE =                         (128);

/**
 * Information about the Bridge Chip Firmware
 */
public static class nvmlBridgeChipInfo_t extends Pointer {
    static { Loader.load(); }
    /** Default native constructor. */
    public nvmlBridgeChipInfo_t() { super((Pointer)null); allocate(); }
    /** Native array allocator. Access with {@link Pointer#position(long)}. */
    public nvmlBridgeChipInfo_t(long size) { super((Pointer)null); allocateArray(size); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public nvmlBridgeChipInfo_t(Pointer p) { super(p); }
    private native void allocate();
    private native void allocateArray(long size);
    @Override public nvmlBridgeChipInfo_t position(long position) {
        return (nvmlBridgeChipInfo_t)super.position(position);
    }

    /** Type of Bridge Chip  */
    public native @Cast("nvmlBridgeChipType_t") int type(); public native nvmlBridgeChipInfo_t type(int type);
    /** Firmware Version. 0=Version is unavailable */
    public native @Cast("unsigned int") int fwVersion(); public native nvmlBridgeChipInfo_t fwVersion(int fwVersion);
}

/**
 * This structure stores the complete Hierarchy of the Bridge Chip within the board. The immediate 
 * bridge is stored at index 0 of bridgeInfoList, parent to immediate bridge is at index 1 and so forth.
 */
public static class nvmlBridgeChipHierarchy_t extends Pointer {
    static { Loader.load(); }
    /** Default native constructor. */
    public nvmlBridgeChipHierarchy_t() { super((Pointer)null); allocate(); }
    /** Native array allocator. Access with {@link Pointer#position(long)}. */
    public nvmlBridgeChipHierarchy_t(long size) { super((Pointer)null); allocateArray(size); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public nvmlBridgeChipHierarchy_t(Pointer p) { super(p); }
    private native void allocate();
    private native void allocateArray(long size);
    @Override public nvmlBridgeChipHierarchy_t position(long position) {
        return (nvmlBridgeChipHierarchy_t)super.position(position);
    }

    /** Number of Bridge Chips on the Board */
    public native @Cast("unsigned char") byte bridgeCount(); public native nvmlBridgeChipHierarchy_t bridgeCount(byte bridgeCount);
    /** Hierarchy of Bridge Chips on the board */
    public native @ByRef nvmlBridgeChipInfo_t bridgeChipInfo(int i); public native nvmlBridgeChipHierarchy_t bridgeChipInfo(int i, nvmlBridgeChipInfo_t bridgeChipInfo);
    @MemberGetter public native nvmlBridgeChipInfo_t bridgeChipInfo();
}

/**
 *  Represents Type of Sampling Event
 */
/** enum nvmlSamplingType_enum */
public static final int
    /** To represent total power drawn by GPU */
    NVML_TOTAL_POWER_SAMPLES        = 0,
    /** To represent percent of time during which one or more kernels was executing on the GPU */
    NVML_GPU_UTILIZATION_SAMPLES    = 1,
    /** To represent percent of time during which global (device) memory was being read or written */
    NVML_MEMORY_UTILIZATION_SAMPLES = 2,
    /** To represent percent of time during which NVENC remains busy */
    NVML_ENC_UTILIZATION_SAMPLES    = 3,
    /** To represent percent of time during which NVDEC remains busy             */
    NVML_DEC_UTILIZATION_SAMPLES    = 4,
    /** To represent processor clock samples */
    NVML_PROCESSOR_CLK_SAMPLES      = 5,
    /** To represent memory clock samples */
    NVML_MEMORY_CLK_SAMPLES         = 6,
            
    // Keep this last
    NVML_SAMPLINGTYPE_COUNT = 7;

/**
 * Represents the queryable PCIe utilization counters
 */
/** enum nvmlPcieUtilCounter_enum */
public static final int
    NVML_PCIE_UTIL_TX_BYTES             = 0, // 1KB granularity
    NVML_PCIE_UTIL_RX_BYTES             = 1, // 1KB granularity
    
    // Keep this last
    NVML_PCIE_UTIL_COUNT = 2;

/**
 * Represents the type for sample value returned
 */
/** enum nvmlValueType_enum */
public static final int
    NVML_VALUE_TYPE_DOUBLE = 0,
    NVML_VALUE_TYPE_UNSIGNED_INT = 1,
    NVML_VALUE_TYPE_UNSIGNED_LONG = 2,
    NVML_VALUE_TYPE_UNSIGNED_LONG_LONG = 3,
    NVML_VALUE_TYPE_SIGNED_LONG_LONG = 4,

    // Keep this last
    NVML_VALUE_TYPE_COUNT = 5;


/**
 * Union to represent different types of Value
 */
public static class nvmlValue_t extends Pointer {
    static { Loader.load(); }
    /** Default native constructor. */
    public nvmlValue_t() { super((Pointer)null); allocate(); }
    /** Native array allocator. Access with {@link Pointer#position(long)}. */
    public nvmlValue_t(long size) { super((Pointer)null); allocateArray(size); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public nvmlValue_t(Pointer p) { super(p); }
    private native void allocate();
    private native void allocateArray(long size);
    @Override public nvmlValue_t position(long position) {
        return (nvmlValue_t)super.position(position);
    }

    /** If the value is double */
    public native double dVal(); public native nvmlValue_t dVal(double dVal);
    /** If the value is unsigned int */
    public native @Cast("unsigned int") int uiVal(); public native nvmlValue_t uiVal(int uiVal);
    /** If the value is unsigned long */
    public native @Cast("unsigned long") long ulVal(); public native nvmlValue_t ulVal(long ulVal);
    /** If the value is unsigned long long */
    public native @Cast("unsigned long long") long ullVal(); public native nvmlValue_t ullVal(long ullVal);
    /** If the value is signed long long */
    public native long sllVal(); public native nvmlValue_t sllVal(long sllVal);
}

/**
 * Information for Sample
 */
public static class nvmlSample_t extends Pointer {
    static { Loader.load(); }
    /** Default native constructor. */
    public nvmlSample_t() { super((Pointer)null); allocate(); }
    /** Native array allocator. Access with {@link Pointer#position(long)}. */
    public nvmlSample_t(long size) { super((Pointer)null); allocateArray(size); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public nvmlSample_t(Pointer p) { super(p); }
    private native void allocate();
    private native void allocateArray(long size);
    @Override public nvmlSample_t position(long position) {
        return (nvmlSample_t)super.position(position);
    }

    /** CPU Timestamp in microseconds */
    public native @Cast("unsigned long long") long timeStamp(); public native nvmlSample_t timeStamp(long timeStamp);
    /** Sample Value */
    public native @ByRef nvmlValue_t sampleValue(); public native nvmlSample_t sampleValue(nvmlValue_t sampleValue);
}

/**
 * Represents type of perf policy for which violation times can be queried 
 */
/** enum nvmlPerfPolicyType_enum */
public static final int
    /** How long did power violations cause the GPU to be below application clocks */
    NVML_PERF_POLICY_POWER = 0,
    /** How long did thermal violations cause the GPU to be below application clocks */
    NVML_PERF_POLICY_THERMAL = 1,
    /** How long did sync boost cause the GPU to be below application clocks */
    NVML_PERF_POLICY_SYNC_BOOST = 2,
    /** How long did the board limit cause the GPU to be below application clocks */
    NVML_PERF_POLICY_BOARD_LIMIT = 3,
    /** How long did low utilization cause the GPU to be below application clocks */
    NVML_PERF_POLICY_LOW_UTILIZATION = 4,
    /** How long did the board reliability limit cause the GPU to be below application clocks */
    NVML_PERF_POLICY_RELIABILITY = 5,

    /** Total time the GPU was held below application clocks by any limiter (0 - 5 above) */
    NVML_PERF_POLICY_TOTAL_APP_CLOCKS = 10,
    /** Total time the GPU was held below base clocks */
    NVML_PERF_POLICY_TOTAL_BASE_CLOCKS = 11,

    // Keep this last
    NVML_PERF_POLICY_COUNT = 12;

/**
 * Struct to hold perf policy violation status data
 */
public static class nvmlViolationTime_t extends Pointer {
    static { Loader.load(); }
    /** Default native constructor. */
    public nvmlViolationTime_t() { super((Pointer)null); allocate(); }
    /** Native array allocator. Access with {@link Pointer#position(long)}. */
    public nvmlViolationTime_t(long size) { super((Pointer)null); allocateArray(size); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public nvmlViolationTime_t(Pointer p) { super(p); }
    private native void allocate();
    private native void allocateArray(long size);
    @Override public nvmlViolationTime_t position(long position) {
        return (nvmlViolationTime_t)super.position(position);
    }

    /** referenceTime represents CPU timestamp in microseconds */
    public native @Cast("unsigned long long") long referenceTime(); public native nvmlViolationTime_t referenceTime(long referenceTime);
    /** violationTime in Nanoseconds */
    public native @Cast("unsigned long long") long violationTime(); public native nvmlViolationTime_t violationTime(long violationTime);
}

/** \} */

/***************************************************************************************************/
/** \defgroup nvmlDeviceEnumvs Device Enums
 *  \{
 */
/***************************************************************************************************/

/** 
 * Generic enable/disable enum. 
 */
/** enum nvmlEnableState_enum */
public static final int
    /** Feature disabled  */
    NVML_FEATURE_DISABLED    = 0,
    /** Feature enabled */
    NVML_FEATURE_ENABLED     = 1;

/** Generic flag used to specify the default behavior of some functions. See description of particular functions for details. */
public static final int nvmlFlagDefault =     0x00;      
/** Generic flag used to force some behavior. See description of particular functions for details. */
public static final int nvmlFlagForce =       0x01;      

/**
 *  * The Brand of the GPU
 *   */
/** enum nvmlBrandType_enum */
public static final int
    NVML_BRAND_UNKNOWN = 0, 
    NVML_BRAND_QUADRO  = 1,
    NVML_BRAND_TESLA   = 2,
    NVML_BRAND_NVS     = 3,
    NVML_BRAND_GRID    = 4,
    NVML_BRAND_GEFORCE = 5,
    NVML_BRAND_TITAN   = 6,

    // Keep this last
    NVML_BRAND_COUNT = 7;

/**
 * Temperature thresholds.
 */
/** enum nvmlTemperatureThresholds_enum */
public static final int
    NVML_TEMPERATURE_THRESHOLD_SHUTDOWN = 0,    // Temperature at which the GPU will shut down
                                                // for HW protection
    NVML_TEMPERATURE_THRESHOLD_SLOWDOWN = 1,    // Temperature at which the GPU will begin HW slowdown
    NVML_TEMPERATURE_THRESHOLD_MEM_MAX  = 2,    // Memory Temperature at which the GPU will begin SW slowdown
    NVML_TEMPERATURE_THRESHOLD_GPU_MAX  = 3,    // GPU Temperature at which the GPU can be throttled below base clock
    // Keep this last
    NVML_TEMPERATURE_THRESHOLD_COUNT = 4;

/** 
 * Temperature sensors. 
 */
/** enum nvmlTemperatureSensors_enum */
public static final int
    /** Temperature sensor for the GPU die */
    NVML_TEMPERATURE_GPU      = 0,
    
    // Keep this last
    NVML_TEMPERATURE_COUNT = 1;

/** 
 * Compute mode. 
 *
 * NVML_COMPUTEMODE_EXCLUSIVE_PROCESS was added in CUDA 4.0.
 * Earlier CUDA versions supported a single exclusive mode, 
 * which is equivalent to NVML_COMPUTEMODE_EXCLUSIVE_THREAD in CUDA 4.0 and beyond.
 */
/** enum nvmlComputeMode_enum */
public static final int
    /** Default compute mode -- multiple contexts per device */
    NVML_COMPUTEMODE_DEFAULT           = 0,
    /** Support Removed */
    NVML_COMPUTEMODE_EXCLUSIVE_THREAD  = 1,
    /** Compute-prohibited mode -- no contexts per device */
    NVML_COMPUTEMODE_PROHIBITED        = 2,
    /** Compute-exclusive-process mode -- only one context per device, usable from multiple threads at a time */
    NVML_COMPUTEMODE_EXCLUSIVE_PROCESS = 3,
    
    // Keep this last
    NVML_COMPUTEMODE_COUNT = 4;

/** 
 * ECC bit types.
 *
 * @deprecated See \ref nvmlMemoryErrorType_t for a more flexible type
 */
// #define nvmlEccBitType_t nvmlMemoryErrorType_t

/**
 * Single bit ECC errors
 *
 * @deprecated Mapped to \ref NVML_MEMORY_ERROR_TYPE_CORRECTED
 */
public static native @MemberGetter int NVML_SINGLE_BIT_ECC();
public static final int NVML_SINGLE_BIT_ECC = NVML_SINGLE_BIT_ECC();

/**
 * Double bit ECC errors
 *
 * @deprecated Mapped to \ref NVML_MEMORY_ERROR_TYPE_UNCORRECTED
 */
public static native @MemberGetter int NVML_DOUBLE_BIT_ECC();
public static final int NVML_DOUBLE_BIT_ECC = NVML_DOUBLE_BIT_ECC();

/**
 * Memory error types
 */
/** enum nvmlMemoryErrorType_enum */
public static final int
    /**
     * A memory error that was corrected
     * 
     * For ECC errors, these are single bit errors
     * For Texture memory, these are errors fixed by resend
     */
    NVML_MEMORY_ERROR_TYPE_CORRECTED = 0,
    /**
     * A memory error that was not corrected
     * 
     * For ECC errors, these are double bit errors
     * For Texture memory, these are errors where the resend fails
     */
    NVML_MEMORY_ERROR_TYPE_UNCORRECTED = 1,
    
    
    // Keep this last
    /** Count of memory error types */
    NVML_MEMORY_ERROR_TYPE_COUNT = 2;

/** 
 * ECC counter types. 
 *
 * Note: Volatile counts are reset each time the driver loads. On Windows this is once per boot. On Linux this can be more frequent.
 *       On Linux the driver unloads when no active clients exist. If persistence mode is enabled or there is always a driver 
 *       client active (e.g. X11), then Linux also sees per-boot behavior. If not, volatile counts are reset each time a compute app
 *       is run.
 */
/** enum nvmlEccCounterType_enum */
public static final int
    /** Volatile counts are reset each time the driver loads. */
    NVML_VOLATILE_ECC      = 0,
    /** Aggregate counts persist across reboots (i.e. for the lifetime of the device) */
    NVML_AGGREGATE_ECC     = 1,
    
    // Keep this last
    /** Count of memory counter types */
    NVML_ECC_COUNTER_TYPE_COUNT = 2;

/** 
 * Clock types. 
 * 
 * All speeds are in Mhz.
 */
/** enum nvmlClockType_enum */
public static final int
    /** Graphics clock domain */
    NVML_CLOCK_GRAPHICS  = 0,
    /** SM clock domain */
    NVML_CLOCK_SM        = 1,
    /** Memory clock domain */
    NVML_CLOCK_MEM       = 2,
    /** Video encoder/decoder clock domain */
    NVML_CLOCK_VIDEO     = 3,
    
    // Keep this last
    /** Count of clock types */
    NVML_CLOCK_COUNT = 4;

/**
 * Clock Ids.  These are used in combination with nvmlClockType_t
 * to specify a single clock value.
 */
/** enum nvmlClockId_enum */
public static final int
    /** Current actual clock value */
    NVML_CLOCK_ID_CURRENT            = 0,
    /** Target application clock */
    NVML_CLOCK_ID_APP_CLOCK_TARGET   = 1,
    /** Default application clock target */
    NVML_CLOCK_ID_APP_CLOCK_DEFAULT  = 2,
    /** OEM-defined maximum clock rate */
    NVML_CLOCK_ID_CUSTOMER_BOOST_MAX = 3,

    //Keep this last
    /** Count of Clock Ids. */
    NVML_CLOCK_ID_COUNT = 4;

/** 
 * Driver models. 
 *
 * Windows only.
 */
/** enum nvmlDriverModel_enum */
public static final int
    /** WDDM driver model -- GPU treated as a display device */
    NVML_DRIVER_WDDM      = 0,
    /** WDM (TCC) model (recommended) -- GPU treated as a generic device */
    NVML_DRIVER_WDM       = 1;

/**
 * Allowed PStates.
 */
/** enum nvmlPStates_enum */
public static final int
    /** Performance state 0 -- Maximum Performance */
    NVML_PSTATE_0               = 0,
    /** Performance state 1  */
    NVML_PSTATE_1               = 1,
    /** Performance state 2 */
    NVML_PSTATE_2               = 2,
    /** Performance state 3 */
    NVML_PSTATE_3               = 3,
    /** Performance state 4 */
    NVML_PSTATE_4               = 4,
    /** Performance state 5 */
    NVML_PSTATE_5               = 5,
    /** Performance state 6 */
    NVML_PSTATE_6               = 6,
    /** Performance state 7 */
    NVML_PSTATE_7               = 7,
    /** Performance state 8 */
    NVML_PSTATE_8               = 8,
    /** Performance state 9 */
    NVML_PSTATE_9               = 9,
    /** Performance state 10 */
    NVML_PSTATE_10              = 10,
    /** Performance state 11 */
    NVML_PSTATE_11              = 11,
    /** Performance state 12 */
    NVML_PSTATE_12              = 12,
    /** Performance state 13 */
    NVML_PSTATE_13              = 13,
    /** Performance state 14 */
    NVML_PSTATE_14              = 14,
    /** Performance state 15 -- Minimum Performance  */
    NVML_PSTATE_15              = 15,
    /** Unknown performance state */
    NVML_PSTATE_UNKNOWN         = 32;

/**
 * GPU Operation Mode
 *
 * GOM allows to reduce power usage and optimize GPU throughput by disabling GPU features.
 *
 * Each GOM is designed to meet specific user needs.
 */
/** enum nvmlGom_enum */
public static final int
    /** Everything is enabled and running at full speed */
    NVML_GOM_ALL_ON                    = 0,

    /** Designed for running only compute tasks. Graphics operations
 *  are not allowed */
    NVML_GOM_COMPUTE                   = 1,

    /** Designed for running graphics applications that don't require
 *  high bandwidth double precision */
    NVML_GOM_LOW_DP                    = 2;

/** 
 * Available infoROM objects.
 */
/** enum nvmlInforomObject_enum */
public static final int
    /** An object defined by OEM */
    NVML_INFOROM_OEM            = 0,
    /** The ECC object determining the level of ECC support */
    NVML_INFOROM_ECC            = 1,
    /** The power management object */
    NVML_INFOROM_POWER          = 2,

    // Keep this last
    /** This counts the number of infoROM objects the driver knows about */
    NVML_INFOROM_COUNT = 3;

/** 
 * Return values for NVML API calls. 
 */
/** enum nvmlReturn_enum */
public static final int
    /** The operation was successful */
    NVML_SUCCESS = 0,
    /** NVML was not first initialized with nvmlInit() */
    NVML_ERROR_UNINITIALIZED = 1,
    /** A supplied argument is invalid */
    NVML_ERROR_INVALID_ARGUMENT = 2,
    /** The requested operation is not available on target device */
    NVML_ERROR_NOT_SUPPORTED = 3,
    /** The current user does not have permission for operation */
    NVML_ERROR_NO_PERMISSION = 4,
    /** Deprecated: Multiple initializations are now allowed through ref counting */
    NVML_ERROR_ALREADY_INITIALIZED = 5,
    /** A query to find an object was unsuccessful */
    NVML_ERROR_NOT_FOUND = 6,
    /** An input argument is not large enough */
    NVML_ERROR_INSUFFICIENT_SIZE = 7,
    /** A device's external power cables are not properly attached */
    NVML_ERROR_INSUFFICIENT_POWER = 8,
    /** NVIDIA driver is not loaded */
    NVML_ERROR_DRIVER_NOT_LOADED = 9,
    /** User provided timeout passed */
    NVML_ERROR_TIMEOUT = 10,
    /** NVIDIA Kernel detected an interrupt issue with a GPU */
    NVML_ERROR_IRQ_ISSUE = 11,
    /** NVML Shared Library couldn't be found or loaded */
    NVML_ERROR_LIBRARY_NOT_FOUND = 12,
    /** Local version of NVML doesn't implement this function */
    NVML_ERROR_FUNCTION_NOT_FOUND = 13,
    /** infoROM is corrupted */
    NVML_ERROR_CORRUPTED_INFOROM = 14,
    /** The GPU has fallen off the bus or has otherwise become inaccessible */
    NVML_ERROR_GPU_IS_LOST = 15,
    /** The GPU requires a reset before it can be used again */
    NVML_ERROR_RESET_REQUIRED = 16,
    /** The GPU control device has been blocked by the operating system/cgroups */
    NVML_ERROR_OPERATING_SYSTEM = 17,
    /** RM detects a driver/library version mismatch */
    NVML_ERROR_LIB_RM_VERSION_MISMATCH = 18,
    /** An operation cannot be performed because the GPU is currently in use */
    NVML_ERROR_IN_USE = 19,
    /** Insufficient memory */
    NVML_ERROR_MEMORY = 20,
    /**No data */
    NVML_ERROR_NO_DATA = 21,
    /** The requested vgpu operation is not available on target device, becasue ECC is enabled */
    NVML_ERROR_VGPU_ECC_NOT_SUPPORTED = 22,
    /** An internal driver error occurred */
    NVML_ERROR_UNKNOWN = 999;

/**
 * See \ref nvmlDeviceGetMemoryErrorCounter
 */
/** enum nvmlMemoryLocation_enum */
public static final int
    /** GPU L1 Cache */
    NVML_MEMORY_LOCATION_L1_CACHE        = 0,
    /** GPU L2 Cache */
    NVML_MEMORY_LOCATION_L2_CACHE        = 1,
    /** Turing+ DRAM */
    NVML_MEMORY_LOCATION_DRAM            = 2,
    /** GPU Device Memory */
    NVML_MEMORY_LOCATION_DEVICE_MEMORY   = 2,
    /** GPU Register File */
    NVML_MEMORY_LOCATION_REGISTER_FILE   = 3,
    /** GPU Texture Memory */
    NVML_MEMORY_LOCATION_TEXTURE_MEMORY  = 4,
    /** Shared memory */
    NVML_MEMORY_LOCATION_TEXTURE_SHM     = 5,
    /** CBU */
    NVML_MEMORY_LOCATION_CBU             = 6,
    /** Turing+ SRAM */
    NVML_MEMORY_LOCATION_SRAM            = 7,
    // Keep this last
    /** This counts the number of memory locations the driver knows about */
    NVML_MEMORY_LOCATION_COUNT = 8;

/**
 * Causes for page retirement
 */
/** enum nvmlPageRetirementCause_enum */
public static final int
    /** Page was retired due to multiple single bit ECC error */
    NVML_PAGE_RETIREMENT_CAUSE_MULTIPLE_SINGLE_BIT_ECC_ERRORS = 0,
    /** Page was retired due to double bit ECC error */
    NVML_PAGE_RETIREMENT_CAUSE_DOUBLE_BIT_ECC_ERROR = 1,

    // Keep this last
    NVML_PAGE_RETIREMENT_CAUSE_COUNT = 2;

/**
 * API types that allow changes to default permission restrictions
 */
/** enum nvmlRestrictedAPI_enum */
public static final int
    /** APIs that change application clocks, see nvmlDeviceSetApplicationsClocks 
 *  and see nvmlDeviceResetApplicationsClocks */
    NVML_RESTRICTED_API_SET_APPLICATION_CLOCKS = 0,
    /** APIs that enable/disable Auto Boosted clocks
 *  see nvmlDeviceSetAutoBoostedClocksEnabled */
    NVML_RESTRICTED_API_SET_AUTO_BOOSTED_CLOCKS = 1,
    // Keep this last
    NVML_RESTRICTED_API_COUNT = 2;

/** \} */

/***************************************************************************************************/
/** \defgroup nvmlGridEnums GRID Enums
 *  \{
 */
/***************************************************************************************************/

/**
 * GPU virtualization mode types.
 */
/** enum nvmlGpuVirtualizationMode */
public static final int
    /** Represents Bare Metal GPU */
    NVML_GPU_VIRTUALIZATION_MODE_NONE = 0,
    /** Device is associated with GPU-Passthorugh */
    NVML_GPU_VIRTUALIZATION_MODE_PASSTHROUGH = 1,
    /** Device is associated with vGPU inside virtual machine. */
    NVML_GPU_VIRTUALIZATION_MODE_VGPU = 2,
    /** Device is associated with VGX hypervisor in vGPU mode */
    NVML_GPU_VIRTUALIZATION_MODE_HOST_VGPU = 3,
    /** Device is associated with VGX hypervisor in vSGA mode */
    NVML_GPU_VIRTUALIZATION_MODE_HOST_VSGA = 4;

/** \} */

/***************************************************************************************************/
/** \defgroup nvmlFieldValueEnums Field Value Enums
 *  \{
 */
/***************************************************************************************************/

/**
 * Field Identifiers.
 *
 * All Identifiers pertain to a device. Each ID is only used once and is guaranteed never to change.
 */
/** Current ECC mode. 1=Active. 0=Inactive */
public static final int NVML_FI_DEV_ECC_CURRENT =           1;
/** Pending ECC mode. 1=Active. 0=Inactive */
public static final int NVML_FI_DEV_ECC_PENDING =           2;
/* ECC Count Totals */
/** Total single bit volatile ECC errors */
public static final int NVML_FI_DEV_ECC_SBE_VOL_TOTAL =     3;
/** Total double bit volatile ECC errors */
public static final int NVML_FI_DEV_ECC_DBE_VOL_TOTAL =     4;
/** Total single bit aggregate (persistent) ECC errors */
public static final int NVML_FI_DEV_ECC_SBE_AGG_TOTAL =     5;
/** Total double bit aggregate (persistent) ECC errors */
public static final int NVML_FI_DEV_ECC_DBE_AGG_TOTAL =     6;
/* Individual ECC locations */
/** L1 cache single bit volatile ECC errors */
public static final int NVML_FI_DEV_ECC_SBE_VOL_L1 =        7;
/** L1 cache double bit volatile ECC errors */
public static final int NVML_FI_DEV_ECC_DBE_VOL_L1 =        8;
/** L2 cache single bit volatile ECC errors */
public static final int NVML_FI_DEV_ECC_SBE_VOL_L2 =        9;
/** L2 cache double bit volatile ECC errors */
public static final int NVML_FI_DEV_ECC_DBE_VOL_L2 =        10;
/** Device memory single bit volatile ECC errors */
public static final int NVML_FI_DEV_ECC_SBE_VOL_DEV =       11;
/** Device memory double bit volatile ECC errors */
public static final int NVML_FI_DEV_ECC_DBE_VOL_DEV =       12;
/** Register file single bit volatile ECC errors */
public static final int NVML_FI_DEV_ECC_SBE_VOL_REG =       13;
/** Register file double bit volatile ECC errors */
public static final int NVML_FI_DEV_ECC_DBE_VOL_REG =       14;
/** Texture memory single bit volatile ECC errors */
public static final int NVML_FI_DEV_ECC_SBE_VOL_TEX =       15;
/** Texture memory double bit volatile ECC errors */
public static final int NVML_FI_DEV_ECC_DBE_VOL_TEX =       16;
/** CBU double bit volatile ECC errors */
public static final int NVML_FI_DEV_ECC_DBE_VOL_CBU =       17;
/** L1 cache single bit aggregate (persistent) ECC errors */
public static final int NVML_FI_DEV_ECC_SBE_AGG_L1 =        18;
/** L1 cache double bit aggregate (persistent) ECC errors */
public static final int NVML_FI_DEV_ECC_DBE_AGG_L1 =        19;
/** L2 cache single bit aggregate (persistent) ECC errors */
public static final int NVML_FI_DEV_ECC_SBE_AGG_L2 =        20;
/** L2 cache double bit aggregate (persistent) ECC errors */
public static final int NVML_FI_DEV_ECC_DBE_AGG_L2 =        21;
/** Device memory single bit aggregate (persistent) ECC errors */
public static final int NVML_FI_DEV_ECC_SBE_AGG_DEV =       22;
/** Device memory double bit aggregate (persistent) ECC errors */
public static final int NVML_FI_DEV_ECC_DBE_AGG_DEV =       23;
/** Register File single bit aggregate (persistent) ECC errors */
public static final int NVML_FI_DEV_ECC_SBE_AGG_REG =       24;
/** Register File double bit aggregate (persistent) ECC errors */
public static final int NVML_FI_DEV_ECC_DBE_AGG_REG =       25;
/** Texture memory single bit aggregate (persistent) ECC errors */
public static final int NVML_FI_DEV_ECC_SBE_AGG_TEX =       26;
/** Texture memory double bit aggregate (persistent) ECC errors */
public static final int NVML_FI_DEV_ECC_DBE_AGG_TEX =       27;
/** CBU double bit aggregate ECC errors */
public static final int NVML_FI_DEV_ECC_DBE_AGG_CBU =       28;

/* Page Retirement */
/** Number of retired pages because of single bit errors */
public static final int NVML_FI_DEV_RETIRED_SBE =           29;
/** Number of retired pages because of double bit errors */
public static final int NVML_FI_DEV_RETIRED_DBE =           30;
/** If any pages are pending retirement. 1=yes. 0=no. */
public static final int NVML_FI_DEV_RETIRED_PENDING =       31;

/* NvLink Flit Error Counters */
/** NVLink flow control CRC  Error Counter for Lane 0 */
public static final int NVML_FI_DEV_NVLINK_CRC_FLIT_ERROR_COUNT_L0 =    32;
/** NVLink flow control CRC  Error Counter for Lane 1 */
public static final int NVML_FI_DEV_NVLINK_CRC_FLIT_ERROR_COUNT_L1 =    33;
/** NVLink flow control CRC  Error Counter for Lane 2 */
public static final int NVML_FI_DEV_NVLINK_CRC_FLIT_ERROR_COUNT_L2 =    34;
/** NVLink flow control CRC  Error Counter for Lane 3 */
public static final int NVML_FI_DEV_NVLINK_CRC_FLIT_ERROR_COUNT_L3 =    35;
/** NVLink flow control CRC  Error Counter for Lane 4 */
public static final int NVML_FI_DEV_NVLINK_CRC_FLIT_ERROR_COUNT_L4 =    36;
/** NVLink flow control CRC  Error Counter for Lane 5 */
public static final int NVML_FI_DEV_NVLINK_CRC_FLIT_ERROR_COUNT_L5 =    37;
/** NVLink flow control CRC  Error Counter total for all Lanes */
public static final int NVML_FI_DEV_NVLINK_CRC_FLIT_ERROR_COUNT_TOTAL = 38;

/* NvLink CRC Data Error Counters */
/** NVLink data CRC Error Counter for Lane 0 */
public static final int NVML_FI_DEV_NVLINK_CRC_DATA_ERROR_COUNT_L0 =    39;
/** NVLink data CRC Error Counter for Lane 1 */
public static final int NVML_FI_DEV_NVLINK_CRC_DATA_ERROR_COUNT_L1 =    40;
/** NVLink data CRC Error Counter for Lane 2 */
public static final int NVML_FI_DEV_NVLINK_CRC_DATA_ERROR_COUNT_L2 =    41;
/** NVLink data CRC Error Counter for Lane 3 */
public static final int NVML_FI_DEV_NVLINK_CRC_DATA_ERROR_COUNT_L3 =    42;
/** NVLink data CRC Error Counter for Lane 4 */
public static final int NVML_FI_DEV_NVLINK_CRC_DATA_ERROR_COUNT_L4 =    43;
/** NVLink data CRC Error Counter for Lane 5 */
public static final int NVML_FI_DEV_NVLINK_CRC_DATA_ERROR_COUNT_L5 =    44;
/** NvLink data CRC Error Counter total for all Lanes */
public static final int NVML_FI_DEV_NVLINK_CRC_DATA_ERROR_COUNT_TOTAL = 45;

/* NvLink Replay Error Counters */
/** NVLink Replay Error Counter for Lane 0 */
public static final int NVML_FI_DEV_NVLINK_REPLAY_ERROR_COUNT_L0 =      46;
/** NVLink Replay Error Counter for Lane 1 */
public static final int NVML_FI_DEV_NVLINK_REPLAY_ERROR_COUNT_L1 =      47;
/** NVLink Replay Error Counter for Lane 2 */
public static final int NVML_FI_DEV_NVLINK_REPLAY_ERROR_COUNT_L2 =      48;
/** NVLink Replay Error Counter for Lane 3 */
public static final int NVML_FI_DEV_NVLINK_REPLAY_ERROR_COUNT_L3 =      49;
/** NVLink Replay Error Counter for Lane 4 */
public static final int NVML_FI_DEV_NVLINK_REPLAY_ERROR_COUNT_L4 =      50;
/** NVLink Replay Error Counter for Lane 5 */
public static final int NVML_FI_DEV_NVLINK_REPLAY_ERROR_COUNT_L5 =      51;
/** NVLink Replay Error Counter total for all Lanes */
public static final int NVML_FI_DEV_NVLINK_REPLAY_ERROR_COUNT_TOTAL =   52;

/* NvLink Recovery Error Counters */
/** NVLink Recovery Error Counter for Lane 0 */
public static final int NVML_FI_DEV_NVLINK_RECOVERY_ERROR_COUNT_L0 =    53;
/** NVLink Recovery Error Counter for Lane 1 */
public static final int NVML_FI_DEV_NVLINK_RECOVERY_ERROR_COUNT_L1 =    54;
/** NVLink Recovery Error Counter for Lane 2 */
public static final int NVML_FI_DEV_NVLINK_RECOVERY_ERROR_COUNT_L2 =    55;
/** NVLink Recovery Error Counter for Lane 3 */
public static final int NVML_FI_DEV_NVLINK_RECOVERY_ERROR_COUNT_L3 =    56;
/** NVLink Recovery Error Counter for Lane 4 */
public static final int NVML_FI_DEV_NVLINK_RECOVERY_ERROR_COUNT_L4 =    57;
/** NVLink Recovery Error Counter for Lane 5 */
public static final int NVML_FI_DEV_NVLINK_RECOVERY_ERROR_COUNT_L5 =    58;
/** NVLink Recovery Error Counter total for all Lanes */
public static final int NVML_FI_DEV_NVLINK_RECOVERY_ERROR_COUNT_TOTAL = 59;

/* NvLink Bandwidth Counters */
/** NVLink Bandwidth Counter for Counter Set 0, Lane 0 */
public static final int NVML_FI_DEV_NVLINK_BANDWIDTH_C0_L0 =     60;
/** NVLink Bandwidth Counter for Counter Set 0, Lane 1 */
public static final int NVML_FI_DEV_NVLINK_BANDWIDTH_C0_L1 =     61;
/** NVLink Bandwidth Counter for Counter Set 0, Lane 2 */
public static final int NVML_FI_DEV_NVLINK_BANDWIDTH_C0_L2 =     62;
/** NVLink Bandwidth Counter for Counter Set 0, Lane 3 */
public static final int NVML_FI_DEV_NVLINK_BANDWIDTH_C0_L3 =     63;
/** NVLink Bandwidth Counter for Counter Set 0, Lane 4 */
public static final int NVML_FI_DEV_NVLINK_BANDWIDTH_C0_L4 =     64;
/** NVLink Bandwidth Counter for Counter Set 0, Lane 5 */
public static final int NVML_FI_DEV_NVLINK_BANDWIDTH_C0_L5 =     65;
/** NVLink Bandwidth Counter Total for Counter Set 0, All Lanes */
public static final int NVML_FI_DEV_NVLINK_BANDWIDTH_C0_TOTAL =  66;

/* NvLink Bandwidth Counters */
/** NVLink Bandwidth Counter for Counter Set 1, Lane 0 */
public static final int NVML_FI_DEV_NVLINK_BANDWIDTH_C1_L0 =     67;
/** NVLink Bandwidth Counter for Counter Set 1, Lane 1 */
public static final int NVML_FI_DEV_NVLINK_BANDWIDTH_C1_L1 =     68;
/** NVLink Bandwidth Counter for Counter Set 1, Lane 2 */
public static final int NVML_FI_DEV_NVLINK_BANDWIDTH_C1_L2 =     69;
/** NVLink Bandwidth Counter for Counter Set 1, Lane 3 */
public static final int NVML_FI_DEV_NVLINK_BANDWIDTH_C1_L3 =     70;
/** NVLink Bandwidth Counter for Counter Set 1, Lane 4 */
public static final int NVML_FI_DEV_NVLINK_BANDWIDTH_C1_L4 =     71;
/** NVLink Bandwidth Counter for Counter Set 1, Lane 5 */
public static final int NVML_FI_DEV_NVLINK_BANDWIDTH_C1_L5 =     72;
/** NVLink Bandwidth Counter Total for Counter Set 1, All Lanes */
public static final int NVML_FI_DEV_NVLINK_BANDWIDTH_C1_TOTAL =  73;

/* NVML Perf Policy Counters */
/** Perf Policy Counter for Power Policy */
public static final int NVML_FI_DEV_PERF_POLICY_POWER =              74;
/** Perf Policy Counter for Thermal Policy */
public static final int NVML_FI_DEV_PERF_POLICY_THERMAL =            75;
/** Perf Policy Counter for Sync boost Policy */
public static final int NVML_FI_DEV_PERF_POLICY_SYNC_BOOST =         76;
/** Perf Policy Counter for Board Limit */
public static final int NVML_FI_DEV_PERF_POLICY_BOARD_LIMIT =        77;
/** Perf Policy Counter for Low GPU Utilization Policy */
public static final int NVML_FI_DEV_PERF_POLICY_LOW_UTILIZATION =    78;
/** Perf Policy Counter for Reliability Policy */
public static final int NVML_FI_DEV_PERF_POLICY_RELIABILITY =        79;
/** Perf Policy Counter for Total App Clock Policy */
public static final int NVML_FI_DEV_PERF_POLICY_TOTAL_APP_CLOCKS =   80;
/** Perf Policy Counter for Total Base Clocks Policy */
public static final int NVML_FI_DEV_PERF_POLICY_TOTAL_BASE_CLOCKS =  81;

/* Memory temperatures */
/** Memory temperature for the device */
public static final int NVML_FI_DEV_MEMORY_TEMP =  82;

/* Energy Counter */
/** Total energy consumption for the GPU in mJ since the driver was last reloaded */
public static final int NVML_FI_DEV_TOTAL_ENERGY_CONSUMPTION = 83;

/* NVLink Speed */
/** NVLink Speed in MBps for Link 0 */
public static final int NVML_FI_DEV_NVLINK_SPEED_MBPS_L0 =     84;
/** NVLink Speed in MBps for Link 1 */
public static final int NVML_FI_DEV_NVLINK_SPEED_MBPS_L1 =     85;
/** NVLink Speed in MBps for Link 2 */
public static final int NVML_FI_DEV_NVLINK_SPEED_MBPS_L2 =     86;
/** NVLink Speed in MBps for Link 3 */
public static final int NVML_FI_DEV_NVLINK_SPEED_MBPS_L3 =     87;
/** NVLink Speed in MBps for Link 4 */
public static final int NVML_FI_DEV_NVLINK_SPEED_MBPS_L4 =     88;
/** NVLink Speed in MBps for Link 5 */
public static final int NVML_FI_DEV_NVLINK_SPEED_MBPS_L5 =     89;
/** Common NVLink Speed in MBps for active links */
public static final int NVML_FI_DEV_NVLINK_SPEED_MBPS_COMMON = 90;

/** Number of NVLinks present on the device */
public static final int NVML_FI_DEV_NVLINK_LINK_COUNT =        91;

/** If any pages are pending retirement due to SBE. 1=yes. 0=no. */
public static final int NVML_FI_DEV_RETIRED_PENDING_SBE =      92;
/** If any pages are pending retirement due to DBE. 1=yes. 0=no. */
public static final int NVML_FI_DEV_RETIRED_PENDING_DBE =      93;

/** PCIe replay counter */
public static final int NVML_FI_DEV_PCIE_REPLAY_COUNTER =             94;
/** PCIe replay rollover counter */
public static final int NVML_FI_DEV_PCIE_REPLAY_ROLLOVER_COUNTER =    95;

/** One greater than the largest field ID defined above */
public static final int NVML_FI_MAX = 96;

/**
 * Information for a Field Value Sample
 */
public static class nvmlFieldValue_t extends Pointer {
    static { Loader.load(); }
    /** Default native constructor. */
    public nvmlFieldValue_t() { super((Pointer)null); allocate(); }
    /** Native array allocator. Access with {@link Pointer#position(long)}. */
    public nvmlFieldValue_t(long size) { super((Pointer)null); allocateArray(size); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public nvmlFieldValue_t(Pointer p) { super(p); }
    private native void allocate();
    private native void allocateArray(long size);
    @Override public nvmlFieldValue_t position(long position) {
        return (nvmlFieldValue_t)super.position(position);
    }

    /** ID of the NVML field to retrieve. This must be set before any call that uses this struct. See the constants starting with NVML_FI_ above. */
    public native @Cast("unsigned int") int fieldId(); public native nvmlFieldValue_t fieldId(int fieldId);
    /** Currently unused. This should be initialized to 0 by the caller before any API call */
    public native @Cast("unsigned int") int unused(); public native nvmlFieldValue_t unused(int unused);
    /** CPU Timestamp of this value in microseconds since 1970 */
    public native long timestamp(); public native nvmlFieldValue_t timestamp(long timestamp);
    /** How long this field value took to update (in usec) within NVML. This may be averaged across several fields that are serviced by the same driver call. */
    public native long latencyUsec(); public native nvmlFieldValue_t latencyUsec(long latencyUsec);
    /** Type of the value stored in value */
    public native @Cast("nvmlValueType_t") int valueType(); public native nvmlFieldValue_t valueType(int valueType);
    /** Return code for retrieving this value. This must be checked before looking at value, as value is undefined if nvmlReturn != NVML_SUCCESS */
    public native @Cast("nvmlReturn_t") int nvmlReturn(); public native nvmlFieldValue_t nvmlReturn(int nvmlReturn);
    /** Value for this field. This is only valid if nvmlReturn == NVML_SUCCESS */
    public native @ByRef nvmlValue_t value(); public native nvmlFieldValue_t value(nvmlValue_t value);
}


/** \} */

/***************************************************************************************************/
/** \defgroup nvmlUnitStructs Unit Structs
 *  \{
 */
/***************************************************************************************************/

@Opaque public static class nvmlUnit_st extends Pointer {
    /** Empty constructor. Calls {@code super((Pointer)null)}. */
    public nvmlUnit_st() { super((Pointer)null); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public nvmlUnit_st(Pointer p) { super(p); }
}

/** 
 * Description of HWBC entry 
 */
public static class nvmlHwbcEntry_t extends Pointer {
    static { Loader.load(); }
    /** Default native constructor. */
    public nvmlHwbcEntry_t() { super((Pointer)null); allocate(); }
    /** Native array allocator. Access with {@link Pointer#position(long)}. */
    public nvmlHwbcEntry_t(long size) { super((Pointer)null); allocateArray(size); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public nvmlHwbcEntry_t(Pointer p) { super(p); }
    private native void allocate();
    private native void allocateArray(long size);
    @Override public nvmlHwbcEntry_t position(long position) {
        return (nvmlHwbcEntry_t)super.position(position);
    }

    public native @Cast("unsigned int") int hwbcId(); public native nvmlHwbcEntry_t hwbcId(int hwbcId);
    public native @Cast("char") byte firmwareVersion(int i); public native nvmlHwbcEntry_t firmwareVersion(int i, byte firmwareVersion);
    @MemberGetter public native @Cast("char*") BytePointer firmwareVersion();
}

/** 
 * Fan state enum. 
 */
/** enum nvmlFanState_enum */
public static final int
    /** Fan is working properly */
    NVML_FAN_NORMAL       = 0,
    /** Fan has failed */
    NVML_FAN_FAILED       = 1;

/** 
 * Led color enum. 
 */
/** enum nvmlLedColor_enum */
public static final int
    /** GREEN, indicates good health */
    NVML_LED_COLOR_GREEN       = 0,
    /** AMBER, indicates problem */
    NVML_LED_COLOR_AMBER       = 1;


/** 
 * LED states for an S-class unit.
 */
public static class nvmlLedState_t extends Pointer {
    static { Loader.load(); }
    /** Default native constructor. */
    public nvmlLedState_t() { super((Pointer)null); allocate(); }
    /** Native array allocator. Access with {@link Pointer#position(long)}. */
    public nvmlLedState_t(long size) { super((Pointer)null); allocateArray(size); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public nvmlLedState_t(Pointer p) { super(p); }
    private native void allocate();
    private native void allocateArray(long size);
    @Override public nvmlLedState_t position(long position) {
        return (nvmlLedState_t)super.position(position);
    }

    /** If amber, a text description of the cause */
    public native @Cast("char") byte cause(int i); public native nvmlLedState_t cause(int i, byte cause);
    @MemberGetter public native @Cast("char*") BytePointer cause();
    /** GREEN or AMBER */
    public native @Cast("nvmlLedColor_t") int color(); public native nvmlLedState_t color(int color);
}

/** 
 * Static S-class unit info.
 */
public static class nvmlUnitInfo_t extends Pointer {
    static { Loader.load(); }
    /** Default native constructor. */
    public nvmlUnitInfo_t() { super((Pointer)null); allocate(); }
    /** Native array allocator. Access with {@link Pointer#position(long)}. */
    public nvmlUnitInfo_t(long size) { super((Pointer)null); allocateArray(size); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public nvmlUnitInfo_t(Pointer p) { super(p); }
    private native void allocate();
    private native void allocateArray(long size);
    @Override public nvmlUnitInfo_t position(long position) {
        return (nvmlUnitInfo_t)super.position(position);
    }

    /** Product name */
    public native @Cast("char") byte name(int i); public native nvmlUnitInfo_t name(int i, byte name);
    @MemberGetter public native @Cast("char*") BytePointer name();
    /** Product identifier */
    public native @Cast("char") byte id(int i); public native nvmlUnitInfo_t id(int i, byte id);
    @MemberGetter public native @Cast("char*") BytePointer id();
    /** Product serial number */
    public native @Cast("char") byte serial(int i); public native nvmlUnitInfo_t serial(int i, byte serial);
    @MemberGetter public native @Cast("char*") BytePointer serial();
    /** Firmware version */
    public native @Cast("char") byte firmwareVersion(int i); public native nvmlUnitInfo_t firmwareVersion(int i, byte firmwareVersion);
    @MemberGetter public native @Cast("char*") BytePointer firmwareVersion();
}

/** 
 * Power usage information for an S-class unit.
 * The power supply state is a human readable string that equals "Normal" or contains
 * a combination of "Abnormal" plus one or more of the following:
 *    
 *    - High voltage
 *    - Fan failure
 *    - Heatsink temperature
 *    - Current limit
 *    - Voltage below UV alarm threshold
 *    - Low-voltage
 *    - SI2C remote off command
 *    - MOD_DISABLE input
 *    - Short pin transition 
*/
public static class nvmlPSUInfo_t extends Pointer {
    static { Loader.load(); }
    /** Default native constructor. */
    public nvmlPSUInfo_t() { super((Pointer)null); allocate(); }
    /** Native array allocator. Access with {@link Pointer#position(long)}. */
    public nvmlPSUInfo_t(long size) { super((Pointer)null); allocateArray(size); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public nvmlPSUInfo_t(Pointer p) { super(p); }
    private native void allocate();
    private native void allocateArray(long size);
    @Override public nvmlPSUInfo_t position(long position) {
        return (nvmlPSUInfo_t)super.position(position);
    }

    /** The power supply state */
    public native @Cast("char") byte state(int i); public native nvmlPSUInfo_t state(int i, byte state);
    @MemberGetter public native @Cast("char*") BytePointer state();
    /** PSU current (A) */
    public native @Cast("unsigned int") int current(); public native nvmlPSUInfo_t current(int current);
    /** PSU voltage (V) */
    public native @Cast("unsigned int") int voltage(); public native nvmlPSUInfo_t voltage(int voltage);
    /** PSU power draw (W) */
    public native @Cast("unsigned int") int power(); public native nvmlPSUInfo_t power(int power);
}

/** 
 * Fan speed reading for a single fan in an S-class unit.
 */
public static class nvmlUnitFanInfo_t extends Pointer {
    static { Loader.load(); }
    /** Default native constructor. */
    public nvmlUnitFanInfo_t() { super((Pointer)null); allocate(); }
    /** Native array allocator. Access with {@link Pointer#position(long)}. */
    public nvmlUnitFanInfo_t(long size) { super((Pointer)null); allocateArray(size); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public nvmlUnitFanInfo_t(Pointer p) { super(p); }
    private native void allocate();
    private native void allocateArray(long size);
    @Override public nvmlUnitFanInfo_t position(long position) {
        return (nvmlUnitFanInfo_t)super.position(position);
    }

    /** Fan speed (RPM) */
    public native @Cast("unsigned int") int speed(); public native nvmlUnitFanInfo_t speed(int speed);
    /** Flag that indicates whether fan is working properly */
    public native @Cast("nvmlFanState_t") int state(); public native nvmlUnitFanInfo_t state(int state);
}

/** 
 * Fan speed readings for an entire S-class unit.
 */
public static class nvmlUnitFanSpeeds_t extends Pointer {
    static { Loader.load(); }
    /** Default native constructor. */
    public nvmlUnitFanSpeeds_t() { super((Pointer)null); allocate(); }
    /** Native array allocator. Access with {@link Pointer#position(long)}. */
    public nvmlUnitFanSpeeds_t(long size) { super((Pointer)null); allocateArray(size); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public nvmlUnitFanSpeeds_t(Pointer p) { super(p); }
    private native void allocate();
    private native void allocateArray(long size);
    @Override public nvmlUnitFanSpeeds_t position(long position) {
        return (nvmlUnitFanSpeeds_t)super.position(position);
    }

    /** Fan speed data for each fan */
    public native @ByRef nvmlUnitFanInfo_t fans(int i); public native nvmlUnitFanSpeeds_t fans(int i, nvmlUnitFanInfo_t fans);
    @MemberGetter public native nvmlUnitFanInfo_t fans();
    /** Number of fans in unit */
    public native @Cast("unsigned int") int count(); public native nvmlUnitFanSpeeds_t count(int count);
}

/** \} */

/***************************************************************************************************/
/** \addtogroup nvmlEvents 
 *  \{
 */
/***************************************************************************************************/

/** 
 * Handle to an event set
 */
@Opaque public static class nvmlEventSet_st extends Pointer {
    /** Empty constructor. Calls {@code super((Pointer)null)}. */
    public nvmlEventSet_st() { super((Pointer)null); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public nvmlEventSet_st(Pointer p) { super(p); }
}

/** \defgroup nvmlEventType Event Types
 * \{
 * Event Types which user can be notified about.
 * See description of particular functions for details.
 *
 * See \ref nvmlDeviceRegisterEvents and \ref nvmlDeviceGetSupportedEventTypes to check which devices 
 * support each event.
 *
 * Types can be combined with bitwise or operator '|' when passed to \ref nvmlDeviceRegisterEvents
 */
/** Event about single bit ECC errors
/**
 * \note A corrected texture memory error is not an ECC error, so it does not generate a single bit event
 */
public static final long nvmlEventTypeSingleBitEccError =     0x0000000000000001L;

/** Event about double bit ECC errors
/**
 * \note An uncorrected texture memory error is not an ECC error, so it does not generate a double bit event
 */
public static final long nvmlEventTypeDoubleBitEccError =     0x0000000000000002L;

/** Event about PState changes
/**
 *  \note On Fermi architecture PState changes are also an indicator that GPU is throttling down due to
 *  no work being executed on the GPU, power capping or thermal capping. In a typical situation,
 *  Fermi-based GPU should stay in P0 for the duration of the execution of the compute process.
 */
public static final long nvmlEventTypePState =                0x0000000000000004L;

/** Event that Xid critical error occurred */
public static final long nvmlEventTypeXidCriticalError =      0x0000000000000008L;

/** Event about clock changes
/**
 * Kepler only
 */
public static final long nvmlEventTypeClock =                 0x0000000000000010L;

/** Mask with no events */
public static final long nvmlEventTypeNone =                  0x0000000000000000L;
/** Mask of all events */
public static final long nvmlEventTypeAll = (nvmlEventTypeNone    
        | nvmlEventTypeSingleBitEccError       
        | nvmlEventTypeDoubleBitEccError       
        | nvmlEventTypePState                  
        | nvmlEventTypeClock                   
        | nvmlEventTypeXidCriticalError        
        );
/** \} */

/** 
 * Information about occurred event
 */
public static class nvmlEventData_t extends Pointer {
    static { Loader.load(); }
    /** Default native constructor. */
    public nvmlEventData_t() { super((Pointer)null); allocate(); }
    /** Native array allocator. Access with {@link Pointer#position(long)}. */
    public nvmlEventData_t(long size) { super((Pointer)null); allocateArray(size); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public nvmlEventData_t(Pointer p) { super(p); }
    private native void allocate();
    private native void allocateArray(long size);
    @Override public nvmlEventData_t position(long position) {
        return (nvmlEventData_t)super.position(position);
    }

    /** Specific device where the event occurred */
    public native nvmlDevice_st device(); public native nvmlEventData_t device(nvmlDevice_st device);
    /** Information about what specific event occurred */
    public native @Cast("unsigned long long") long eventType(); public native nvmlEventData_t eventType(long eventType);
    /** Stores last XID error for the device in the event of nvmlEventTypeXidCriticalError,  */
    public native @Cast("unsigned long long") long eventData(); public native nvmlEventData_t eventData(long eventData);
                                        //  eventData is 0 for any other event. eventData is set as 999 for unknown xid error.
}

/** \} */

/***************************************************************************************************/
/** \addtogroup nvmlClocksThrottleReasons
 *  \{
 */
/***************************************************************************************************/

/** Nothing is running on the GPU and the clocks are dropping to Idle state
 * \note This limiter may be removed in a later release
 */
public static final long nvmlClocksThrottleReasonGpuIdle =                   0x0000000000000001L;

/** GPU clocks are limited by current setting of applications clocks
 *
 * @see nvmlDeviceSetApplicationsClocks
 * @see nvmlDeviceGetApplicationsClock
 */
public static final long nvmlClocksThrottleReasonApplicationsClocksSetting = 0x0000000000000002L;

/** 
 * @deprecated Renamed to \ref nvmlClocksThrottleReasonApplicationsClocksSetting 
 *             as the name describes the situation more accurately.
 */
public static final long nvmlClocksThrottleReasonUserDefinedClocks =         nvmlClocksThrottleReasonApplicationsClocksSetting; 

/** SW Power Scaling algorithm is reducing the clocks below requested clocks 
 *
 * @see nvmlDeviceGetPowerUsage
 * @see nvmlDeviceSetPowerManagementLimit
 * @see nvmlDeviceGetPowerManagementLimit
 */
public static final long nvmlClocksThrottleReasonSwPowerCap =                0x0000000000000004L;

/** HW Slowdown (reducing the core clocks by a factor of 2 or more) is engaged
 * 
 * This is an indicator of:
 *   - temperature being too high
 *   - External Power Brake Assertion is triggered (e.g. by the system power supply)
 *   - Power draw is too high and Fast Trigger protection is reducing the clocks
 *   - May be also reported during PState or clock change
 *      - This behavior may be removed in a later release.
 *
 * @see nvmlDeviceGetTemperature
 * @see nvmlDeviceGetTemperatureThreshold
 * @see nvmlDeviceGetPowerUsage
 */
public static final long nvmlClocksThrottleReasonHwSlowdown =                0x0000000000000008L;

/** Sync Boost
 *
 * This GPU has been added to a Sync boost group with nvidia-smi or DCGM in
 * order to maximize performance per watt. All GPUs in the sync boost group
 * will boost to the minimum possible clocks across the entire group. Look at
 * the throttle reasons for other GPUs in the system to see why those GPUs are
 * holding this one at lower clocks.
 *
 */
public static final long nvmlClocksThrottleReasonSyncBoost =                 0x0000000000000010L;

/** SW Thermal Slowdown
 *
 * This is an indicator of one or more of the following:
 *  - Current GPU temperature above the GPU Max Operating Temperature
 *  - Current memory temperature above the Memory Max Operating Temperature
 *
 */
public static final long nvmlClocksThrottleReasonSwThermalSlowdown =         0x0000000000000020L;

/** HW Thermal Slowdown (reducing the core clocks by a factor of 2 or more) is engaged
 * 
 * This is an indicator of:
 *   - temperature being too high
 *
 * @see nvmlDeviceGetTemperature
 * @see nvmlDeviceGetTemperatureThreshold
 * @see nvmlDeviceGetPowerUsage
 */
public static final long nvmlClocksThrottleReasonHwThermalSlowdown =         0x0000000000000040L;

/** HW Power Brake Slowdown (reducing the core clocks by a factor of 2 or more) is engaged
 * 
 * This is an indicator of:
 *   - External Power Brake Assertion being triggered (e.g. by the system power supply)
 *
 * @see nvmlDeviceGetTemperature
 * @see nvmlDeviceGetTemperatureThreshold
 * @see nvmlDeviceGetPowerUsage
 */
public static final long nvmlClocksThrottleReasonHwPowerBrakeSlowdown =      0x0000000000000080L;

/** GPU clocks are limited by current setting of Display clocks
 *
 * @see bug 1997531
 */
public static final long nvmlClocksThrottleReasonDisplayClockSetting =       0x0000000000000100L;

/** Bit mask representing no clocks throttling
 *
 * Clocks are as high as possible.
 * */
public static final long nvmlClocksThrottleReasonNone =                      0x0000000000000000L;

/** Bit mask representing all supported clocks throttling reasons 
 * New reasons might be added to this list in the future
 */
public static final long nvmlClocksThrottleReasonAll = (nvmlClocksThrottleReasonNone 
      | nvmlClocksThrottleReasonGpuIdle                           
      | nvmlClocksThrottleReasonApplicationsClocksSetting         
      | nvmlClocksThrottleReasonSwPowerCap                        
      | nvmlClocksThrottleReasonHwSlowdown                        
      | nvmlClocksThrottleReasonSyncBoost                         
      | nvmlClocksThrottleReasonSwThermalSlowdown                 
      | nvmlClocksThrottleReasonHwThermalSlowdown                 
      | nvmlClocksThrottleReasonHwPowerBrakeSlowdown              
      | nvmlClocksThrottleReasonDisplayClockSetting               
);
/** \} */

/***************************************************************************************************/
/** \defgroup nvmlAccountingStats Accounting Statistics
 *  \{
 *
 *  Set of APIs designed to provide per process information about usage of GPU.
 *
 *  \note All accounting statistics and accounting mode live in nvidia driver and reset 
 *        to default (Disabled) when driver unloads.
 *        It is advised to run with persistence mode enabled.
 *
 *  \note Enabling accounting mode has no negative impact on the GPU performance.
 */
/***************************************************************************************************/

/**
 * Describes accounting statistics of a process.
 */
public static class nvmlAccountingStats_t extends Pointer {
    static { Loader.load(); }
    /** Default native constructor. */
    public nvmlAccountingStats_t() { super((Pointer)null); allocate(); }
    /** Native array allocator. Access with {@link Pointer#position(long)}. */
    public nvmlAccountingStats_t(long size) { super((Pointer)null); allocateArray(size); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public nvmlAccountingStats_t(Pointer p) { super(p); }
    private native void allocate();
    private native void allocateArray(long size);
    @Override public nvmlAccountingStats_t position(long position) {
        return (nvmlAccountingStats_t)super.position(position);
    }

    /** Percent of time over the process's lifetime during which one or more kernels was executing on the GPU. */
    public native @Cast("unsigned int") int gpuUtilization(); public native nvmlAccountingStats_t gpuUtilization(int gpuUtilization);
                                                /** Utilization stats just like returned by \ref nvmlDeviceGetUtilizationRates but for the life time of a
                                                 *  process (not just the last sample period).
                                                 *  Set to NVML_VALUE_NOT_AVAILABLE if nvmlDeviceGetUtilizationRates is not supported */
    
    /** Percent of time over the process's lifetime during which global (device) memory was being read or written. */
    public native @Cast("unsigned int") int memoryUtilization(); public native nvmlAccountingStats_t memoryUtilization(int memoryUtilization);
                                                /** Set to NVML_VALUE_NOT_AVAILABLE if nvmlDeviceGetUtilizationRates is not supported */
    
    /** Maximum total memory in bytes that was ever allocated by the process. */
    public native @Cast("unsigned long long") long maxMemoryUsage(); public native nvmlAccountingStats_t maxMemoryUsage(long maxMemoryUsage);
                                                /** Set to NVML_VALUE_NOT_AVAILABLE if nvmlProcessInfo_t->usedGpuMemory is not supported */
    

    /** Amount of time in ms during which the compute context was active. The time is reported as 0 if 
     *  the process is not terminated */
    public native @Cast("unsigned long long") long time(); public native nvmlAccountingStats_t time(long time);
    
    /** CPU Timestamp in usec representing start time for the process */
    public native @Cast("unsigned long long") long startTime(); public native nvmlAccountingStats_t startTime(long startTime);
    
    /** Flag to represent if the process is running (1 for running, 0 for terminated) */
    public native @Cast("unsigned int") int isRunning(); public native nvmlAccountingStats_t isRunning(int isRunning);

    /** Reserved for future use */
    public native @Cast("unsigned int") int reserved(int i); public native nvmlAccountingStats_t reserved(int i, int reserved);
    @MemberGetter public native @Cast("unsigned int*") IntPointer reserved();
}

/** \} */

/***************************************************************************************************/
/** \defgroup nvmlVgpuConstants Vgpu Constants
 *  \{
 */
/***************************************************************************************************/

/**
 * Buffer size guaranteed to be large enough for \ref nvmlVgpuTypeGetLicense
 */
public static final int NVML_GRID_LICENSE_BUFFER_SIZE =       128;

public static final int NVML_VGPU_NAME_BUFFER_SIZE =          64;

public static final int NVML_GRID_LICENSE_FEATURE_MAX_COUNT = 3;

/**
 * Macros for pGPU's virtualization capabilities bitfield.
 */
// #define NVML_VGPU_PGPU_VIRTUALIZATION_CAP_MIGRATION         0:0
public static final int NVML_VGPU_PGPU_VIRTUALIZATION_CAP_MIGRATION_NO =      0x0;
public static final int NVML_VGPU_PGPU_VIRTUALIZATION_CAP_MIGRATION_YES =     0x1;

/** \} */

/***************************************************************************************************/
/** \defgroup nvmlVgpuEnum Vgpu Enum
 *  \{
 */
/***************************************************************************************************/

/**
 * Types of VM identifiers
 */
/** enum nvmlVgpuVmIdType */
public static final int
    /** VM ID represents DOMAIN ID */
    NVML_VGPU_VM_ID_DOMAIN_ID = 0,
    /** VM ID represents UUID */
    NVML_VGPU_VM_ID_UUID = 1;

/**
 * vGPU GUEST info state.
 */
/** enum nvmlVgpuGuestInfoState_enum */
public static final int
    /** Guest-dependent fields uninitialized */
    NVML_VGPU_INSTANCE_GUEST_INFO_STATE_UNINITIALIZED = 0,
    /** Guest-dependent fields initialized */
    NVML_VGPU_INSTANCE_GUEST_INFO_STATE_INITIALIZED   = 1;

/**
 * GRID license feature code
 */
/** enum nvmlGridLicenseFeatureCode_t */
public static final int
    /** Virtual GPU */
    NVML_GRID_LICENSE_FEATURE_CODE_VGPU = 1,
    /** Virtual Workstation */
    NVML_GRID_LICENSE_FEATURE_CODE_VWORKSTATION = 2;

/** \} */

/***************************************************************************************************/
/** \defgroup nvmlVgpuStructs Vgpu Structs
 *  \{
 */
/***************************************************************************************************/

/**
 * Structure to store Utilization Value and vgpuInstance
 */
public static class nvmlVgpuInstanceUtilizationSample_t extends Pointer {
    static { Loader.load(); }
    /** Default native constructor. */
    public nvmlVgpuInstanceUtilizationSample_t() { super((Pointer)null); allocate(); }
    /** Native array allocator. Access with {@link Pointer#position(long)}. */
    public nvmlVgpuInstanceUtilizationSample_t(long size) { super((Pointer)null); allocateArray(size); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public nvmlVgpuInstanceUtilizationSample_t(Pointer p) { super(p); }
    private native void allocate();
    private native void allocateArray(long size);
    @Override public nvmlVgpuInstanceUtilizationSample_t position(long position) {
        return (nvmlVgpuInstanceUtilizationSample_t)super.position(position);
    }

    /** vGPU Instance */
    public native @Cast("nvmlVgpuInstance_t") int vgpuInstance(); public native nvmlVgpuInstanceUtilizationSample_t vgpuInstance(int vgpuInstance);
    /** CPU Timestamp in microseconds */
    public native @Cast("unsigned long long") long timeStamp(); public native nvmlVgpuInstanceUtilizationSample_t timeStamp(long timeStamp);
    /** SM (3D/Compute) Util Value */
    public native @ByRef nvmlValue_t smUtil(); public native nvmlVgpuInstanceUtilizationSample_t smUtil(nvmlValue_t smUtil);
    /** Frame Buffer Memory Util Value */
    public native @ByRef nvmlValue_t memUtil(); public native nvmlVgpuInstanceUtilizationSample_t memUtil(nvmlValue_t memUtil);
    /** Encoder Util Value */
    public native @ByRef nvmlValue_t encUtil(); public native nvmlVgpuInstanceUtilizationSample_t encUtil(nvmlValue_t encUtil);
    /** Decoder Util Value */
    public native @ByRef nvmlValue_t decUtil(); public native nvmlVgpuInstanceUtilizationSample_t decUtil(nvmlValue_t decUtil);
}

/**
 * Structure to store Utilization Value, vgpuInstance and subprocess information
 */
public static class nvmlVgpuProcessUtilizationSample_t extends Pointer {
    static { Loader.load(); }
    /** Default native constructor. */
    public nvmlVgpuProcessUtilizationSample_t() { super((Pointer)null); allocate(); }
    /** Native array allocator. Access with {@link Pointer#position(long)}. */
    public nvmlVgpuProcessUtilizationSample_t(long size) { super((Pointer)null); allocateArray(size); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public nvmlVgpuProcessUtilizationSample_t(Pointer p) { super(p); }
    private native void allocate();
    private native void allocateArray(long size);
    @Override public nvmlVgpuProcessUtilizationSample_t position(long position) {
        return (nvmlVgpuProcessUtilizationSample_t)super.position(position);
    }

    /** vGPU Instance */
    public native @Cast("nvmlVgpuInstance_t") int vgpuInstance(); public native nvmlVgpuProcessUtilizationSample_t vgpuInstance(int vgpuInstance);
    /** PID of process running within the vGPU VM */
    public native @Cast("unsigned int") int pid(); public native nvmlVgpuProcessUtilizationSample_t pid(int pid);
    /** Name of process running within the vGPU VM */
    public native @Cast("char") byte processName(int i); public native nvmlVgpuProcessUtilizationSample_t processName(int i, byte processName);
    @MemberGetter public native @Cast("char*") BytePointer processName();
    /** CPU Timestamp in microseconds */
    public native @Cast("unsigned long long") long timeStamp(); public native nvmlVgpuProcessUtilizationSample_t timeStamp(long timeStamp);
    /** SM (3D/Compute) Util Value */
    public native @Cast("unsigned int") int smUtil(); public native nvmlVgpuProcessUtilizationSample_t smUtil(int smUtil);
    /** Frame Buffer Memory Util Value */
    public native @Cast("unsigned int") int memUtil(); public native nvmlVgpuProcessUtilizationSample_t memUtil(int memUtil);
    /** Encoder Util Value */
    public native @Cast("unsigned int") int encUtil(); public native nvmlVgpuProcessUtilizationSample_t encUtil(int encUtil);
    /** Decoder Util Value */
    public native @Cast("unsigned int") int decUtil(); public native nvmlVgpuProcessUtilizationSample_t decUtil(int decUtil);
}

/**
 * Structure to store utilization value and process Id
 */
public static class nvmlProcessUtilizationSample_t extends Pointer {
    static { Loader.load(); }
    /** Default native constructor. */
    public nvmlProcessUtilizationSample_t() { super((Pointer)null); allocate(); }
    /** Native array allocator. Access with {@link Pointer#position(long)}. */
    public nvmlProcessUtilizationSample_t(long size) { super((Pointer)null); allocateArray(size); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public nvmlProcessUtilizationSample_t(Pointer p) { super(p); }
    private native void allocate();
    private native void allocateArray(long size);
    @Override public nvmlProcessUtilizationSample_t position(long position) {
        return (nvmlProcessUtilizationSample_t)super.position(position);
    }

    /** PID of process */
    public native @Cast("unsigned int") int pid(); public native nvmlProcessUtilizationSample_t pid(int pid);
    /** CPU Timestamp in microseconds */
    public native @Cast("unsigned long long") long timeStamp(); public native nvmlProcessUtilizationSample_t timeStamp(long timeStamp);
    /** SM (3D/Compute) Util Value */
    public native @Cast("unsigned int") int smUtil(); public native nvmlProcessUtilizationSample_t smUtil(int smUtil);
    /** Frame Buffer Memory Util Value */
    public native @Cast("unsigned int") int memUtil(); public native nvmlProcessUtilizationSample_t memUtil(int memUtil);
    /** Encoder Util Value */
    public native @Cast("unsigned int") int encUtil(); public native nvmlProcessUtilizationSample_t encUtil(int encUtil);
    /** Decoder Util Value */
    public native @Cast("unsigned int") int decUtil(); public native nvmlProcessUtilizationSample_t decUtil(int decUtil);
}

/**
 * Structure containing GRID licensable feature information
 */
public static class nvmlGridLicensableFeature_t extends Pointer {
    static { Loader.load(); }
    /** Default native constructor. */
    public nvmlGridLicensableFeature_t() { super((Pointer)null); allocate(); }
    /** Native array allocator. Access with {@link Pointer#position(long)}. */
    public nvmlGridLicensableFeature_t(long size) { super((Pointer)null); allocateArray(size); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public nvmlGridLicensableFeature_t(Pointer p) { super(p); }
    private native void allocate();
    private native void allocateArray(long size);
    @Override public nvmlGridLicensableFeature_t position(long position) {
        return (nvmlGridLicensableFeature_t)super.position(position);
    }

    /** Licensed feature code */
    public native @Cast("nvmlGridLicenseFeatureCode_t") int featureCode(); public native nvmlGridLicensableFeature_t featureCode(int featureCode);
    /** Non-zero if feature is currently licensed, otherwise zero */
    public native @Cast("unsigned int") int featureState(); public native nvmlGridLicensableFeature_t featureState(int featureState);
    public native @Cast("char") byte licenseInfo(int i); public native nvmlGridLicensableFeature_t licenseInfo(int i, byte licenseInfo);
    @MemberGetter public native @Cast("char*") BytePointer licenseInfo();
}

/**
 * Structure to store GRID licensable features
 */
public static class nvmlGridLicensableFeatures_t extends Pointer {
    static { Loader.load(); }
    /** Default native constructor. */
    public nvmlGridLicensableFeatures_t() { super((Pointer)null); allocate(); }
    /** Native array allocator. Access with {@link Pointer#position(long)}. */
    public nvmlGridLicensableFeatures_t(long size) { super((Pointer)null); allocateArray(size); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public nvmlGridLicensableFeatures_t(Pointer p) { super(p); }
    private native void allocate();
    private native void allocateArray(long size);
    @Override public nvmlGridLicensableFeatures_t position(long position) {
        return (nvmlGridLicensableFeatures_t)super.position(position);
    }

    /** Non-zero if GRID Software Licensing is supported on the system, otherwise zero */
    public native int isGridLicenseSupported(); public native nvmlGridLicensableFeatures_t isGridLicenseSupported(int isGridLicenseSupported);
    /** Entries returned in \a gridLicensableFeatures array */
    public native @Cast("unsigned int") int licensableFeaturesCount(); public native nvmlGridLicensableFeatures_t licensableFeaturesCount(int licensableFeaturesCount);
    /** Array of GRID licensable features. */
    public native @ByRef nvmlGridLicensableFeature_t gridLicensableFeatures(int i); public native nvmlGridLicensableFeatures_t gridLicensableFeatures(int i, nvmlGridLicensableFeature_t gridLicensableFeatures);
    @MemberGetter public native nvmlGridLicensableFeature_t gridLicensableFeatures();
}

/** \} */

/***************************************************************************************************/
/** \defgroup nvmlEncoderStructs Encoder Structs
 *  \{
 */
/***************************************************************************************************/

/**
 * Represents type of encoder for capacity can be queried
 */
/** enum nvmlEncoderQueryType_enum */
public static final int
    /** H264 encoder */
    NVML_ENCODER_QUERY_H264 = 0,
    /** HEVC encoder */
    NVML_ENCODER_QUERY_HEVC = 1;

/**
 * Structure to hold encoder session data
 */
public static class nvmlEncoderSessionInfo_t extends Pointer {
    static { Loader.load(); }
    /** Default native constructor. */
    public nvmlEncoderSessionInfo_t() { super((Pointer)null); allocate(); }
    /** Native array allocator. Access with {@link Pointer#position(long)}. */
    public nvmlEncoderSessionInfo_t(long size) { super((Pointer)null); allocateArray(size); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public nvmlEncoderSessionInfo_t(Pointer p) { super(p); }
    private native void allocate();
    private native void allocateArray(long size);
    @Override public nvmlEncoderSessionInfo_t position(long position) {
        return (nvmlEncoderSessionInfo_t)super.position(position);
    }

    /** Unique session ID */
    public native @Cast("unsigned int") int sessionId(); public native nvmlEncoderSessionInfo_t sessionId(int sessionId);
    /** Owning process ID */
    public native @Cast("unsigned int") int pid(); public native nvmlEncoderSessionInfo_t pid(int pid);
    /** Owning vGPU instance ID (only valid on vGPU hosts, otherwise zero) */
    public native @Cast("nvmlVgpuInstance_t") int vgpuInstance(); public native nvmlEncoderSessionInfo_t vgpuInstance(int vgpuInstance);
    /** Video encoder type */
    public native @Cast("nvmlEncoderType_t") int codecType(); public native nvmlEncoderSessionInfo_t codecType(int codecType);
    /** Current encode horizontal resolution */
    public native @Cast("unsigned int") int hResolution(); public native nvmlEncoderSessionInfo_t hResolution(int hResolution);
    /** Current encode vertical resolution */
    public native @Cast("unsigned int") int vResolution(); public native nvmlEncoderSessionInfo_t vResolution(int vResolution);
    /** Moving average encode frames per second */
    public native @Cast("unsigned int") int averageFps(); public native nvmlEncoderSessionInfo_t averageFps(int averageFps);
    /** Moving average encode latency in microseconds */
    public native @Cast("unsigned int") int averageLatency(); public native nvmlEncoderSessionInfo_t averageLatency(int averageLatency);
}

/** \} */

/***************************************************************************************************/
/** \defgroup nvmlFBCStructs Frame Buffer Capture Structures
*  \{
*/
/***************************************************************************************************/

/**
 * Represents frame buffer capture session type
 */
/** enum nvmlFBCSessionType_enum */
public static final int
    /** Unknwon */
    NVML_FBC_SESSION_TYPE_UNKNOWN = 0,
    /** ToSys */
    NVML_FBC_SESSION_TYPE_TOSYS = 1,
    /** Cuda */
    NVML_FBC_SESSION_TYPE_CUDA = 2,
    /** Vid */
    NVML_FBC_SESSION_TYPE_VID = 3,
    /** HEnc */
    NVML_FBC_SESSION_TYPE_HWENC = 4;

/**
 * Structure to hold frame buffer capture sessions stats
 */
public static class nvmlFBCStats_t extends Pointer {
    static { Loader.load(); }
    /** Default native constructor. */
    public nvmlFBCStats_t() { super((Pointer)null); allocate(); }
    /** Native array allocator. Access with {@link Pointer#position(long)}. */
    public nvmlFBCStats_t(long size) { super((Pointer)null); allocateArray(size); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public nvmlFBCStats_t(Pointer p) { super(p); }
    private native void allocate();
    private native void allocateArray(long size);
    @Override public nvmlFBCStats_t position(long position) {
        return (nvmlFBCStats_t)super.position(position);
    }

    /** Total no of sessions */
    public native @Cast("unsigned int") int sessionsCount(); public native nvmlFBCStats_t sessionsCount(int sessionsCount);
    /** Moving average new frames captured per second */
    public native @Cast("unsigned int") int averageFPS(); public native nvmlFBCStats_t averageFPS(int averageFPS);
    /** Moving average new frame capture latency in microseconds */
    public native @Cast("unsigned int") int averageLatency(); public native nvmlFBCStats_t averageLatency(int averageLatency);
}

/** Bit specifying differential map state. */
public static final int NVML_NVFBC_SESSION_FLAG_DIFFMAP_ENABLED =                0x00000001;
/** Bit specifying classification map state. */
public static final int NVML_NVFBC_SESSION_FLAG_CLASSIFICATIONMAP_ENABLED =      0x00000002;
/** Bit specifying if capture was requested as non-blocking call. */
public static final int NVML_NVFBC_SESSION_FLAG_CAPTURE_WITH_WAIT_NO_WAIT =      0x00000004;
/** Bit specifying if capture was requested as blocking call. */
public static final int NVML_NVFBC_SESSION_FLAG_CAPTURE_WITH_WAIT_INFINITE =     0x00000008;
/** Bit specifying if capture was requested as blocking call with timeout period. */
public static final int NVML_NVFBC_SESSION_FLAG_CAPTURE_WITH_WAIT_TIMEOUT =      0x00000010;

/**
 * Structure to hold FBC session data
 */
public static class nvmlFBCSessionInfo_t extends Pointer {
    static { Loader.load(); }
    /** Default native constructor. */
    public nvmlFBCSessionInfo_t() { super((Pointer)null); allocate(); }
    /** Native array allocator. Access with {@link Pointer#position(long)}. */
    public nvmlFBCSessionInfo_t(long size) { super((Pointer)null); allocateArray(size); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public nvmlFBCSessionInfo_t(Pointer p) { super(p); }
    private native void allocate();
    private native void allocateArray(long size);
    @Override public nvmlFBCSessionInfo_t position(long position) {
        return (nvmlFBCSessionInfo_t)super.position(position);
    }

    /** Unique session ID */
    public native @Cast("unsigned int") int sessionId(); public native nvmlFBCSessionInfo_t sessionId(int sessionId);
    /** Owning process ID */
    public native @Cast("unsigned int") int pid(); public native nvmlFBCSessionInfo_t pid(int pid);
    /** Owning vGPU instance ID (only valid on vGPU hosts, otherwise zero) */
    public native @Cast("nvmlVgpuInstance_t") int vgpuInstance(); public native nvmlFBCSessionInfo_t vgpuInstance(int vgpuInstance);
    /** Display identifier */
    public native @Cast("unsigned int") int displayOrdinal(); public native nvmlFBCSessionInfo_t displayOrdinal(int displayOrdinal);
    /** Type of frame buffer capture session */
    public native @Cast("nvmlFBCSessionType_t") int sessionType(); public native nvmlFBCSessionInfo_t sessionType(int sessionType);
    /** Session flags (one or more of NVML_NVFBC_SESSION_FLAG_XXX). */
    public native @Cast("unsigned int") int sessionFlags(); public native nvmlFBCSessionInfo_t sessionFlags(int sessionFlags);
    /** Max horizontal resolution supported by the capture session */
    public native @Cast("unsigned int") int hMaxResolution(); public native nvmlFBCSessionInfo_t hMaxResolution(int hMaxResolution);
    /** Max vertical resolution supported by the capture session */
    public native @Cast("unsigned int") int vMaxResolution(); public native nvmlFBCSessionInfo_t vMaxResolution(int vMaxResolution);
    /** Horizontal resolution requested by caller in capture call */
    public native @Cast("unsigned int") int hResolution(); public native nvmlFBCSessionInfo_t hResolution(int hResolution);
    /** Vertical resolution requested by caller in capture call */
    public native @Cast("unsigned int") int vResolution(); public native nvmlFBCSessionInfo_t vResolution(int vResolution);
    /** Moving average new frames captured per second */
    public native @Cast("unsigned int") int averageFPS(); public native nvmlFBCSessionInfo_t averageFPS(int averageFPS);
    /** Moving average new frame capture latency in microseconds */
    public native @Cast("unsigned int") int averageLatency(); public native nvmlFBCSessionInfo_t averageLatency(int averageLatency);
}

/** \} */

/***************************************************************************************************/
/** \defgroup nvmlDrainDefs definitions related to the drain state
 *  \{
 */
/***************************************************************************************************/

/**
 *  Is the GPU device to be removed from the kernel by nvmlDeviceRemoveGpu()
 */
/** enum nvmlDetachGpuState_enum */
public static final int
    NVML_DETACH_GPU_KEEP         = 0,
    NVML_DETACH_GPU_REMOVE = 1;

/**
 *  Parent bridge PCIe link state requested by nvmlDeviceRemoveGpu()
 */
/** enum nvmlPcieLinkState_enum */
public static final int
    NVML_PCIE_LINK_KEEP         = 0,
    NVML_PCIE_LINK_SHUT_DOWN = 1;

/** \} */

/***************************************************************************************************/
/** \defgroup nvmlInitializationAndCleanup Initialization and Cleanup
 * This chapter describes the methods that handle NVML initialization and cleanup.
 * It is the user's responsibility to call \ref nvmlInit() before calling any other methods, and 
 * nvmlShutdown() once NVML is no longer being used.
 *  \{
 */
/***************************************************************************************************/

/** Don't fail nvmlInit() when no GPUs are found */
public static final int NVML_INIT_FLAG_NO_GPUS =      1;
/** Don't attach GPUs */
public static final int NVML_INIT_FLAG_NO_ATTACH =    2;

/**
 * Initialize NVML, but don't initialize any GPUs yet.
 *
 * \note nvmlInit_v3 introduces a "flags" argument, that allows passing boolean values
 *       modifying the behaviour of nvmlInit().
 * \note In NVML 5.319 new nvmlInit_v2 has replaced nvmlInit"_v1" (default in NVML 4.304 and older) that
 *       did initialize all GPU devices in the system.
 *       
 * This allows NVML to communicate with a GPU
 * when other GPUs in the system are unstable or in a bad state.  When using this API, GPUs are
 * discovered and initialized in nvmlDeviceGetHandleBy* functions instead.
 * 
 * \note To contrast nvmlInit_v2 with nvmlInit"_v1", NVML 4.304 nvmlInit"_v1" will fail when any detected GPU is in
 *       a bad or unstable state.
 * 
 * For all products.
 *
 * This method, should be called once before invoking any other methods in the library.
 * A reference count of the number of initializations is maintained.  Shutdown only occurs
 * when the reference count reaches zero.
 * 
 * @return 
 *         - \ref NVML_SUCCESS                   if NVML has been properly initialized
 *         - \ref NVML_ERROR_DRIVER_NOT_LOADED   if NVIDIA driver is not running
 *         - \ref NVML_ERROR_NO_PERMISSION       if NVML does not have permission to talk to the driver
 *         - \ref NVML_ERROR_UNKNOWN             on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlInit_v2();

/**
 * nvmlInitWithFlags is a variant of nvmlInit(), that allows passing a set of boolean values
 *       modifying the behaviour of nvmlInit().
 *       Other than the "flags" parameter it is completely similar to \ref nvmlInit.
 *       
 * For all products.
 *
 * @param flags                                 behaviour modifier flags
 *
 * @return 
 *         - \ref NVML_SUCCESS                   if NVML has been properly initialized
 *         - \ref NVML_ERROR_DRIVER_NOT_LOADED   if NVIDIA driver is not running
 *         - \ref NVML_ERROR_NO_PERMISSION       if NVML does not have permission to talk to the driver
 *         - \ref NVML_ERROR_UNKNOWN             on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlInitWithFlags(@Cast("unsigned int") int flags);

/**
 * Shut down NVML by releasing all GPU resources previously allocated with \ref nvmlInit().
 * 
 * For all products.
 *
 * This method should be called after NVML work is done, once for each call to \ref nvmlInit()
 * A reference count of the number of initializations is maintained.  Shutdown only occurs
 * when the reference count reaches zero.  For backwards compatibility, no error is reported if
 * nvmlShutdown() is called more times than nvmlInit().
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if NVML has been properly shut down
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlShutdown();

/** \} */

/***************************************************************************************************/
/** \defgroup nvmlErrorReporting Error reporting
 * This chapter describes helper functions for error reporting routines.
 *  \{
 */
/***************************************************************************************************/

/**
 * Helper method for converting NVML error codes into readable strings.
 *
 * For all products.
 *
 * @param result                               NVML error code to convert
 *
 * @return String representation of the error.
 *
 */
public static native @Cast("const char*") BytePointer nvmlErrorString(@Cast("nvmlReturn_t") int result);
/** \} */


/***************************************************************************************************/
/** \defgroup nvmlConstants Constants
 *  \{
 */
/***************************************************************************************************/

/**
 * Buffer size guaranteed to be large enough for \ref nvmlDeviceGetInforomVersion and \ref nvmlDeviceGetInforomImageVersion
 */
public static final int NVML_DEVICE_INFOROM_VERSION_BUFFER_SIZE =       16;

/**
 * Buffer size guaranteed to be large enough for \ref nvmlDeviceGetUUID
 */
public static final int NVML_DEVICE_UUID_BUFFER_SIZE =                  80;

/**
 * Buffer size guaranteed to be large enough for \ref nvmlDeviceGetBoardPartNumber
 */
public static final int NVML_DEVICE_PART_NUMBER_BUFFER_SIZE =           80;

/**
 * Buffer size guaranteed to be large enough for \ref nvmlSystemGetDriverVersion
 */
public static final int NVML_SYSTEM_DRIVER_VERSION_BUFFER_SIZE =        80;

/**
 * Buffer size guaranteed to be large enough for \ref nvmlSystemGetNVMLVersion
 */
public static final int NVML_SYSTEM_NVML_VERSION_BUFFER_SIZE =          80;

/**
 * Buffer size guaranteed to be large enough for \ref nvmlDeviceGetName
 */
public static final int NVML_DEVICE_NAME_BUFFER_SIZE =                  64;

/**
 * Buffer size guaranteed to be large enough for \ref nvmlDeviceGetSerial
 */
public static final int NVML_DEVICE_SERIAL_BUFFER_SIZE =                30;

/**
 * Buffer size guaranteed to be large enough for \ref nvmlDeviceGetVbiosVersion
 */
public static final int NVML_DEVICE_VBIOS_VERSION_BUFFER_SIZE =         32;

/** \} */

/***************************************************************************************************/
/** \defgroup nvmlSystemQueries System Queries
 * This chapter describes the queries that NVML can perform against the local system. These queries
 * are not device-specific.
 *  \{
 */
/***************************************************************************************************/

/**
 * Retrieves the version of the system's graphics driver.
 * 
 * For all products.
 *
 * The version identifier is an alphanumeric string.  It will not exceed 80 characters in length
 * (including the NULL terminator).  See \ref nvmlConstants::NVML_SYSTEM_DRIVER_VERSION_BUFFER_SIZE.
 *
 * @param version                              Reference in which to return the version identifier
 * @param length                               The maximum allowed length of the string returned in \a version
 *
 * @return 
 *         - \ref NVML_SUCCESS                 if \a version has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a version is NULL
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small 
 */
public static native @Cast("nvmlReturn_t") int nvmlSystemGetDriverVersion(@Cast("char*") BytePointer version, @Cast("unsigned int") int length);
public static native @Cast("nvmlReturn_t") int nvmlSystemGetDriverVersion(@Cast("char*") ByteBuffer version, @Cast("unsigned int") int length);
public static native @Cast("nvmlReturn_t") int nvmlSystemGetDriverVersion(@Cast("char*") byte[] version, @Cast("unsigned int") int length);

/**
 * Retrieves the version of the NVML library.
 * 
 * For all products.
 *
 * The version identifier is an alphanumeric string.  It will not exceed 80 characters in length
 * (including the NULL terminator).  See \ref nvmlConstants::NVML_SYSTEM_NVML_VERSION_BUFFER_SIZE.
 *
 * @param version                              Reference in which to return the version identifier
 * @param length                               The maximum allowed length of the string returned in \a version
 *
 * @return 
 *         - \ref NVML_SUCCESS                 if \a version has been set
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a version is NULL
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small 
 */
public static native @Cast("nvmlReturn_t") int nvmlSystemGetNVMLVersion(@Cast("char*") BytePointer version, @Cast("unsigned int") int length);
public static native @Cast("nvmlReturn_t") int nvmlSystemGetNVMLVersion(@Cast("char*") ByteBuffer version, @Cast("unsigned int") int length);
public static native @Cast("nvmlReturn_t") int nvmlSystemGetNVMLVersion(@Cast("char*") byte[] version, @Cast("unsigned int") int length);

/**
 * Retrieves the version of the CUDA driver.
 *
 * For all products.
 *
 * The returned CUDA driver version is the same as the CUDA API
 * cuDriverGetVersion() would return on the system.
 *
 * @param cudaDriverVersion                    Reference in which to return the version identifier
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a cudaDriverVersion has been set
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a cudaDriverVersion is NULL
 */
public static native @Cast("nvmlReturn_t") int nvmlSystemGetCudaDriverVersion(IntPointer cudaDriverVersion);
public static native @Cast("nvmlReturn_t") int nvmlSystemGetCudaDriverVersion(IntBuffer cudaDriverVersion);
public static native @Cast("nvmlReturn_t") int nvmlSystemGetCudaDriverVersion(int[] cudaDriverVersion);

/**
 * Gets name of the process with provided process id
 *
 * For all products.
 *
 * Returned process name is cropped to provided length.
 * name string is encoded in ANSI.
 *
 * @param pid                                  The identifier of the process
 * @param name                                 Reference in which to return the process name
 * @param length                               The maximum allowed length of the string returned in \a name
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a name has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a name is NULL or \a length is 0.
 *         - \ref NVML_ERROR_NOT_FOUND         if process doesn't exists
 *         - \ref NVML_ERROR_NO_PERMISSION     if the user doesn't have permission to perform this operation
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlSystemGetProcessName(@Cast("unsigned int") int pid, @Cast("char*") BytePointer name, @Cast("unsigned int") int length);
public static native @Cast("nvmlReturn_t") int nvmlSystemGetProcessName(@Cast("unsigned int") int pid, @Cast("char*") ByteBuffer name, @Cast("unsigned int") int length);
public static native @Cast("nvmlReturn_t") int nvmlSystemGetProcessName(@Cast("unsigned int") int pid, @Cast("char*") byte[] name, @Cast("unsigned int") int length);

/** \} */

/***************************************************************************************************/
/** \defgroup nvmlUnitQueries Unit Queries
 * This chapter describes that queries that NVML can perform against each unit. For S-class systems only.
 * In each case the device is identified with an nvmlUnit_t handle. This handle is obtained by 
 * calling \ref nvmlUnitGetHandleByIndex().
 *  \{
 */
/***************************************************************************************************/

 /**
 * Retrieves the number of units in the system.
 *
 * For S-class products.
 *
 * @param unitCount                            Reference in which to return the number of units
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a unitCount has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a unitCount is NULL
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlUnitGetCount(@Cast("unsigned int*") IntPointer unitCount);
public static native @Cast("nvmlReturn_t") int nvmlUnitGetCount(@Cast("unsigned int*") IntBuffer unitCount);
public static native @Cast("nvmlReturn_t") int nvmlUnitGetCount(@Cast("unsigned int*") int[] unitCount);

/**
 * Acquire the handle for a particular unit, based on its index.
 *
 * For S-class products.
 *
 * Valid indices are derived from the \a unitCount returned by \ref nvmlUnitGetCount(). 
 *   For example, if \a unitCount is 2 the valid indices are 0 and 1, corresponding to UNIT 0 and UNIT 1.
 *
 * The order in which NVML enumerates units has no guarantees of consistency between reboots.
 *
 * @param index                                The index of the target unit, >= 0 and < \a unitCount
 * @param unit                                 Reference in which to return the unit handle
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a unit has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a index is invalid or \a unit is NULL
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlUnitGetHandleByIndex(@Cast("unsigned int") int index, @ByPtrPtr nvmlUnit_st unit);
public static native @Cast("nvmlReturn_t") int nvmlUnitGetHandleByIndex(@Cast("unsigned int") int index, @Cast("nvmlUnit_st**") PointerPointer unit);

/**
 * Retrieves the static information associated with a unit.
 *
 * For S-class products.
 *
 * See \ref nvmlUnitInfo_t for details on available unit info.
 *
 * @param unit                                 The identifier of the target unit
 * @param info                                 Reference in which to return the unit information
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a info has been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a unit is invalid or \a info is NULL
 */
public static native @Cast("nvmlReturn_t") int nvmlUnitGetUnitInfo(nvmlUnit_st unit, nvmlUnitInfo_t info);

/**
 * Retrieves the LED state associated with this unit.
 *
 * For S-class products.
 *
 * See \ref nvmlLedState_t for details on allowed states.
 *
 * @param unit                                 The identifier of the target unit
 * @param state                                Reference in which to return the current LED state
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a state has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a unit is invalid or \a state is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if this is not an S-class product
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 * 
 * @see nvmlUnitSetLedState()
 */
public static native @Cast("nvmlReturn_t") int nvmlUnitGetLedState(nvmlUnit_st unit, nvmlLedState_t state);

/**
 * Retrieves the PSU stats for the unit.
 *
 * For S-class products.
 *
 * See \ref nvmlPSUInfo_t for details on available PSU info.
 *
 * @param unit                                 The identifier of the target unit
 * @param psu                                  Reference in which to return the PSU information
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a psu has been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a unit is invalid or \a psu is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if this is not an S-class product
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlUnitGetPsuInfo(nvmlUnit_st unit, nvmlPSUInfo_t psu);

/**
 * Retrieves the temperature readings for the unit, in degrees C.
 *
 * For S-class products.
 *
 * Depending on the product, readings may be available for intake (type=0), 
 * exhaust (type=1) and board (type=2).
 *
 * @param unit                                 The identifier of the target unit
 * @param type                                 The type of reading to take
 * @param temp                                 Reference in which to return the intake temperature
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a temp has been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a unit or \a type is invalid or \a temp is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if this is not an S-class product
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlUnitGetTemperature(nvmlUnit_st unit, @Cast("unsigned int") int type, @Cast("unsigned int*") IntPointer temp);
public static native @Cast("nvmlReturn_t") int nvmlUnitGetTemperature(nvmlUnit_st unit, @Cast("unsigned int") int type, @Cast("unsigned int*") IntBuffer temp);
public static native @Cast("nvmlReturn_t") int nvmlUnitGetTemperature(nvmlUnit_st unit, @Cast("unsigned int") int type, @Cast("unsigned int*") int[] temp);

/**
 * Retrieves the fan speed readings for the unit.
 *
 * For S-class products.
 *
 * See \ref nvmlUnitFanSpeeds_t for details on available fan speed info.
 *
 * @param unit                                 The identifier of the target unit
 * @param fanSpeeds                            Reference in which to return the fan speed information
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a fanSpeeds has been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a unit is invalid or \a fanSpeeds is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if this is not an S-class product
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlUnitGetFanSpeedInfo(nvmlUnit_st unit, nvmlUnitFanSpeeds_t fanSpeeds);

/**
 * Retrieves the set of GPU devices that are attached to the specified unit.
 *
 * For S-class products.
 *
 * The \a deviceCount argument is expected to be set to the size of the input \a devices array.
 *
 * @param unit                                 The identifier of the target unit
 * @param deviceCount                          Reference in which to provide the \a devices array size, and
 *                                             to return the number of attached GPU devices
 * @param devices                              Reference in which to return the references to the attached GPU devices
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a deviceCount and \a devices have been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a deviceCount indicates that the \a devices array is too small
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a unit is invalid, either of \a deviceCount or \a devices is NULL
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlUnitGetDevices(nvmlUnit_st unit, @Cast("unsigned int*") IntPointer deviceCount, @ByPtrPtr nvmlDevice_st devices);
public static native @Cast("nvmlReturn_t") int nvmlUnitGetDevices(nvmlUnit_st unit, @Cast("unsigned int*") IntBuffer deviceCount, @Cast("nvmlDevice_st**") PointerPointer devices);
public static native @Cast("nvmlReturn_t") int nvmlUnitGetDevices(nvmlUnit_st unit, @Cast("unsigned int*") int[] deviceCount, @ByPtrPtr nvmlDevice_st devices);
public static native @Cast("nvmlReturn_t") int nvmlUnitGetDevices(nvmlUnit_st unit, @Cast("unsigned int*") IntPointer deviceCount, @Cast("nvmlDevice_st**") PointerPointer devices);
public static native @Cast("nvmlReturn_t") int nvmlUnitGetDevices(nvmlUnit_st unit, @Cast("unsigned int*") IntBuffer deviceCount, @ByPtrPtr nvmlDevice_st devices);
public static native @Cast("nvmlReturn_t") int nvmlUnitGetDevices(nvmlUnit_st unit, @Cast("unsigned int*") int[] deviceCount, @Cast("nvmlDevice_st**") PointerPointer devices);

/**
 * Retrieves the IDs and firmware versions for any Host Interface Cards (HICs) in the system.
 * 
 * For S-class products.
 *
 * The \a hwbcCount argument is expected to be set to the size of the input \a hwbcEntries array.
 * The HIC must be connected to an S-class system for it to be reported by this function.
 *
 * @param hwbcCount                            Size of hwbcEntries array
 * @param hwbcEntries                          Array holding information about hwbc
 *
 * @return 
 *         - \ref NVML_SUCCESS                 if \a hwbcCount and \a hwbcEntries have been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if either \a hwbcCount or \a hwbcEntries is NULL
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a hwbcCount indicates that the \a hwbcEntries array is too small
 */
public static native @Cast("nvmlReturn_t") int nvmlSystemGetHicVersion(@Cast("unsigned int*") IntPointer hwbcCount, nvmlHwbcEntry_t hwbcEntries);
public static native @Cast("nvmlReturn_t") int nvmlSystemGetHicVersion(@Cast("unsigned int*") IntBuffer hwbcCount, nvmlHwbcEntry_t hwbcEntries);
public static native @Cast("nvmlReturn_t") int nvmlSystemGetHicVersion(@Cast("unsigned int*") int[] hwbcCount, nvmlHwbcEntry_t hwbcEntries);
/** \} */

/***************************************************************************************************/
/** \defgroup nvmlDeviceQueries Device Queries
 * This chapter describes that queries that NVML can perform against each device.
 * In each case the device is identified with an nvmlDevice_t handle. This handle is obtained by  
 * calling one of \ref nvmlDeviceGetHandleByIndex(), \ref nvmlDeviceGetHandleBySerial(),
 * \ref nvmlDeviceGetHandleByPciBusId(). or \ref nvmlDeviceGetHandleByUUID(). 
 *  \{
 */
/***************************************************************************************************/

 /**
 * Retrieves the number of compute devices in the system. A compute device is a single GPU.
 * 
 * For all products.
 *
 * Note: New nvmlDeviceGetCount_v2 (default in NVML 5.319) returns count of all devices in the system
 *       even if nvmlDeviceGetHandleByIndex_v2 returns NVML_ERROR_NO_PERMISSION for such device.
 *       Update your code to handle this error, or use NVML 4.304 or older nvml header file.
 *       For backward binary compatibility reasons _v1 version of the API is still present in the shared
 *       library.
 *       Old _v1 version of nvmlDeviceGetCount doesn't count devices that NVML has no permission to talk to.
 *
 * @param deviceCount                          Reference in which to return the number of accessible devices
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a deviceCount has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a deviceCount is NULL
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetCount_v2(@Cast("unsigned int*") IntPointer deviceCount);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetCount_v2(@Cast("unsigned int*") IntBuffer deviceCount);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetCount_v2(@Cast("unsigned int*") int[] deviceCount);

/**
 * Acquire the handle for a particular device, based on its index.
 * 
 * For all products.
 *
 * Valid indices are derived from the \a accessibleDevices count returned by 
 *   \ref nvmlDeviceGetCount(). For example, if \a accessibleDevices is 2 the valid indices  
 *   are 0 and 1, corresponding to GPU 0 and GPU 1.
 *
 * The order in which NVML enumerates devices has no guarantees of consistency between reboots. For that reason it
 *   is recommended that devices be looked up by their PCI ids or UUID. See 
 *   \ref nvmlDeviceGetHandleByUUID() and \ref nvmlDeviceGetHandleByPciBusId().
 *
 * Note: The NVML index may not correlate with other APIs, such as the CUDA device index.
 *
 * Starting from NVML 5, this API causes NVML to initialize the target GPU
 * NVML may initialize additional GPUs if:
 *  - The target GPU is an SLI slave
 * 
 * Note: New nvmlDeviceGetCount_v2 (default in NVML 5.319) returns count of all devices in the system
 *       even if nvmlDeviceGetHandleByIndex_v2 returns NVML_ERROR_NO_PERMISSION for such device.
 *       Update your code to handle this error, or use NVML 4.304 or older nvml header file.
 *       For backward binary compatibility reasons _v1 version of the API is still present in the shared
 *       library.
 *       Old _v1 version of nvmlDeviceGetCount doesn't count devices that NVML has no permission to talk to.
 *
 *       This means that nvmlDeviceGetHandleByIndex_v2 and _v1 can return different devices for the same index.
 *       If you don't touch macros that map old (_v1) versions to _v2 versions at the top of the file you don't
 *       need to worry about that.
 *
 * @param index                                The index of the target GPU, >= 0 and < \a accessibleDevices
 * @param device                               Reference in which to return the device handle
 * 
 * @return 
 *         - \ref NVML_SUCCESS                  if \a device has been set
 *         - \ref NVML_ERROR_UNINITIALIZED      if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT   if \a index is invalid or \a device is NULL
 *         - \ref NVML_ERROR_INSUFFICIENT_POWER if any attached devices have improperly attached external power cables
 *         - \ref NVML_ERROR_NO_PERMISSION      if the user doesn't have permission to talk to this device
 *         - \ref NVML_ERROR_IRQ_ISSUE          if NVIDIA kernel detected an interrupt issue with the attached GPUs
 *         - \ref NVML_ERROR_GPU_IS_LOST        if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN            on any unexpected error
 *
 * @see nvmlDeviceGetIndex
 * @see nvmlDeviceGetCount
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetHandleByIndex_v2(@Cast("unsigned int") int index, @ByPtrPtr nvmlDevice_st device);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetHandleByIndex_v2(@Cast("unsigned int") int index, @Cast("nvmlDevice_st**") PointerPointer device);

/**
 * Acquire the handle for a particular device, based on its board serial number.
 *
 * For Fermi &tm; or newer fully supported devices.
 *
 * This number corresponds to the value printed directly on the board, and to the value returned by
 *   \ref nvmlDeviceGetSerial().
 *
 * @deprecated Since more than one GPU can exist on a single board this function is deprecated in favor 
 *             of \ref nvmlDeviceGetHandleByUUID.
 *             For dual GPU boards this function will return NVML_ERROR_INVALID_ARGUMENT.
 *
 * Starting from NVML 5, this API causes NVML to initialize the target GPU
 * NVML may initialize additional GPUs as it searches for the target GPU
 *
 * @param serial                               The board serial number of the target GPU
 * @param device                               Reference in which to return the device handle
 * 
 * @return 
 *         - \ref NVML_SUCCESS                  if \a device has been set
 *         - \ref NVML_ERROR_UNINITIALIZED      if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT   if \a serial is invalid, \a device is NULL or more than one
 *                                              device has the same serial (dual GPU boards)
 *         - \ref NVML_ERROR_NOT_FOUND          if \a serial does not match a valid device on the system
 *         - \ref NVML_ERROR_INSUFFICIENT_POWER if any attached devices have improperly attached external power cables
 *         - \ref NVML_ERROR_IRQ_ISSUE          if NVIDIA kernel detected an interrupt issue with the attached GPUs
 *         - \ref NVML_ERROR_GPU_IS_LOST        if any GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN            on any unexpected error
 *
 * @see nvmlDeviceGetSerial
 * @see nvmlDeviceGetHandleByUUID
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetHandleBySerial(@Cast("const char*") BytePointer serial, @ByPtrPtr nvmlDevice_st device);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetHandleBySerial(String serial, @Cast("nvmlDevice_st**") PointerPointer device);

/**
 * Acquire the handle for a particular device, based on its globally unique immutable UUID associated with each device.
 *
 * For all products.
 *
 * @param uuid                                 The UUID of the target GPU
 * @param device                               Reference in which to return the device handle
 * 
 * Starting from NVML 5, this API causes NVML to initialize the target GPU
 * NVML may initialize additional GPUs as it searches for the target GPU
 *
 * @return 
 *         - \ref NVML_SUCCESS                  if \a device has been set
 *         - \ref NVML_ERROR_UNINITIALIZED      if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT   if \a uuid is invalid or \a device is null
 *         - \ref NVML_ERROR_NOT_FOUND          if \a uuid does not match a valid device on the system
 *         - \ref NVML_ERROR_INSUFFICIENT_POWER if any attached devices have improperly attached external power cables
 *         - \ref NVML_ERROR_IRQ_ISSUE          if NVIDIA kernel detected an interrupt issue with the attached GPUs
 *         - \ref NVML_ERROR_GPU_IS_LOST        if any GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN            on any unexpected error
 *
 * @see nvmlDeviceGetUUID
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetHandleByUUID(@Cast("const char*") BytePointer uuid, @ByPtrPtr nvmlDevice_st device);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetHandleByUUID(String uuid, @Cast("nvmlDevice_st**") PointerPointer device);

/**
 * Acquire the handle for a particular device, based on its PCI bus id.
 * 
 * For all products.
 *
 * This value corresponds to the nvmlPciInfo_t::busId returned by \ref nvmlDeviceGetPciInfo().
 *
 * Starting from NVML 5, this API causes NVML to initialize the target GPU
 * NVML may initialize additional GPUs if:
 *  - The target GPU is an SLI slave
 *
 * \note NVML 4.304 and older version of nvmlDeviceGetHandleByPciBusId"_v1" returns NVML_ERROR_NOT_FOUND 
 *       instead of NVML_ERROR_NO_PERMISSION.
 *
 * @param pciBusId                             The PCI bus id of the target GPU
 * @param device                               Reference in which to return the device handle
 * 
 * @return 
 *         - \ref NVML_SUCCESS                  if \a device has been set
 *         - \ref NVML_ERROR_UNINITIALIZED      if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT   if \a pciBusId is invalid or \a device is NULL
 *         - \ref NVML_ERROR_NOT_FOUND          if \a pciBusId does not match a valid device on the system
 *         - \ref NVML_ERROR_INSUFFICIENT_POWER if the attached device has improperly attached external power cables
 *         - \ref NVML_ERROR_NO_PERMISSION      if the user doesn't have permission to talk to this device
 *         - \ref NVML_ERROR_IRQ_ISSUE          if NVIDIA kernel detected an interrupt issue with the attached GPUs
 *         - \ref NVML_ERROR_GPU_IS_LOST        if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN            on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetHandleByPciBusId_v2(@Cast("const char*") BytePointer pciBusId, @ByPtrPtr nvmlDevice_st device);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetHandleByPciBusId_v2(String pciBusId, @Cast("nvmlDevice_st**") PointerPointer device);

/**
 * Retrieves the name of this device. 
 * 
 * For all products.
 *
 * The name is an alphanumeric string that denotes a particular product, e.g. Tesla &tm; C2070. It will not
 * exceed 64 characters in length (including the NULL terminator).  See \ref
 * nvmlConstants::NVML_DEVICE_NAME_BUFFER_SIZE.
 *
 * @param device                               The identifier of the target device
 * @param name                                 Reference in which to return the product name
 * @param length                               The maximum allowed length of the string returned in \a name
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a name has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, or \a name is NULL
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetName(nvmlDevice_st device, @Cast("char*") BytePointer name, @Cast("unsigned int") int length);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetName(nvmlDevice_st device, @Cast("char*") ByteBuffer name, @Cast("unsigned int") int length);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetName(nvmlDevice_st device, @Cast("char*") byte[] name, @Cast("unsigned int") int length);

/**
 * Retrieves the brand of this device.
 *
 * For all products.
 *
 * The type is a member of \ref nvmlBrandType_t defined above.
 *
 * @param device                               The identifier of the target device
 * @param type                                 Reference in which to return the product brand type
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a name has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, or \a type is NULL
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetBrand(nvmlDevice_st device, @Cast("nvmlBrandType_t*") IntPointer type);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetBrand(nvmlDevice_st device, @Cast("nvmlBrandType_t*") IntBuffer type);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetBrand(nvmlDevice_st device, @Cast("nvmlBrandType_t*") int[] type);

/**
 * Retrieves the NVML index of this device.
 *
 * For all products.
 * 
 * Valid indices are derived from the \a accessibleDevices count returned by 
 *   \ref nvmlDeviceGetCount(). For example, if \a accessibleDevices is 2 the valid indices  
 *   are 0 and 1, corresponding to GPU 0 and GPU 1.
 *
 * The order in which NVML enumerates devices has no guarantees of consistency between reboots. For that reason it
 *   is recommended that devices be looked up by their PCI ids or GPU UUID. See 
 *   \ref nvmlDeviceGetHandleByPciBusId() and \ref nvmlDeviceGetHandleByUUID().
 *
 * Note: The NVML index may not correlate with other APIs, such as the CUDA device index.
 *
 * @param device                               The identifier of the target device
 * @param index                                Reference in which to return the NVML index of the device
 *
 * @return 
 *         - \ref NVML_SUCCESS                 if \a index has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, or \a index is NULL
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlDeviceGetHandleByIndex()
 * @see nvmlDeviceGetCount()
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetIndex(nvmlDevice_st device, @Cast("unsigned int*") IntPointer index);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetIndex(nvmlDevice_st device, @Cast("unsigned int*") IntBuffer index);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetIndex(nvmlDevice_st device, @Cast("unsigned int*") int[] index);

/**
 * Retrieves the globally unique board serial number associated with this device's board.
 *
 * For all products with an inforom.
 *
 * The serial number is an alphanumeric string that will not exceed 30 characters (including the NULL terminator).
 * This number matches the serial number tag that is physically attached to the board.  See \ref
 * nvmlConstants::NVML_DEVICE_SERIAL_BUFFER_SIZE.
 *
 * @param device                               The identifier of the target device
 * @param serial                               Reference in which to return the board/module serial number
 * @param length                               The maximum allowed length of the string returned in \a serial
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a serial has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, or \a serial is NULL
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetSerial(nvmlDevice_st device, @Cast("char*") BytePointer serial, @Cast("unsigned int") int length);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetSerial(nvmlDevice_st device, @Cast("char*") ByteBuffer serial, @Cast("unsigned int") int length);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetSerial(nvmlDevice_st device, @Cast("char*") byte[] serial, @Cast("unsigned int") int length);

/**
 * Retrieves an array of unsigned ints (sized to cpuSetSize) of bitmasks with the ideal CPU affinity for the device
 * For example, if processors 0, 1, 32, and 33 are ideal for the device and cpuSetSize == 2,
 *     result[0] = 0x3, result[1] = 0x3
 *
 * For Kepler &tm; or newer fully supported devices.
 * Supported on Linux only.
 *
 * @param device                               The identifier of the target device
 * @param cpuSetSize                           The size of the cpuSet array that is safe to access
 * @param cpuSet                               Array reference in which to return a bitmask of CPUs, 64 CPUs per 
 *                                                 unsigned long on 64-bit machines, 32 on 32-bit machines
 *
 * @return 
 *         - \ref NVML_SUCCESS                 if \a cpuAffinity has been filled
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, cpuSetSize == 0, or cpuSet is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetCpuAffinity(nvmlDevice_st device, @Cast("unsigned int") int cpuSetSize, @Cast("unsigned long*") CLongPointer cpuSet);

/**
 * Sets the ideal affinity for the calling thread and device using the guidelines 
 * given in nvmlDeviceGetCpuAffinity().  Note, this is a change as of version 8.0.  
 * Older versions set the affinity for a calling process and all children.
 * Currently supports up to 64 processors.
 *
 * For Kepler &tm; or newer fully supported devices.
 * Supported on Linux only.
 *
 * @param device                               The identifier of the target device
 *
 * @return 
 *         - \ref NVML_SUCCESS                 if the calling process has been successfully bound
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceSetCpuAffinity(nvmlDevice_st device);

/**
 * Clear all affinity bindings for the calling thread.  Note, this is a change as of version
 * 8.0 as older versions cleared the affinity for a calling process and all children.
 *
 * For Kepler &tm; or newer fully supported devices.
 * Supported on Linux only.
 *
 * @param device                               The identifier of the target device
 *
 * @return 
 *         - \ref NVML_SUCCESS                 if the calling process has been successfully unbound
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceClearCpuAffinity(nvmlDevice_st device);

/**
 * Retrieve the common ancestor for two devices
 * For all products.
 * Supported on Linux only.
 *
 * @param device1                              The identifier of the first device
 * @param device2                              The identifier of the second device
 * @param pathInfo                             A \ref nvmlGpuTopologyLevel_t that gives the path type
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a pathInfo has been set
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device1, or \a device2 is invalid, or \a pathInfo is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device or OS does not support this feature
 *         - \ref NVML_ERROR_UNKNOWN           an error has occurred in underlying topology discovery
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetTopologyCommonAncestor(nvmlDevice_st device1, nvmlDevice_st device2, @Cast("nvmlGpuTopologyLevel_t*") IntPointer pathInfo);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetTopologyCommonAncestor(nvmlDevice_st device1, nvmlDevice_st device2, @Cast("nvmlGpuTopologyLevel_t*") IntBuffer pathInfo);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetTopologyCommonAncestor(nvmlDevice_st device1, nvmlDevice_st device2, @Cast("nvmlGpuTopologyLevel_t*") int[] pathInfo);

/**
 * Retrieve the set of GPUs that are nearest to a given device at a specific interconnectivity level
 * For all products.
 * Supported on Linux only.
 *
 * @param device                               The identifier of the first device
 * @param level                                The \ref nvmlGpuTopologyLevel_t level to search for other GPUs
 * @param count                                When zero, is set to the number of matching GPUs such that \a deviceArray 
 *                                             can be malloc'd.  When non-zero, \a deviceArray will be filled with \a count
 *                                             number of device handles.
 * @param deviceArray                          An array of device handles for GPUs found at \a level
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a deviceArray or \a count (if initially zero) has been set
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device, \a level, or \a count is invalid, or \a deviceArray is NULL with a non-zero \a count
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device or OS does not support this feature
 *         - \ref NVML_ERROR_UNKNOWN           an error has occurred in underlying topology discovery
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetTopologyNearestGpus(nvmlDevice_st device, @Cast("nvmlGpuTopologyLevel_t") int level, @Cast("unsigned int*") IntPointer count, @ByPtrPtr nvmlDevice_st deviceArray);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetTopologyNearestGpus(nvmlDevice_st device, @Cast("nvmlGpuTopologyLevel_t") int level, @Cast("unsigned int*") IntBuffer count, @Cast("nvmlDevice_st**") PointerPointer deviceArray);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetTopologyNearestGpus(nvmlDevice_st device, @Cast("nvmlGpuTopologyLevel_t") int level, @Cast("unsigned int*") int[] count, @ByPtrPtr nvmlDevice_st deviceArray);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetTopologyNearestGpus(nvmlDevice_st device, @Cast("nvmlGpuTopologyLevel_t") int level, @Cast("unsigned int*") IntPointer count, @Cast("nvmlDevice_st**") PointerPointer deviceArray);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetTopologyNearestGpus(nvmlDevice_st device, @Cast("nvmlGpuTopologyLevel_t") int level, @Cast("unsigned int*") IntBuffer count, @ByPtrPtr nvmlDevice_st deviceArray);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetTopologyNearestGpus(nvmlDevice_st device, @Cast("nvmlGpuTopologyLevel_t") int level, @Cast("unsigned int*") int[] count, @Cast("nvmlDevice_st**") PointerPointer deviceArray);

/**
 * Retrieve the set of GPUs that have a CPU affinity with the given CPU number
 * For all products.
 * Supported on Linux only.
 *
 * @param cpuNumber                            The CPU number
 * @param count                                When zero, is set to the number of matching GPUs such that \a deviceArray 
 *                                             can be malloc'd.  When non-zero, \a deviceArray will be filled with \a count
 *                                             number of device handles.
 * @param deviceArray                          An array of device handles for GPUs found with affinity to \a cpuNumber
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a deviceArray or \a count (if initially zero) has been set
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a cpuNumber, or \a count is invalid, or \a deviceArray is NULL with a non-zero \a count
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device or OS does not support this feature
 *         - \ref NVML_ERROR_UNKNOWN           an error has occurred in underlying topology discovery
 */
public static native @Cast("nvmlReturn_t") int nvmlSystemGetTopologyGpuSet(@Cast("unsigned int") int cpuNumber, @Cast("unsigned int*") IntPointer count, @ByPtrPtr nvmlDevice_st deviceArray);
public static native @Cast("nvmlReturn_t") int nvmlSystemGetTopologyGpuSet(@Cast("unsigned int") int cpuNumber, @Cast("unsigned int*") IntBuffer count, @Cast("nvmlDevice_st**") PointerPointer deviceArray);
public static native @Cast("nvmlReturn_t") int nvmlSystemGetTopologyGpuSet(@Cast("unsigned int") int cpuNumber, @Cast("unsigned int*") int[] count, @ByPtrPtr nvmlDevice_st deviceArray);
public static native @Cast("nvmlReturn_t") int nvmlSystemGetTopologyGpuSet(@Cast("unsigned int") int cpuNumber, @Cast("unsigned int*") IntPointer count, @Cast("nvmlDevice_st**") PointerPointer deviceArray);
public static native @Cast("nvmlReturn_t") int nvmlSystemGetTopologyGpuSet(@Cast("unsigned int") int cpuNumber, @Cast("unsigned int*") IntBuffer count, @ByPtrPtr nvmlDevice_st deviceArray);
public static native @Cast("nvmlReturn_t") int nvmlSystemGetTopologyGpuSet(@Cast("unsigned int") int cpuNumber, @Cast("unsigned int*") int[] count, @Cast("nvmlDevice_st**") PointerPointer deviceArray);

/**
 * Retrieve the status for a given p2p capability index between a given pair of GPU 
 * 
 * @param device1                              The first device 
 * @param device2                              The second device
 * @param p2pIndex                             p2p Capability Index being looked for between \a device1 and \a device2
 * @param p2pStatus                            Reference in which to return the status of the \a p2pIndex 
 *                                             between \a device1 and \a device2
 * @return 
 *         - \ref NVML_SUCCESS         if \a p2pStatus has been populated
 *         - \ref NVML_ERROR_INVALID_ARGUMENT     if \a device1 or \a device2 or \a p2pIndex is invalid or \a p2pStatus is NULL
 *         - \ref NVML_ERROR_UNKNOWN              on any unexpected error
 */ 
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetP2PStatus(nvmlDevice_st device1, nvmlDevice_st device2, @Cast("nvmlGpuP2PCapsIndex_t") int p2pIndex,@Cast("nvmlGpuP2PStatus_t*") IntPointer p2pStatus);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetP2PStatus(nvmlDevice_st device1, nvmlDevice_st device2, @Cast("nvmlGpuP2PCapsIndex_t") int p2pIndex,@Cast("nvmlGpuP2PStatus_t*") IntBuffer p2pStatus);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetP2PStatus(nvmlDevice_st device1, nvmlDevice_st device2, @Cast("nvmlGpuP2PCapsIndex_t") int p2pIndex,@Cast("nvmlGpuP2PStatus_t*") int[] p2pStatus);

/**
 * Retrieves the globally unique immutable UUID associated with this device, as a 5 part hexadecimal string,
 * that augments the immutable, board serial identifier.
 *
 * For all products.
 *
 * The UUID is a globally unique identifier. It is the only available identifier for pre-Fermi-architecture products.
 * It does NOT correspond to any identifier printed on the board.  It will not exceed 80 characters in length
 * (including the NULL terminator).  See \ref nvmlConstants::NVML_DEVICE_UUID_BUFFER_SIZE.
 *
 * @param device                               The identifier of the target device
 * @param uuid                                 Reference in which to return the GPU UUID
 * @param length                               The maximum allowed length of the string returned in \a uuid
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a uuid has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, or \a uuid is NULL
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small 
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetUUID(nvmlDevice_st device, @Cast("char*") BytePointer uuid, @Cast("unsigned int") int length);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetUUID(nvmlDevice_st device, @Cast("char*") ByteBuffer uuid, @Cast("unsigned int") int length);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetUUID(nvmlDevice_st device, @Cast("char*") byte[] uuid, @Cast("unsigned int") int length);

/**
 * Retrieves minor number for the device. The minor number for the device is such that the Nvidia device node file for 
 * each GPU will have the form /dev/nvidia[minor number].
 *
 * For all products.
 * Supported only for Linux
 *
 * @param device                                The identifier of the target device
 * @param minorNumber                           Reference in which to return the minor number for the device
 * @return
 *         - \ref NVML_SUCCESS                 if the minor number is successfully retrieved
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a minorNumber is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if this query is not supported by the device
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetMinorNumber(nvmlDevice_st device, @Cast("unsigned int*") IntPointer minorNumber);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetMinorNumber(nvmlDevice_st device, @Cast("unsigned int*") IntBuffer minorNumber);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetMinorNumber(nvmlDevice_st device, @Cast("unsigned int*") int[] minorNumber);

/**
 * Retrieves the the device board part number which is programmed into the board's InfoROM
 *
 * For all products.
 *
 * @param device                                Identifier of the target device
 * @param partNumber                            Reference to the buffer to return
 * @param length                                Length of the buffer reference
 *
 * @return
 *         - \ref NVML_SUCCESS                  if \a partNumber has been set
 *         - \ref NVML_ERROR_UNINITIALIZED      if the library has not been successfully initialized
 *         - \ref NVML_ERROR_NOT_SUPPORTED      if the needed VBIOS fields have not been filled
 *         - \ref NVML_ERROR_INVALID_ARGUMENT   if \a device is invalid or \a serial is NULL
 *         - \ref NVML_ERROR_GPU_IS_LOST        if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN            on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetBoardPartNumber(nvmlDevice_st device, @Cast("char*") BytePointer partNumber, @Cast("unsigned int") int length);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetBoardPartNumber(nvmlDevice_st device, @Cast("char*") ByteBuffer partNumber, @Cast("unsigned int") int length);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetBoardPartNumber(nvmlDevice_st device, @Cast("char*") byte[] partNumber, @Cast("unsigned int") int length);

/**
 * Retrieves the version information for the device's infoROM object.
 *
 * For all products with an inforom.
 *
 * Fermi and higher parts have non-volatile on-board memory for persisting device info, such as aggregate 
 * ECC counts. The version of the data structures in this memory may change from time to time. It will not
 * exceed 16 characters in length (including the NULL terminator).
 * See \ref nvmlConstants::NVML_DEVICE_INFOROM_VERSION_BUFFER_SIZE.
 *
 * See \ref nvmlInforomObject_t for details on the available infoROM objects.
 *
 * @param device                               The identifier of the target device
 * @param object                               The target infoROM object
 * @param version                              Reference in which to return the infoROM version
 * @param length                               The maximum allowed length of the string returned in \a version
 *
 * @return 
 *         - \ref NVML_SUCCESS                 if \a version has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a version is NULL
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small 
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not have an infoROM
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlDeviceGetInforomImageVersion
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetInforomVersion(nvmlDevice_st device, @Cast("nvmlInforomObject_t") int object, @Cast("char*") BytePointer version, @Cast("unsigned int") int length);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetInforomVersion(nvmlDevice_st device, @Cast("nvmlInforomObject_t") int object, @Cast("char*") ByteBuffer version, @Cast("unsigned int") int length);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetInforomVersion(nvmlDevice_st device, @Cast("nvmlInforomObject_t") int object, @Cast("char*") byte[] version, @Cast("unsigned int") int length);

/**
 * Retrieves the global infoROM image version
 *
 * For all products with an inforom.
 *
 * Image version just like VBIOS version uniquely describes the exact version of the infoROM flashed on the board 
 * in contrast to infoROM object version which is only an indicator of supported features.
 * Version string will not exceed 16 characters in length (including the NULL terminator).
 * See \ref nvmlConstants::NVML_DEVICE_INFOROM_VERSION_BUFFER_SIZE.
 *
 * @param device                               The identifier of the target device
 * @param version                              Reference in which to return the infoROM image version
 * @param length                               The maximum allowed length of the string returned in \a version
 *
 * @return 
 *         - \ref NVML_SUCCESS                 if \a version has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a version is NULL
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small 
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not have an infoROM
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlDeviceGetInforomVersion
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetInforomImageVersion(nvmlDevice_st device, @Cast("char*") BytePointer version, @Cast("unsigned int") int length);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetInforomImageVersion(nvmlDevice_st device, @Cast("char*") ByteBuffer version, @Cast("unsigned int") int length);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetInforomImageVersion(nvmlDevice_st device, @Cast("char*") byte[] version, @Cast("unsigned int") int length);

/**
 * Retrieves the checksum of the configuration stored in the device's infoROM.
 *
 * For all products with an inforom.
 *
 * Can be used to make sure that two GPUs have the exact same configuration.
 * Current checksum takes into account configuration stored in PWR and ECC infoROM objects.
 * Checksum can change between driver releases or when user changes configuration (e.g. disable/enable ECC)
 *
 * @param device                               The identifier of the target device
 * @param checksum                             Reference in which to return the infoROM configuration checksum
 *
 * @return 
 *         - \ref NVML_SUCCESS                 if \a checksum has been set
 *         - \ref NVML_ERROR_CORRUPTED_INFOROM if the device's checksum couldn't be retrieved due to infoROM corruption
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a checksum is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error 
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetInforomConfigurationChecksum(nvmlDevice_st device, @Cast("unsigned int*") IntPointer checksum);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetInforomConfigurationChecksum(nvmlDevice_st device, @Cast("unsigned int*") IntBuffer checksum);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetInforomConfigurationChecksum(nvmlDevice_st device, @Cast("unsigned int*") int[] checksum);

/**
 * Reads the infoROM from the flash and verifies the checksums.
 *
 * For all products with an inforom.
 *
 * @param device                               The identifier of the target device
 *
 * @return 
 *         - \ref NVML_SUCCESS                 if infoROM is not corrupted
 *         - \ref NVML_ERROR_CORRUPTED_INFOROM if the device's infoROM is corrupted
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error 
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceValidateInforom(nvmlDevice_st device);

/**
 * Retrieves the display mode for the device.
 *
 * For all products.
 *
 * This method indicates whether a physical display (e.g. monitor) is currently connected to
 * any of the device's connectors.
 *
 * See \ref nvmlEnableState_t for details on allowed modes.
 *
 * @param device                               The identifier of the target device
 * @param display                              Reference in which to return the display mode
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a display has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a display is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetDisplayMode(nvmlDevice_st device, @Cast("nvmlEnableState_t*") IntPointer display);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetDisplayMode(nvmlDevice_st device, @Cast("nvmlEnableState_t*") IntBuffer display);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetDisplayMode(nvmlDevice_st device, @Cast("nvmlEnableState_t*") int[] display);

/**
 * Retrieves the display active state for the device.
 *
 * For all products.
 *
 * This method indicates whether a display is initialized on the device.
 * For example whether X Server is attached to this device and has allocated memory for the screen.
 *
 * Display can be active even when no monitor is physically attached.
 *
 * See \ref nvmlEnableState_t for details on allowed modes.
 *
 * @param device                               The identifier of the target device
 * @param isActive                             Reference in which to return the display active state
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a isActive has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a isActive is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetDisplayActive(nvmlDevice_st device, @Cast("nvmlEnableState_t*") IntPointer isActive);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetDisplayActive(nvmlDevice_st device, @Cast("nvmlEnableState_t*") IntBuffer isActive);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetDisplayActive(nvmlDevice_st device, @Cast("nvmlEnableState_t*") int[] isActive);

/**
 * Retrieves the persistence mode associated with this device.
 *
 * For all products.
 * For Linux only.
 *
 * When driver persistence mode is enabled the driver software state is not torn down when the last 
 * client disconnects. By default this feature is disabled. 
 *
 * See \ref nvmlEnableState_t for details on allowed modes.
 *
 * @param device                               The identifier of the target device
 * @param mode                                 Reference in which to return the current driver persistence mode
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a mode has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a mode is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlDeviceSetPersistenceMode()
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetPersistenceMode(nvmlDevice_st device, @Cast("nvmlEnableState_t*") IntPointer mode);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetPersistenceMode(nvmlDevice_st device, @Cast("nvmlEnableState_t*") IntBuffer mode);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetPersistenceMode(nvmlDevice_st device, @Cast("nvmlEnableState_t*") int[] mode);

/**
 * Retrieves the PCI attributes of this device.
 * 
 * For all products.
 *
 * See \ref nvmlPciInfo_t for details on the available PCI info.
 *
 * @param device                               The identifier of the target device
 * @param pci                                  Reference in which to return the PCI info
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a pci has been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a pci is NULL
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetPciInfo_v3(nvmlDevice_st device, nvmlPciInfo_t pci);

/**
 * Retrieves the maximum PCIe link generation possible with this device and system
 *
 * I.E. for a generation 2 PCIe device attached to a generation 1 PCIe bus the max link generation this function will
 * report is generation 1.
 * 
 * For Fermi &tm; or newer fully supported devices.
 * 
 * @param device                               The identifier of the target device
 * @param maxLinkGen                           Reference in which to return the max PCIe link generation
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a maxLinkGen has been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a maxLinkGen is null
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if PCIe link information is not available
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetMaxPcieLinkGeneration(nvmlDevice_st device, @Cast("unsigned int*") IntPointer maxLinkGen);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetMaxPcieLinkGeneration(nvmlDevice_st device, @Cast("unsigned int*") IntBuffer maxLinkGen);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetMaxPcieLinkGeneration(nvmlDevice_st device, @Cast("unsigned int*") int[] maxLinkGen);

/**
 * Retrieves the maximum PCIe link width possible with this device and system
 *
 * I.E. for a device with a 16x PCIe bus width attached to a 8x PCIe system bus this function will report
 * a max link width of 8.
 * 
 * For Fermi &tm; or newer fully supported devices.
 * 
 * @param device                               The identifier of the target device
 * @param maxLinkWidth                         Reference in which to return the max PCIe link generation
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a maxLinkWidth has been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a maxLinkWidth is null
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if PCIe link information is not available
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetMaxPcieLinkWidth(nvmlDevice_st device, @Cast("unsigned int*") IntPointer maxLinkWidth);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetMaxPcieLinkWidth(nvmlDevice_st device, @Cast("unsigned int*") IntBuffer maxLinkWidth);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetMaxPcieLinkWidth(nvmlDevice_st device, @Cast("unsigned int*") int[] maxLinkWidth);

/**
 * Retrieves the current PCIe link generation
 * 
 * For Fermi &tm; or newer fully supported devices.
 * 
 * @param device                               The identifier of the target device
 * @param currLinkGen                          Reference in which to return the current PCIe link generation
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a currLinkGen has been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a currLinkGen is null
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if PCIe link information is not available
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetCurrPcieLinkGeneration(nvmlDevice_st device, @Cast("unsigned int*") IntPointer currLinkGen);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetCurrPcieLinkGeneration(nvmlDevice_st device, @Cast("unsigned int*") IntBuffer currLinkGen);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetCurrPcieLinkGeneration(nvmlDevice_st device, @Cast("unsigned int*") int[] currLinkGen);

/**
 * Retrieves the current PCIe link width
 * 
 * For Fermi &tm; or newer fully supported devices.
 * 
 * @param device                               The identifier of the target device
 * @param currLinkWidth                        Reference in which to return the current PCIe link generation
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a currLinkWidth has been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a currLinkWidth is null
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if PCIe link information is not available
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetCurrPcieLinkWidth(nvmlDevice_st device, @Cast("unsigned int*") IntPointer currLinkWidth);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetCurrPcieLinkWidth(nvmlDevice_st device, @Cast("unsigned int*") IntBuffer currLinkWidth);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetCurrPcieLinkWidth(nvmlDevice_st device, @Cast("unsigned int*") int[] currLinkWidth);

/**
 * Retrieve PCIe utilization information.
 * This function is querying a byte counter over a 20ms interval and thus is the 
 *   PCIe throughput over that interval.
 *
 * For Maxwell &tm; or newer fully supported devices.
 *
 * This method is not supported in virtual machines running virtual GPU (vGPU).
 *
 * @param device                               The identifier of the target device
 * @param counter                              The specific counter that should be queried \ref nvmlPcieUtilCounter_t
 * @param value                                Reference in which to return throughput in KB/s
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a value has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device or \a counter is invalid, or \a value is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetPcieThroughput(nvmlDevice_st device, @Cast("nvmlPcieUtilCounter_t") int counter, @Cast("unsigned int*") IntPointer value);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetPcieThroughput(nvmlDevice_st device, @Cast("nvmlPcieUtilCounter_t") int counter, @Cast("unsigned int*") IntBuffer value);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetPcieThroughput(nvmlDevice_st device, @Cast("nvmlPcieUtilCounter_t") int counter, @Cast("unsigned int*") int[] value);

/**  
 * Retrieve the PCIe replay counter.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param value                                Reference in which to return the counter's value
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a value has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, or \a value is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetPcieReplayCounter(nvmlDevice_st device, @Cast("unsigned int*") IntPointer value);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetPcieReplayCounter(nvmlDevice_st device, @Cast("unsigned int*") IntBuffer value);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetPcieReplayCounter(nvmlDevice_st device, @Cast("unsigned int*") int[] value);

/**
 * Retrieves the current clock speeds for the device.
 *
 * For Fermi &tm; or newer fully supported devices.
 *
 * See \ref nvmlClockType_t for details on available clock information.
 *
 * @param device                               The identifier of the target device
 * @param type                                 Identify which clock domain to query
 * @param clock                                Reference in which to return the clock speed in MHz
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a clock has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a clock is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device cannot report the specified clock
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetClockInfo(nvmlDevice_st device, @Cast("nvmlClockType_t") int type, @Cast("unsigned int*") IntPointer clock);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetClockInfo(nvmlDevice_st device, @Cast("nvmlClockType_t") int type, @Cast("unsigned int*") IntBuffer clock);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetClockInfo(nvmlDevice_st device, @Cast("nvmlClockType_t") int type, @Cast("unsigned int*") int[] clock);

/**
 * Retrieves the maximum clock speeds for the device.
 *
 * For Fermi &tm; or newer fully supported devices.
 *
 * See \ref nvmlClockType_t for details on available clock information.
 *
 * \note On GPUs from Fermi family current P0 clocks (reported by \ref nvmlDeviceGetClockInfo) can differ from max clocks
 *       by few MHz.
 *
 * @param device                               The identifier of the target device
 * @param type                                 Identify which clock domain to query
 * @param clock                                Reference in which to return the clock speed in MHz
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a clock has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a clock is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device cannot report the specified clock
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetMaxClockInfo(nvmlDevice_st device, @Cast("nvmlClockType_t") int type, @Cast("unsigned int*") IntPointer clock);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetMaxClockInfo(nvmlDevice_st device, @Cast("nvmlClockType_t") int type, @Cast("unsigned int*") IntBuffer clock);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetMaxClockInfo(nvmlDevice_st device, @Cast("nvmlClockType_t") int type, @Cast("unsigned int*") int[] clock);

/**
 * Retrieves the current setting of a clock that applications will use unless an overspec situation occurs.
 * Can be changed using \ref nvmlDeviceSetApplicationsClocks.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param clockType                            Identify which clock domain to query
 * @param clockMHz                             Reference in which to return the clock in MHz
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a clockMHz has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a clockMHz is NULL or \a clockType is invalid
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetApplicationsClock(nvmlDevice_st device, @Cast("nvmlClockType_t") int clockType, @Cast("unsigned int*") IntPointer clockMHz);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetApplicationsClock(nvmlDevice_st device, @Cast("nvmlClockType_t") int clockType, @Cast("unsigned int*") IntBuffer clockMHz);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetApplicationsClock(nvmlDevice_st device, @Cast("nvmlClockType_t") int clockType, @Cast("unsigned int*") int[] clockMHz);

/**
 * Retrieves the default applications clock that GPU boots with or 
 * defaults to after \ref nvmlDeviceResetApplicationsClocks call.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param clockType                            Identify which clock domain to query
 * @param clockMHz                             Reference in which to return the default clock in MHz
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a clockMHz has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a clockMHz is NULL or \a clockType is invalid
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlDeviceGetApplicationsClock
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetDefaultApplicationsClock(nvmlDevice_st device, @Cast("nvmlClockType_t") int clockType, @Cast("unsigned int*") IntPointer clockMHz);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetDefaultApplicationsClock(nvmlDevice_st device, @Cast("nvmlClockType_t") int clockType, @Cast("unsigned int*") IntBuffer clockMHz);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetDefaultApplicationsClock(nvmlDevice_st device, @Cast("nvmlClockType_t") int clockType, @Cast("unsigned int*") int[] clockMHz);

/**
 * Resets the application clock to the default value
 *
 * This is the applications clock that will be used after system reboot or driver reload.
 * Default value is constant, but the current value an be changed using \ref nvmlDeviceSetApplicationsClocks.
 *
 * On Pascal and newer hardware, if clocks were previously locked with \ref nvmlDeviceSetApplicationsClocks,
 * this call will unlock clocks. This returns clocks their default behavior ofautomatically boosting above
 * base clocks as thermal limits allow.
 *
 * @see nvmlDeviceGetApplicationsClock
 * @see nvmlDeviceSetApplicationsClocks
 *
 * For Fermi &tm; or newer non-GeForce fully supported devices and Maxwell or newer GeForce devices.
 *
 * @param device                               The identifier of the target device
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if new settings were successfully set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceResetApplicationsClocks(nvmlDevice_st device);

/**
 * Retrieves the clock speed for the clock specified by the clock type and clock ID.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param clockType                            Identify which clock domain to query
 * @param clockId                              Identify which clock in the domain to query
 * @param clockMHz                             Reference in which to return the clock in MHz
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a clockMHz has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a clockMHz is NULL or \a clockType is invalid
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetClock(nvmlDevice_st device, @Cast("nvmlClockType_t") int clockType, @Cast("nvmlClockId_t") int clockId, @Cast("unsigned int*") IntPointer clockMHz);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetClock(nvmlDevice_st device, @Cast("nvmlClockType_t") int clockType, @Cast("nvmlClockId_t") int clockId, @Cast("unsigned int*") IntBuffer clockMHz);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetClock(nvmlDevice_st device, @Cast("nvmlClockType_t") int clockType, @Cast("nvmlClockId_t") int clockId, @Cast("unsigned int*") int[] clockMHz);

/**
 * Retrieves the customer defined maximum boost clock speed specified by the given clock type.
 *
 * For Pascal &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param clockType                            Identify which clock domain to query
 * @param clockMHz                             Reference in which to return the clock in MHz
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a clockMHz has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a clockMHz is NULL or \a clockType is invalid
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device or the \a clockType on this device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetMaxCustomerBoostClock(nvmlDevice_st device, @Cast("nvmlClockType_t") int clockType, @Cast("unsigned int*") IntPointer clockMHz);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetMaxCustomerBoostClock(nvmlDevice_st device, @Cast("nvmlClockType_t") int clockType, @Cast("unsigned int*") IntBuffer clockMHz);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetMaxCustomerBoostClock(nvmlDevice_st device, @Cast("nvmlClockType_t") int clockType, @Cast("unsigned int*") int[] clockMHz);

/**
 * Retrieves the list of possible memory clocks that can be used as an argument for \ref nvmlDeviceSetApplicationsClocks.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param count                                Reference in which to provide the \a clocksMHz array size, and
 *                                             to return the number of elements
 * @param clocksMHz                            Reference in which to return the clock in MHz
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a count and \a clocksMHz have been populated 
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a count is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a count is too small (\a count is set to the number of
 *                                                required elements)
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlDeviceSetApplicationsClocks
 * @see nvmlDeviceGetSupportedGraphicsClocks
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetSupportedMemoryClocks(nvmlDevice_st device, @Cast("unsigned int*") IntPointer count, @Cast("unsigned int*") IntPointer clocksMHz);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetSupportedMemoryClocks(nvmlDevice_st device, @Cast("unsigned int*") IntBuffer count, @Cast("unsigned int*") IntBuffer clocksMHz);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetSupportedMemoryClocks(nvmlDevice_st device, @Cast("unsigned int*") int[] count, @Cast("unsigned int*") int[] clocksMHz);

/**
 * Retrieves the list of possible graphics clocks that can be used as an argument for \ref nvmlDeviceSetApplicationsClocks.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param memoryClockMHz                       Memory clock for which to return possible graphics clocks
 * @param count                                Reference in which to provide the \a clocksMHz array size, and
 *                                             to return the number of elements
 * @param clocksMHz                            Reference in which to return the clocks in MHz
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a count and \a clocksMHz have been populated 
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_NOT_FOUND         if the specified \a memoryClockMHz is not a supported frequency
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a clock is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a count is too small 
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlDeviceSetApplicationsClocks
 * @see nvmlDeviceGetSupportedMemoryClocks
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetSupportedGraphicsClocks(nvmlDevice_st device, @Cast("unsigned int") int memoryClockMHz, @Cast("unsigned int*") IntPointer count, @Cast("unsigned int*") IntPointer clocksMHz);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetSupportedGraphicsClocks(nvmlDevice_st device, @Cast("unsigned int") int memoryClockMHz, @Cast("unsigned int*") IntBuffer count, @Cast("unsigned int*") IntBuffer clocksMHz);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetSupportedGraphicsClocks(nvmlDevice_st device, @Cast("unsigned int") int memoryClockMHz, @Cast("unsigned int*") int[] count, @Cast("unsigned int*") int[] clocksMHz);

/**
 * Retrieve the current state of Auto Boosted clocks on a device and store it in \a isEnabled
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * Auto Boosted clocks are enabled by default on some hardware, allowing the GPU to run at higher clock rates
 * to maximize performance as thermal limits allow.
 *
 * On Pascal and newer hardware, Auto Aoosted clocks are controlled through application clocks.
 * Use \ref nvmlDeviceSetApplicationsClocks and \ref nvmlDeviceResetApplicationsClocks to control Auto Boost
 * behavior.
 *
 * @param device                               The identifier of the target device
 * @param isEnabled                            Where to store the current state of Auto Boosted clocks of the target device
 * @param defaultIsEnabled                     Where to store the default Auto Boosted clocks behavior of the target device that the device will
 *                                                 revert to when no applications are using the GPU
 *
 * @return
 *         - \ref NVML_SUCCESS                 If \a isEnabled has been been set with the Auto Boosted clocks state of \a device
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a isEnabled is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support Auto Boosted clocks
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetAutoBoostedClocksEnabled(nvmlDevice_st device, @Cast("nvmlEnableState_t*") IntPointer isEnabled, @Cast("nvmlEnableState_t*") IntPointer defaultIsEnabled);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetAutoBoostedClocksEnabled(nvmlDevice_st device, @Cast("nvmlEnableState_t*") IntBuffer isEnabled, @Cast("nvmlEnableState_t*") IntBuffer defaultIsEnabled);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetAutoBoostedClocksEnabled(nvmlDevice_st device, @Cast("nvmlEnableState_t*") int[] isEnabled, @Cast("nvmlEnableState_t*") int[] defaultIsEnabled);

/**
 * Try to set the current state of Auto Boosted clocks on a device.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * Auto Boosted clocks are enabled by default on some hardware, allowing the GPU to run at higher clock rates
 * to maximize performance as thermal limits allow. Auto Boosted clocks should be disabled if fixed clock
 * rates are desired.
 *
 * Non-root users may use this API by default but can be restricted by root from using this API by calling
 * \ref nvmlDeviceSetAPIRestriction with apiType=NVML_RESTRICTED_API_SET_AUTO_BOOSTED_CLOCKS.
 * Note: Persistence Mode is required to modify current Auto Boost settings, therefore, it must be enabled.
 *
 * On Pascal and newer hardware, Auto Boosted clocks are controlled through application clocks.
 * Use \ref nvmlDeviceSetApplicationsClocks and \ref nvmlDeviceResetApplicationsClocks to control Auto Boost
 * behavior.
 *
 * @param device                               The identifier of the target device
 * @param enabled                              What state to try to set Auto Boosted clocks of the target device to
 *
 * @return
 *         - \ref NVML_SUCCESS                 If the Auto Boosted clocks were successfully set to the state specified by \a enabled
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support Auto Boosted clocks
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceSetAutoBoostedClocksEnabled(nvmlDevice_st device, @Cast("nvmlEnableState_t") int enabled);

/**
 * Try to set the default state of Auto Boosted clocks on a device. This is the default state that Auto Boosted clocks will
 * return to when no compute running processes (e.g. CUDA application which have an active context) are running
 *
 * For Kepler &tm; or newer non-GeForce fully supported devices and Maxwell or newer GeForce devices.
 * Requires root/admin permissions.
 *
 * Auto Boosted clocks are enabled by default on some hardware, allowing the GPU to run at higher clock rates
 * to maximize performance as thermal limits allow. Auto Boosted clocks should be disabled if fixed clock
 * rates are desired.
 *
 * On Pascal and newer hardware, Auto Boosted clocks are controlled through application clocks.
 * Use \ref nvmlDeviceSetApplicationsClocks and \ref nvmlDeviceResetApplicationsClocks to control Auto Boost
 * behavior.
 *
 * @param device                               The identifier of the target device
 * @param enabled                              What state to try to set default Auto Boosted clocks of the target device to
 * @param flags                                Flags that change the default behavior. Currently Unused.
 *
 * @return
 *         - \ref NVML_SUCCESS                 If the Auto Boosted clock's default state was successfully set to the state specified by \a enabled
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_NO_PERMISSION     If the calling user does not have permission to change Auto Boosted clock's default state.
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support Auto Boosted clocks
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceSetDefaultAutoBoostedClocksEnabled(nvmlDevice_st device, @Cast("nvmlEnableState_t") int enabled, @Cast("unsigned int") int flags);


/**
 * Retrieves the intended operating speed of the device's fan.
 *
 * Note: The reported speed is the intended fan speed.  If the fan is physically blocked and unable to spin, the
 * output will not match the actual fan speed.
 * 
 * For all discrete products with dedicated fans.
 *
 * The fan speed is expressed as a percent of the maximum, i.e. full speed is 100%.
 *
 * @param device                               The identifier of the target device
 * @param speed                                Reference in which to return the fan speed percentage
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a speed has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a speed is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not have a fan
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetFanSpeed(nvmlDevice_st device, @Cast("unsigned int*") IntPointer speed);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetFanSpeed(nvmlDevice_st device, @Cast("unsigned int*") IntBuffer speed);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetFanSpeed(nvmlDevice_st device, @Cast("unsigned int*") int[] speed);

/**
 * Retrieves the current temperature readings for the device, in degrees C. 
 * 
 * For all products.
 *
 * See \ref nvmlTemperatureSensors_t for details on available temperature sensors.
 *
 * @param device                               The identifier of the target device
 * @param sensorType                           Flag that indicates which sensor reading to retrieve
 * @param temp                                 Reference in which to return the temperature reading
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a temp has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, \a sensorType is invalid or \a temp is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not have the specified sensor
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetTemperature(nvmlDevice_st device, @Cast("nvmlTemperatureSensors_t") int sensorType, @Cast("unsigned int*") IntPointer temp);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetTemperature(nvmlDevice_st device, @Cast("nvmlTemperatureSensors_t") int sensorType, @Cast("unsigned int*") IntBuffer temp);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetTemperature(nvmlDevice_st device, @Cast("nvmlTemperatureSensors_t") int sensorType, @Cast("unsigned int*") int[] temp);

/**
 * Retrieves the temperature threshold for the GPU with the specified threshold type in degrees C.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * See \ref nvmlTemperatureThresholds_t for details on available temperature thresholds.
 *
 * @param device                               The identifier of the target device
 * @param thresholdType                        The type of threshold value queried
 * @param temp                                 Reference in which to return the temperature reading
 * @return
 *         - \ref NVML_SUCCESS                 if \a temp has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, \a thresholdType is invalid or \a temp is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not have a temperature sensor or is unsupported
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetTemperatureThreshold(nvmlDevice_st device, @Cast("nvmlTemperatureThresholds_t") int thresholdType, @Cast("unsigned int*") IntPointer temp);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetTemperatureThreshold(nvmlDevice_st device, @Cast("nvmlTemperatureThresholds_t") int thresholdType, @Cast("unsigned int*") IntBuffer temp);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetTemperatureThreshold(nvmlDevice_st device, @Cast("nvmlTemperatureThresholds_t") int thresholdType, @Cast("unsigned int*") int[] temp);

/**
 * Retrieves the current performance state for the device. 
 *
 * For Fermi &tm; or newer fully supported devices.
 *
 * See \ref nvmlPstates_t for details on allowed performance states.
 *
 * @param device                               The identifier of the target device
 * @param pState                               Reference in which to return the performance state reading
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a pState has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a pState is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetPerformanceState(nvmlDevice_st device, @Cast("nvmlPstates_t*") IntPointer pState);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetPerformanceState(nvmlDevice_st device, @Cast("nvmlPstates_t*") IntBuffer pState);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetPerformanceState(nvmlDevice_st device, @Cast("nvmlPstates_t*") int[] pState);

/**
 * Retrieves current clocks throttling reasons.
 *
 * For all fully supported products.
 *
 * \note More than one bit can be enabled at the same time. Multiple reasons can be affecting clocks at once.
 *
 * @param device                                The identifier of the target device
 * @param clocksThrottleReasons                 Reference in which to return bitmask of active clocks throttle
 *                                                  reasons
 *
 * @return 
 *         - \ref NVML_SUCCESS                 if \a clocksThrottleReasons has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a clocksThrottleReasons is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlClocksThrottleReasons
 * @see nvmlDeviceGetSupportedClocksThrottleReasons
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetCurrentClocksThrottleReasons(nvmlDevice_st device, @Cast("unsigned long long*") LongPointer clocksThrottleReasons);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetCurrentClocksThrottleReasons(nvmlDevice_st device, @Cast("unsigned long long*") LongBuffer clocksThrottleReasons);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetCurrentClocksThrottleReasons(nvmlDevice_st device, @Cast("unsigned long long*") long[] clocksThrottleReasons);

/**
 * Retrieves bitmask of supported clocks throttle reasons that can be returned by 
 * \ref nvmlDeviceGetCurrentClocksThrottleReasons
 *
 * For all fully supported products.
 *
 * This method is not supported in virtual machines running virtual GPU (vGPU).
 *
 * @param device                               The identifier of the target device
 * @param supportedClocksThrottleReasons       Reference in which to return bitmask of supported
 *                                              clocks throttle reasons
 *
 * @return 
 *         - \ref NVML_SUCCESS                 if \a supportedClocksThrottleReasons has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a supportedClocksThrottleReasons is NULL
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlClocksThrottleReasons
 * @see nvmlDeviceGetCurrentClocksThrottleReasons
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetSupportedClocksThrottleReasons(nvmlDevice_st device, @Cast("unsigned long long*") LongPointer supportedClocksThrottleReasons);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetSupportedClocksThrottleReasons(nvmlDevice_st device, @Cast("unsigned long long*") LongBuffer supportedClocksThrottleReasons);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetSupportedClocksThrottleReasons(nvmlDevice_st device, @Cast("unsigned long long*") long[] supportedClocksThrottleReasons);

/**
 * Deprecated: Use \ref nvmlDeviceGetPerformanceState. This function exposes an incorrect generalization.
 *
 * Retrieve the current performance state for the device. 
 *
 * For Fermi &tm; or newer fully supported devices.
 *
 * See \ref nvmlPstates_t for details on allowed performance states.
 *
 * @param device                               The identifier of the target device
 * @param pState                               Reference in which to return the performance state reading
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a pState has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a pState is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetPowerState(nvmlDevice_st device, @Cast("nvmlPstates_t*") IntPointer pState);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetPowerState(nvmlDevice_st device, @Cast("nvmlPstates_t*") IntBuffer pState);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetPowerState(nvmlDevice_st device, @Cast("nvmlPstates_t*") int[] pState);

/**
 * This API has been deprecated.
 *
 * Retrieves the power management mode associated with this device.
 *
 * For products from the Fermi family.
 *     - Requires \a NVML_INFOROM_POWER version 3.0 or higher.
 *
 * For from the Kepler or newer families.
 *     - Does not require \a NVML_INFOROM_POWER object.
 *
 * This flag indicates whether any power management algorithm is currently active on the device. An 
 * enabled state does not necessarily mean the device is being actively throttled -- only that 
 * that the driver will do so if the appropriate conditions are met.
 *
 * See \ref nvmlEnableState_t for details on allowed modes.
 *
 * @param device                               The identifier of the target device
 * @param mode                                 Reference in which to return the current power management mode
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a mode has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a mode is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetPowerManagementMode(nvmlDevice_st device, @Cast("nvmlEnableState_t*") IntPointer mode);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetPowerManagementMode(nvmlDevice_st device, @Cast("nvmlEnableState_t*") IntBuffer mode);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetPowerManagementMode(nvmlDevice_st device, @Cast("nvmlEnableState_t*") int[] mode);

/**
 * Retrieves the power management limit associated with this device.
 *
 * For Fermi &tm; or newer fully supported devices.
 *
 * The power limit defines the upper boundary for the card's power draw. If
 * the card's total power draw reaches this limit the power management algorithm kicks in.
 *
 * This reading is only available if power management mode is supported. 
 * See \ref nvmlDeviceGetPowerManagementMode.
 *
 * @param device                               The identifier of the target device
 * @param limit                                Reference in which to return the power management limit in milliwatts
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a limit has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a limit is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetPowerManagementLimit(nvmlDevice_st device, @Cast("unsigned int*") IntPointer limit);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetPowerManagementLimit(nvmlDevice_st device, @Cast("unsigned int*") IntBuffer limit);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetPowerManagementLimit(nvmlDevice_st device, @Cast("unsigned int*") int[] limit);

/**
 * Retrieves information about possible values of power management limits on this device.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param minLimit                             Reference in which to return the minimum power management limit in milliwatts
 * @param maxLimit                             Reference in which to return the maximum power management limit in milliwatts
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a minLimit and \a maxLimit have been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a minLimit or \a maxLimit is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlDeviceSetPowerManagementLimit
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetPowerManagementLimitConstraints(nvmlDevice_st device, @Cast("unsigned int*") IntPointer minLimit, @Cast("unsigned int*") IntPointer maxLimit);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetPowerManagementLimitConstraints(nvmlDevice_st device, @Cast("unsigned int*") IntBuffer minLimit, @Cast("unsigned int*") IntBuffer maxLimit);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetPowerManagementLimitConstraints(nvmlDevice_st device, @Cast("unsigned int*") int[] minLimit, @Cast("unsigned int*") int[] maxLimit);

/**
 * Retrieves default power management limit on this device, in milliwatts.
 * Default power management limit is a power management limit that the device boots with.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param defaultLimit                         Reference in which to return the default power management limit in milliwatts
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a defaultLimit has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a defaultLimit is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetPowerManagementDefaultLimit(nvmlDevice_st device, @Cast("unsigned int*") IntPointer defaultLimit);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetPowerManagementDefaultLimit(nvmlDevice_st device, @Cast("unsigned int*") IntBuffer defaultLimit);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetPowerManagementDefaultLimit(nvmlDevice_st device, @Cast("unsigned int*") int[] defaultLimit);

/**
 * Retrieves power usage for this GPU in milliwatts and its associated circuitry (e.g. memory)
 *
 * For Fermi &tm; or newer fully supported devices.
 *
 * On Fermi and Kepler GPUs the reading is accurate to within +/- 5% of current power draw.
 *
 * It is only available if power management mode is supported. See \ref nvmlDeviceGetPowerManagementMode.
 *
 * @param device                               The identifier of the target device
 * @param power                                Reference in which to return the power usage information
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a power has been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a power is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support power readings
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetPowerUsage(nvmlDevice_st device, @Cast("unsigned int*") IntPointer power);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetPowerUsage(nvmlDevice_st device, @Cast("unsigned int*") IntBuffer power);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetPowerUsage(nvmlDevice_st device, @Cast("unsigned int*") int[] power);

/**
 * Retrieves total energy consumption for this GPU in millijoules (mJ) since the driver was last reloaded
 *
 * For newer than Pascal &tm; fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param energy                               Reference in which to return the energy consumption information
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a energy has been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a energy is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support energy readings
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetTotalEnergyConsumption(nvmlDevice_st device, @Cast("unsigned long long*") LongPointer energy);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetTotalEnergyConsumption(nvmlDevice_st device, @Cast("unsigned long long*") LongBuffer energy);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetTotalEnergyConsumption(nvmlDevice_st device, @Cast("unsigned long long*") long[] energy);

/**
 * Get the effective power limit that the driver enforces after taking into account all limiters
 *
 * Note: This can be different from the \ref nvmlDeviceGetPowerManagementLimit if other limits are set elsewhere
 * This includes the out of band power limit interface
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param device                           The device to communicate with
 * @param limit                            Reference in which to return the power management limit in milliwatts
 *
 * @return 
 *         - \ref NVML_SUCCESS                 if \a limit has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a limit is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetEnforcedPowerLimit(nvmlDevice_st device, @Cast("unsigned int*") IntPointer limit);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetEnforcedPowerLimit(nvmlDevice_st device, @Cast("unsigned int*") IntBuffer limit);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetEnforcedPowerLimit(nvmlDevice_st device, @Cast("unsigned int*") int[] limit);

/**
 * Retrieves the current GOM and pending GOM (the one that GPU will switch to after reboot).
 *
 * For GK110 M-class and X-class Tesla &tm; products from the Kepler family.
 * Modes \ref NVML_GOM_LOW_DP and \ref NVML_GOM_ALL_ON are supported on fully supported GeForce products.
 * Not supported on Quadro ® and Tesla &tm; C-class products.
 *
 * @param device                               The identifier of the target device
 * @param current                              Reference in which to return the current GOM
 * @param pending                              Reference in which to return the pending GOM
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a mode has been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a current or \a pending is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlGpuOperationMode_t
 * @see nvmlDeviceSetGpuOperationMode
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetGpuOperationMode(nvmlDevice_st device, @Cast("nvmlGpuOperationMode_t*") IntPointer current, @Cast("nvmlGpuOperationMode_t*") IntPointer pending);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetGpuOperationMode(nvmlDevice_st device, @Cast("nvmlGpuOperationMode_t*") IntBuffer current, @Cast("nvmlGpuOperationMode_t*") IntBuffer pending);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetGpuOperationMode(nvmlDevice_st device, @Cast("nvmlGpuOperationMode_t*") int[] current, @Cast("nvmlGpuOperationMode_t*") int[] pending);

/**
 * Retrieves the amount of used, free and total memory available on the device, in bytes.
 * 
 * For all products.
 *
 * Enabling ECC reduces the amount of total available memory, due to the extra required parity bits.
 * Under WDDM most device memory is allocated and managed on startup by Windows.
 *
 * Under Linux and Windows TCC, the reported amount of used memory is equal to the sum of memory allocated 
 * by all active channels on the device.
 *
 * See \ref nvmlMemory_t for details on available memory info.
 *
 * @param device                               The identifier of the target device
 * @param memory                               Reference in which to return the memory information
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a memory has been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a memory is NULL
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetMemoryInfo(nvmlDevice_st device, nvmlMemory_t memory);

/**
 * Retrieves the current compute mode for the device.
 *
 * For all products.
 *
 * See \ref nvmlComputeMode_t for details on allowed compute modes.
 *
 * @param device                               The identifier of the target device
 * @param mode                                 Reference in which to return the current compute mode
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a mode has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a mode is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlDeviceSetComputeMode()
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetComputeMode(nvmlDevice_st device, @Cast("nvmlComputeMode_t*") IntPointer mode);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetComputeMode(nvmlDevice_st device, @Cast("nvmlComputeMode_t*") IntBuffer mode);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetComputeMode(nvmlDevice_st device, @Cast("nvmlComputeMode_t*") int[] mode);

/**
 * Retrieves the CUDA compute capability of the device.
 *
 * For all products.
 *
 * Returns the major and minor compute capability version numbers of the
 * device.  The major and minor versions are equivalent to the
 * CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR and
 * CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR attributes that would be
 * returned by CUDA's cuDeviceGetAttribute().
 *
 * @param device                               The identifier of the target device
 * @param major                                Reference in which to return the major CUDA compute capability
 * @param minor                                Reference in which to return the minor CUDA compute capability
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a major and \a minor have been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a major or \a minor are NULL
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetCudaComputeCapability(nvmlDevice_st device, IntPointer major, IntPointer minor);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetCudaComputeCapability(nvmlDevice_st device, IntBuffer major, IntBuffer minor);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetCudaComputeCapability(nvmlDevice_st device, int[] major, int[] minor);

/**
 * Retrieves the current and pending ECC modes for the device.
 *
 * For Fermi &tm; or newer fully supported devices.
 * Only applicable to devices with ECC.
 * Requires \a NVML_INFOROM_ECC version 1.0 or higher.
 *
 * Changing ECC modes requires a reboot. The "pending" ECC mode refers to the target mode following
 * the next reboot.
 *
 * See \ref nvmlEnableState_t for details on allowed modes.
 *
 * @param device                               The identifier of the target device
 * @param current                              Reference in which to return the current ECC mode
 * @param pending                              Reference in which to return the pending ECC mode
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a current and \a pending have been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or either \a current or \a pending is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlDeviceSetEccMode()
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetEccMode(nvmlDevice_st device, @Cast("nvmlEnableState_t*") IntPointer current, @Cast("nvmlEnableState_t*") IntPointer pending);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetEccMode(nvmlDevice_st device, @Cast("nvmlEnableState_t*") IntBuffer current, @Cast("nvmlEnableState_t*") IntBuffer pending);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetEccMode(nvmlDevice_st device, @Cast("nvmlEnableState_t*") int[] current, @Cast("nvmlEnableState_t*") int[] pending);

/**
 * Retrieves the device boardId from 0-N.
 * Devices with the same boardId indicate GPUs connected to the same PLX.  Use in conjunction with 
 *  \ref nvmlDeviceGetMultiGpuBoard() to decide if they are on the same board as well.
 *  The boardId returned is a unique ID for the current configuration.  Uniqueness and ordering across 
 *  reboots and system configurations is not guaranteed (i.e. if a Tesla K40c returns 0x100 and
 *  the two GPUs on a Tesla K10 in the same system returns 0x200 it is not guaranteed they will 
 *  always return those values but they will always be different from each other).
 *  
 *
 * For Fermi &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param boardId                              Reference in which to return the device's board ID
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a boardId has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a boardId is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetBoardId(nvmlDevice_st device, @Cast("unsigned int*") IntPointer boardId);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetBoardId(nvmlDevice_st device, @Cast("unsigned int*") IntBuffer boardId);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetBoardId(nvmlDevice_st device, @Cast("unsigned int*") int[] boardId);

/**
 * Retrieves whether the device is on a Multi-GPU Board
 * Devices that are on multi-GPU boards will set \a multiGpuBool to a non-zero value.
 *
 * For Fermi &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param multiGpuBool                         Reference in which to return a zero or non-zero value
 *                                                 to indicate whether the device is on a multi GPU board
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a multiGpuBool has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a multiGpuBool is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetMultiGpuBoard(nvmlDevice_st device, @Cast("unsigned int*") IntPointer multiGpuBool);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetMultiGpuBoard(nvmlDevice_st device, @Cast("unsigned int*") IntBuffer multiGpuBool);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetMultiGpuBoard(nvmlDevice_st device, @Cast("unsigned int*") int[] multiGpuBool);

/**
 * Retrieves the total ECC error counts for the device.
 *
 * For Fermi &tm; or newer fully supported devices.
 * Only applicable to devices with ECC.
 * Requires \a NVML_INFOROM_ECC version 1.0 or higher.
 * Requires ECC Mode to be enabled.
 *
 * The total error count is the sum of errors across each of the separate memory systems, i.e. the total set of 
 * errors across the entire device.
 *
 * See \ref nvmlMemoryErrorType_t for a description of available error types.\n
 * See \ref nvmlEccCounterType_t for a description of available counter types.
 *
 * @param device                               The identifier of the target device
 * @param errorType                            Flag that specifies the type of the errors. 
 * @param counterType                          Flag that specifies the counter-type of the errors. 
 * @param eccCounts                            Reference in which to return the specified ECC errors
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a eccCounts has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device, \a errorType or \a counterType is invalid, or \a eccCounts is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlDeviceClearEccErrorCounts()
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetTotalEccErrors(nvmlDevice_st device, @Cast("nvmlMemoryErrorType_t") int errorType, @Cast("nvmlEccCounterType_t") int counterType, @Cast("unsigned long long*") LongPointer eccCounts);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetTotalEccErrors(nvmlDevice_st device, @Cast("nvmlMemoryErrorType_t") int errorType, @Cast("nvmlEccCounterType_t") int counterType, @Cast("unsigned long long*") LongBuffer eccCounts);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetTotalEccErrors(nvmlDevice_st device, @Cast("nvmlMemoryErrorType_t") int errorType, @Cast("nvmlEccCounterType_t") int counterType, @Cast("unsigned long long*") long[] eccCounts);

/**
 * Retrieves the detailed ECC error counts for the device.
 *
 * @deprecated   This API supports only a fixed set of ECC error locations
 *               On different GPU architectures different locations are supported
 *               See \ref nvmlDeviceGetMemoryErrorCounter
 *
 * For Fermi &tm; or newer fully supported devices.
 * Only applicable to devices with ECC.
 * Requires \a NVML_INFOROM_ECC version 2.0 or higher to report aggregate location-based ECC counts.
 * Requires \a NVML_INFOROM_ECC version 1.0 or higher to report all other ECC counts.
 * Requires ECC Mode to be enabled.
 *
 * Detailed errors provide separate ECC counts for specific parts of the memory system.
 *
 * Reports zero for unsupported ECC error counters when a subset of ECC error counters are supported.
 *
 * See \ref nvmlMemoryErrorType_t for a description of available bit types.\n
 * See \ref nvmlEccCounterType_t for a description of available counter types.\n
 * See \ref nvmlEccErrorCounts_t for a description of provided detailed ECC counts.
 *
 * @param device                               The identifier of the target device
 * @param errorType                            Flag that specifies the type of the errors. 
 * @param counterType                          Flag that specifies the counter-type of the errors. 
 * @param eccCounts                            Reference in which to return the specified ECC errors
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a eccCounts has been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device, \a errorType or \a counterType is invalid, or \a eccCounts is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlDeviceClearEccErrorCounts()
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetDetailedEccErrors(nvmlDevice_st device, @Cast("nvmlMemoryErrorType_t") int errorType, @Cast("nvmlEccCounterType_t") int counterType, nvmlEccErrorCounts_t eccCounts);

/**
 * Retrieves the requested memory error counter for the device.
 *
 * For Fermi &tm; or newer fully supported devices.
 * Requires \a NVML_INFOROM_ECC version 2.0 or higher to report aggregate location-based memory error counts.
 * Requires \a NVML_INFOROM_ECC version 1.0 or higher to report all other memory error counts.
 *
 * Only applicable to devices with ECC.
 *
 * Requires ECC Mode to be enabled.
 *
 * See \ref nvmlMemoryErrorType_t for a description of available memory error types.\n
 * See \ref nvmlEccCounterType_t for a description of available counter types.\n
 * See \ref nvmlMemoryLocation_t for a description of available counter locations.\n
 * 
 * @param device                               The identifier of the target device
 * @param errorType                            Flag that specifies the type of error.
 * @param counterType                          Flag that specifies the counter-type of the errors. 
 * @param locationType                         Specifies the location of the counter. 
 * @param count                                Reference in which to return the ECC counter
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a count has been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device, \a bitTyp,e \a counterType or \a locationType is
 *                                             invalid, or \a count is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support ECC error reporting in the specified memory
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetMemoryErrorCounter(nvmlDevice_st device, @Cast("nvmlMemoryErrorType_t") int errorType,
                                                   @Cast("nvmlEccCounterType_t") int counterType,
                                                   @Cast("nvmlMemoryLocation_t") int locationType, @Cast("unsigned long long*") LongPointer count);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetMemoryErrorCounter(nvmlDevice_st device, @Cast("nvmlMemoryErrorType_t") int errorType,
                                                   @Cast("nvmlEccCounterType_t") int counterType,
                                                   @Cast("nvmlMemoryLocation_t") int locationType, @Cast("unsigned long long*") LongBuffer count);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetMemoryErrorCounter(nvmlDevice_st device, @Cast("nvmlMemoryErrorType_t") int errorType,
                                                   @Cast("nvmlEccCounterType_t") int counterType,
                                                   @Cast("nvmlMemoryLocation_t") int locationType, @Cast("unsigned long long*") long[] count);

/**
 * Retrieves the current utilization rates for the device's major subsystems.
 *
 * For Fermi &tm; or newer fully supported devices.
 *
 * See \ref nvmlUtilization_t for details on available utilization rates.
 *
 * \note During driver initialization when ECC is enabled one can see high GPU and Memory Utilization readings.
 *       This is caused by ECC Memory Scrubbing mechanism that is performed during driver initialization.
 *
 * @param device                               The identifier of the target device
 * @param utilization                          Reference in which to return the utilization information
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a utilization has been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a utilization is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetUtilizationRates(nvmlDevice_st device, nvmlUtilization_t utilization);

/**
 * Retrieves the current utilization and sampling size in microseconds for the Encoder
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param utilization                          Reference to an unsigned int for encoder utilization info
 * @param samplingPeriodUs                     Reference to an unsigned int for the sampling period in US
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a utilization has been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, \a utilization is NULL, or \a samplingPeriodUs is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetEncoderUtilization(nvmlDevice_st device, @Cast("unsigned int*") IntPointer utilization, @Cast("unsigned int*") IntPointer samplingPeriodUs);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetEncoderUtilization(nvmlDevice_st device, @Cast("unsigned int*") IntBuffer utilization, @Cast("unsigned int*") IntBuffer samplingPeriodUs);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetEncoderUtilization(nvmlDevice_st device, @Cast("unsigned int*") int[] utilization, @Cast("unsigned int*") int[] samplingPeriodUs);

/**
 * Retrieves the current capacity of the device's encoder, as a percentage of maximum encoder capacity with valid values in the range 0-100.
 *
 * For Maxwell &tm; or newer fully supported devices.
 *
 * @param device                            The identifier of the target device
 * @param encoderQueryType                  Type of encoder to query
 * @param encoderCapacity                   Reference to an unsigned int for the encoder capacity
 * 
 * @return
 *         - \ref NVML_SUCCESS                  if \a encoderCapacity is fetched
 *         - \ref NVML_ERROR_UNINITIALIZED      if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT   if \a encoderCapacity is NULL, or \a device or \a encoderQueryType
 *                                              are invalid
 *         - \ref NVML_ERROR_NOT_SUPPORTED      if device does not support the encoder specified in \a encodeQueryType
 *         - \ref NVML_ERROR_GPU_IS_LOST        if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN            on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetEncoderCapacity(nvmlDevice_st device, @Cast("nvmlEncoderType_t") int encoderQueryType, @Cast("unsigned int*") IntPointer encoderCapacity);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetEncoderCapacity(nvmlDevice_st device, @Cast("nvmlEncoderType_t") int encoderQueryType, @Cast("unsigned int*") IntBuffer encoderCapacity);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetEncoderCapacity(nvmlDevice_st device, @Cast("nvmlEncoderType_t") int encoderQueryType, @Cast("unsigned int*") int[] encoderCapacity);

/**
 * Retrieves the current encoder statistics for a given device.
 *
 * For Maxwell &tm; or newer fully supported devices.
 *
 * @param device                            The identifier of the target device
 * @param sessionCount                      Reference to an unsigned int for count of active encoder sessions
 * @param averageFps                        Reference to an unsigned int for trailing average FPS of all active sessions
 * @param averageLatency                    Reference to an unsigned int for encode latency in microseconds
 * 
 * @return
 *         - \ref NVML_SUCCESS                  if \a sessionCount, \a averageFps and \a averageLatency is fetched
 *         - \ref NVML_ERROR_UNINITIALIZED      if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT   if \a sessionCount, or \a device or \a averageFps,
 *                                              or \a averageLatency is NULL
 *         - \ref NVML_ERROR_GPU_IS_LOST        if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN            on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetEncoderStats(nvmlDevice_st device, @Cast("unsigned int*") IntPointer sessionCount,
                                                @Cast("unsigned int*") IntPointer averageFps, @Cast("unsigned int*") IntPointer averageLatency);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetEncoderStats(nvmlDevice_st device, @Cast("unsigned int*") IntBuffer sessionCount,
                                                @Cast("unsigned int*") IntBuffer averageFps, @Cast("unsigned int*") IntBuffer averageLatency);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetEncoderStats(nvmlDevice_st device, @Cast("unsigned int*") int[] sessionCount,
                                                @Cast("unsigned int*") int[] averageFps, @Cast("unsigned int*") int[] averageLatency);

/**
 * Retrieves information about active encoder sessions on a target device.
 *
 * An array of active encoder sessions is returned in the caller-supplied buffer pointed at by \a sessionInfos. The
 * array elememt count is passed in \a sessionCount, and \a sessionCount is used to return the number of sessions
 * written to the buffer.
 *
 * If the supplied buffer is not large enough to accomodate the active session array, the function returns
 * NVML_ERROR_INSUFFICIENT_SIZE, with the element count of nvmlEncoderSessionInfo_t array required in \a sessionCount.
 * To query the number of active encoder sessions, call this function with *sessionCount = 0.  The code will return
 * NVML_SUCCESS with number of active encoder sessions updated in *sessionCount.
 *
 * For Maxwell &tm; or newer fully supported devices.
 *
 * @param device                            The identifier of the target device
 * @param sessionCount                      Reference to caller supplied array size, and returns the number of sessions.
 * @param sessionInfos                      Reference in which to return the session information
 * 
 * @return
 *         - \ref NVML_SUCCESS                  if \a sessionInfos is fetched
 *         - \ref NVML_ERROR_UNINITIALIZED      if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE  if \a sessionCount is too small, array element count is returned in \a sessionCount
 *         - \ref NVML_ERROR_INVALID_ARGUMENT   if \a sessionCount is NULL.
 *         - \ref NVML_ERROR_GPU_IS_LOST        if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN            on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetEncoderSessions(nvmlDevice_st device, @Cast("unsigned int*") IntPointer sessionCount, nvmlEncoderSessionInfo_t sessionInfos);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetEncoderSessions(nvmlDevice_st device, @Cast("unsigned int*") IntBuffer sessionCount, nvmlEncoderSessionInfo_t sessionInfos);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetEncoderSessions(nvmlDevice_st device, @Cast("unsigned int*") int[] sessionCount, nvmlEncoderSessionInfo_t sessionInfos);

/**
 * Retrieves the current utilization and sampling size in microseconds for the Decoder
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param utilization                          Reference to an unsigned int for decoder utilization info
 * @param samplingPeriodUs                     Reference to an unsigned int for the sampling period in US
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a utilization has been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, \a utilization is NULL, or \a samplingPeriodUs is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetDecoderUtilization(nvmlDevice_st device, @Cast("unsigned int*") IntPointer utilization, @Cast("unsigned int*") IntPointer samplingPeriodUs);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetDecoderUtilization(nvmlDevice_st device, @Cast("unsigned int*") IntBuffer utilization, @Cast("unsigned int*") IntBuffer samplingPeriodUs);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetDecoderUtilization(nvmlDevice_st device, @Cast("unsigned int*") int[] utilization, @Cast("unsigned int*") int[] samplingPeriodUs);

/**
* Retrieves the active frame buffer capture sessions statistics for a given device.
*
* For Maxwell &tm; or newer fully supported devices.
*
* @param device                            The identifier of the target device
* @param fbcStats                          Reference to nvmlFBCStats_t structure contianing NvFBC stats
*
* @return
*         - \ref NVML_SUCCESS                  if \a fbcStats is fetched
*         - \ref NVML_ERROR_UNINITIALIZED      if the library has not been successfully initialized
*         - \ref NVML_ERROR_INVALID_ARGUMENT   if \a fbcStats is NULL
*         - \ref NVML_ERROR_GPU_IS_LOST        if the target GPU has fallen off the bus or is otherwise inaccessible
*         - \ref NVML_ERROR_UNKNOWN            on any unexpected error
*/
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetFBCStats(nvmlDevice_st device, nvmlFBCStats_t fbcStats);

/**
* Retrieves information about active frame buffer capture sessions on a target device.
*
* An array of active encoder sessions is returned in the caller-supplied buffer pointed at by \a sessionInfo. The
* array elememt count is passed in \a sessionCount, and \a sessionCount is used to return the number of sessions
* written to the buffer.
*
* If the supplied buffer is not large enough to accomodate the active session array, the function returns
* NVML_ERROR_INSUFFICIENT_SIZE, with the element count of nvmlFBCSessionInfo_t array required in \a sessionCount.
* To query the number of active FBC sessions, call this function with *sessionCount = 0.  The code will return
* NVML_SUCCESS with number of active FBC sessions updated in *sessionCount.
*
* For Maxwell &tm; or newer fully supported devices.
*
* \note hResolution, vResolution, averageFPS and averageLatency data for a FBC session returned in \a sessionInfo may
*       be zero if there are no new frames captured since the session started.
*
* @param device                            The identifier of the target device
* @param sessionCount                      Reference to caller supplied array size, and returns the number of sessions.
* @param sessionInfo                       Reference in which to return the session information
*
* @return
*         - \ref NVML_SUCCESS                  if \a sessionInfo is fetched
*         - \ref NVML_ERROR_UNINITIALIZED      if the library has not been successfully initialized
*         - \ref NVML_ERROR_INSUFFICIENT_SIZE  if \a sessionCount is too small, array element count is returned in \a sessionCount
*         - \ref NVML_ERROR_INVALID_ARGUMENT   if \a sessionCount is NULL.
*         - \ref NVML_ERROR_GPU_IS_LOST        if the target GPU has fallen off the bus or is otherwise inaccessible
*         - \ref NVML_ERROR_UNKNOWN            on any unexpected error
*/
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetFBCSessions(nvmlDevice_st device, @Cast("unsigned int*") IntPointer sessionCount, nvmlFBCSessionInfo_t sessionInfo);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetFBCSessions(nvmlDevice_st device, @Cast("unsigned int*") IntBuffer sessionCount, nvmlFBCSessionInfo_t sessionInfo);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetFBCSessions(nvmlDevice_st device, @Cast("unsigned int*") int[] sessionCount, nvmlFBCSessionInfo_t sessionInfo);

/**
 * Retrieves the current and pending driver model for the device.
 *
 * For Fermi &tm; or newer fully supported devices.
 * For windows only.
 *
 * On Windows platforms the device driver can run in either WDDM or WDM (TCC) mode. If a display is attached
 * to the device it must run in WDDM mode. TCC mode is preferred if a display is not attached.
 *
 * See \ref nvmlDriverModel_t for details on available driver models.
 *
 * @param device                               The identifier of the target device
 * @param current                              Reference in which to return the current driver model
 * @param pending                              Reference in which to return the pending driver model
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if either \a current and/or \a pending have been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or both \a current and \a pending are NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the platform is not windows
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 * 
 * @see nvmlDeviceSetDriverModel()
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetDriverModel(nvmlDevice_st device, @Cast("nvmlDriverModel_t*") IntPointer current, @Cast("nvmlDriverModel_t*") IntPointer pending);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetDriverModel(nvmlDevice_st device, @Cast("nvmlDriverModel_t*") IntBuffer current, @Cast("nvmlDriverModel_t*") IntBuffer pending);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetDriverModel(nvmlDevice_st device, @Cast("nvmlDriverModel_t*") int[] current, @Cast("nvmlDriverModel_t*") int[] pending);

/**
 * Get VBIOS version of the device.
 *
 * For all products.
 *
 * The VBIOS version may change from time to time. It will not exceed 32 characters in length 
 * (including the NULL terminator).  See \ref nvmlConstants::NVML_DEVICE_VBIOS_VERSION_BUFFER_SIZE.
 *
 * @param device                               The identifier of the target device
 * @param version                              Reference to which to return the VBIOS version
 * @param length                               The maximum allowed length of the string returned in \a version
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a version has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, or \a version is NULL
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small 
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetVbiosVersion(nvmlDevice_st device, @Cast("char*") BytePointer version, @Cast("unsigned int") int length);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetVbiosVersion(nvmlDevice_st device, @Cast("char*") ByteBuffer version, @Cast("unsigned int") int length);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetVbiosVersion(nvmlDevice_st device, @Cast("char*") byte[] version, @Cast("unsigned int") int length);

/**
 * Get Bridge Chip Information for all the bridge chips on the board.
 * 
 * For all fully supported products.
 * Only applicable to multi-GPU products.
 * 
 * @param device                                The identifier of the target device
 * @param bridgeHierarchy                       Reference to the returned bridge chip Hierarchy
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if bridge chip exists
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, or \a bridgeInfo is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if bridge chip not supported on the device
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 * 
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetBridgeChipInfo(nvmlDevice_st device, nvmlBridgeChipHierarchy_t bridgeHierarchy);

/**
 * Get information about processes with a compute context on a device
 *
 * For Fermi &tm; or newer fully supported devices.
 *
 * This function returns information only about compute running processes (e.g. CUDA application which have
 * active context). Any graphics applications (e.g. using OpenGL, DirectX) won't be listed by this function.
 *
 * To query the current number of running compute processes, call this function with *infoCount = 0. The
 * return code will be NVML_ERROR_INSUFFICIENT_SIZE, or NVML_SUCCESS if none are running. For this call
 * \a infos is allowed to be NULL.
 *
 * The usedGpuMemory field returned is all of the memory used by the application.
 *
 * Keep in mind that information returned by this call is dynamic and the number of elements might change in
 * time. Allocate more space for \a infos table in case new compute processes are spawned.
 *
 * @param device                               The identifier of the target device
 * @param infoCount                            Reference in which to provide the \a infos array size, and
 *                                             to return the number of returned elements
 * @param infos                                Reference in which to return the process information
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a infoCount and \a infos have been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a infoCount indicates that the \a infos array is too small
 *                                             \a infoCount will contain minimal amount of space necessary for
 *                                             the call to complete
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, either of \a infoCount or \a infos is NULL
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see \ref nvmlSystemGetProcessName
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetComputeRunningProcesses(nvmlDevice_st device, @Cast("unsigned int*") IntPointer infoCount, nvmlProcessInfo_t infos);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetComputeRunningProcesses(nvmlDevice_st device, @Cast("unsigned int*") IntBuffer infoCount, nvmlProcessInfo_t infos);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetComputeRunningProcesses(nvmlDevice_st device, @Cast("unsigned int*") int[] infoCount, nvmlProcessInfo_t infos);

/**
 * Get information about processes with a graphics context on a device
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * This function returns information only about graphics based processes 
 * (eg. applications using OpenGL, DirectX)
 *
 * To query the current number of running graphics processes, call this function with *infoCount = 0. The
 * return code will be NVML_ERROR_INSUFFICIENT_SIZE, or NVML_SUCCESS if none are running. For this call
 * \a infos is allowed to be NULL.
 *
 * The usedGpuMemory field returned is all of the memory used by the application.
 *
 * Keep in mind that information returned by this call is dynamic and the number of elements might change in
 * time. Allocate more space for \a infos table in case new graphics processes are spawned.
 *
 * @param device                               The identifier of the target device
 * @param infoCount                            Reference in which to provide the \a infos array size, and
 *                                             to return the number of returned elements
 * @param infos                                Reference in which to return the process information
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a infoCount and \a infos have been populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a infoCount indicates that the \a infos array is too small
 *                                             \a infoCount will contain minimal amount of space necessary for
 *                                             the call to complete
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, either of \a infoCount or \a infos is NULL
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see \ref nvmlSystemGetProcessName
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetGraphicsRunningProcesses(nvmlDevice_st device, @Cast("unsigned int*") IntPointer infoCount, nvmlProcessInfo_t infos);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetGraphicsRunningProcesses(nvmlDevice_st device, @Cast("unsigned int*") IntBuffer infoCount, nvmlProcessInfo_t infos);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetGraphicsRunningProcesses(nvmlDevice_st device, @Cast("unsigned int*") int[] infoCount, nvmlProcessInfo_t infos);

/**
 * Check if the GPU devices are on the same physical board.
 *
 * For all fully supported products.
 *
 * @param device1                               The first GPU device
 * @param device2                               The second GPU device
 * @param onSameBoard                           Reference in which to return the status.
 *                                              Non-zero indicates that the GPUs are on the same board.
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a onSameBoard has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a dev1 or \a dev2 are invalid or \a onSameBoard is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if this check is not supported by the device
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the either GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceOnSameBoard(nvmlDevice_st device1, nvmlDevice_st device2, IntPointer onSameBoard);
public static native @Cast("nvmlReturn_t") int nvmlDeviceOnSameBoard(nvmlDevice_st device1, nvmlDevice_st device2, IntBuffer onSameBoard);
public static native @Cast("nvmlReturn_t") int nvmlDeviceOnSameBoard(nvmlDevice_st device1, nvmlDevice_st device2, int[] onSameBoard);

/**
 * Retrieves the root/admin permissions on the target API. See \a nvmlRestrictedAPI_t for the list of supported APIs.
 * If an API is restricted only root users can call that API. See \a nvmlDeviceSetAPIRestriction to change current permissions.
 *
 * For all fully supported products.
 *
 * @param device                               The identifier of the target device
 * @param apiType                              Target API type for this operation
 * @param isRestricted                         Reference in which to return the current restriction 
 *                                             NVML_FEATURE_ENABLED indicates that the API is root-only
 *                                             NVML_FEATURE_DISABLED indicates that the API is accessible to all users
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a isRestricted has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, \a apiType incorrect or \a isRestricted is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if this query is not supported by the device or the device does not support
 *                                                 the feature that is being queried (E.G. Enabling/disabling Auto Boosted clocks is
 *                                                 not supported by the device)
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlRestrictedAPI_t
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetAPIRestriction(nvmlDevice_st device, @Cast("nvmlRestrictedAPI_t") int apiType, @Cast("nvmlEnableState_t*") IntPointer isRestricted);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetAPIRestriction(nvmlDevice_st device, @Cast("nvmlRestrictedAPI_t") int apiType, @Cast("nvmlEnableState_t*") IntBuffer isRestricted);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetAPIRestriction(nvmlDevice_st device, @Cast("nvmlRestrictedAPI_t") int apiType, @Cast("nvmlEnableState_t*") int[] isRestricted);

/**
 * Gets recent samples for the GPU.
 * 
 * For Kepler &tm; or newer fully supported devices.
 * 
 * Based on type, this method can be used to fetch the power, utilization or clock samples maintained in the buffer by 
 * the driver.
 * 
 * Power, Utilization and Clock samples are returned as type "unsigned int" for the union nvmlValue_t.
 * 
 * To get the size of samples that user needs to allocate, the method is invoked with samples set to NULL. 
 * The returned samplesCount will provide the number of samples that can be queried. The user needs to 
 * allocate the buffer with size as samplesCount * sizeof(nvmlSample_t).
 * 
 * lastSeenTimeStamp represents CPU timestamp in microseconds. Set it to 0 to fetch all the samples maintained by the 
 * underlying buffer. Set lastSeenTimeStamp to one of the timeStamps retrieved from the date of the previous query 
 * to get more recent samples.
 * 
 * This method fetches the number of entries which can be accommodated in the provided samples array, and the 
 * reference samplesCount is updated to indicate how many samples were actually retrieved. The advantage of using this 
 * method for samples in contrast to polling via existing methods is to get get higher frequency data at lower polling cost.
 * 
 * @param device                        The identifier for the target device
 * @param type                          Type of sampling event
 * @param lastSeenTimeStamp             Return only samples with timestamp greater than lastSeenTimeStamp. 
 * @param sampleValType                 Output parameter to represent the type of sample value as described in nvmlSampleVal_t
 * @param sampleCount                   Reference to provide the number of elements which can be queried in samples array
 * @param samples                       Reference in which samples are returned
 
 * @return 
 *         - \ref NVML_SUCCESS                 if samples are successfully retrieved
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, \a samplesCount is NULL or 
 *                                             reference to \a sampleCount is 0 for non null \a samples
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if this query is not supported by the device
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_NOT_FOUND         if sample entries are not found
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetSamples(nvmlDevice_st device, @Cast("nvmlSamplingType_t") int type, @Cast("unsigned long long") long lastSeenTimeStamp,
        @Cast("nvmlValueType_t*") IntPointer sampleValType, @Cast("unsigned int*") IntPointer sampleCount, nvmlSample_t samples);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetSamples(nvmlDevice_st device, @Cast("nvmlSamplingType_t") int type, @Cast("unsigned long long") long lastSeenTimeStamp,
        @Cast("nvmlValueType_t*") IntBuffer sampleValType, @Cast("unsigned int*") IntBuffer sampleCount, nvmlSample_t samples);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetSamples(nvmlDevice_st device, @Cast("nvmlSamplingType_t") int type, @Cast("unsigned long long") long lastSeenTimeStamp,
        @Cast("nvmlValueType_t*") int[] sampleValType, @Cast("unsigned int*") int[] sampleCount, nvmlSample_t samples);

/**
 * Gets Total, Available and Used size of BAR1 memory.
 * 
 * BAR1 is used to map the FB (device memory) so that it can be directly accessed by the CPU or by 3rd party 
 * devices (peer-to-peer on the PCIE bus). 
 * 
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param bar1Memory                           Reference in which BAR1 memory
 *                                             information is returned.
 *
 * @return
 *         - \ref NVML_SUCCESS                 if BAR1 memory is successfully retrieved
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, \a bar1Memory is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if this query is not supported by the device
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetBAR1MemoryInfo(nvmlDevice_st device, nvmlBAR1Memory_t bar1Memory);


/**
 * Gets the duration of time during which the device was throttled (lower than requested clocks) due to power 
 * or thermal constraints.
 *
 * The method is important to users who are tying to understand if their GPUs throttle at any point during their applications. The
 * difference in violation times at two different reference times gives the indication of GPU throttling event. 
 *
 * Violation for thermal capping is not supported at this time.
 * 
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param perfPolicyType                       Represents Performance policy which can trigger GPU throttling
 * @param violTime                             Reference to which violation time related information is returned 
 *                                         
 *
 * @return
 *         - \ref NVML_SUCCESS                 if violation time is successfully retrieved
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, \a perfPolicyType is invalid, or \a violTime is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if this query is not supported by the device
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetViolationStatus(nvmlDevice_st device, @Cast("nvmlPerfPolicyType_t") int perfPolicyType, nvmlViolationTime_t violTime);

/**
 * \}
 */

/** \addtogroup nvmlAccountingStats
 *  \{
 */

/**
 * Queries the state of per process accounting mode.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * See \ref nvmlDeviceGetAccountingStats for more details.
 * See \ref nvmlDeviceSetAccountingMode
 *
 * @param device                               The identifier of the target device
 * @param mode                                 Reference in which to return the current accounting mode
 *
 * @return 
 *         - \ref NVML_SUCCESS                 if the mode has been successfully retrieved 
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a mode are NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device doesn't support this feature
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetAccountingMode(nvmlDevice_st device, @Cast("nvmlEnableState_t*") IntPointer mode);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetAccountingMode(nvmlDevice_st device, @Cast("nvmlEnableState_t*") IntBuffer mode);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetAccountingMode(nvmlDevice_st device, @Cast("nvmlEnableState_t*") int[] mode);

/**
 * Queries process's accounting stats.
 *
 * For Kepler &tm; or newer fully supported devices.
 * 
 * Accounting stats capture GPU utilization and other statistics across the lifetime of a process.
 * Accounting stats can be queried during life time of the process and after its termination.
 * The time field in \ref nvmlAccountingStats_t is reported as 0 during the lifetime of the process and 
 * updated to actual running time after its termination.
 * Accounting stats are kept in a circular buffer, newly created processes overwrite information about old
 * processes.
 *
 * See \ref nvmlAccountingStats_t for description of each returned metric.
 * List of processes that can be queried can be retrieved from \ref nvmlDeviceGetAccountingPids.
 *
 * \note Accounting Mode needs to be on. See \ref nvmlDeviceGetAccountingMode.
 * \note Only compute and graphics applications stats can be queried. Monitoring applications stats can't be
 *         queried since they don't contribute to GPU utilization.
 * \note In case of pid collision stats of only the latest process (that terminated last) will be reported
 *
 * \warning On Kepler devices per process statistics are accurate only if there's one process running on a GPU.
 * 
 * @param device                               The identifier of the target device
 * @param pid                                  Process Id of the target process to query stats for
 * @param stats                                Reference in which to return the process's accounting stats
 *
 * @return 
 *         - \ref NVML_SUCCESS                 if stats have been successfully retrieved
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a stats are NULL
 *         - \ref NVML_ERROR_NOT_FOUND         if process stats were not found
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device doesn't support this feature or accounting mode is disabled
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlDeviceGetAccountingBufferSize
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetAccountingStats(nvmlDevice_st device, @Cast("unsigned int") int pid, nvmlAccountingStats_t stats);

/**
 * Queries list of processes that can be queried for accounting stats. The list of processes returned 
 * can be in running or terminated state.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * To just query the number of processes ready to be queried, call this function with *count = 0 and
 * pids=NULL. The return code will be NVML_ERROR_INSUFFICIENT_SIZE, or NVML_SUCCESS if list is empty.
 * 
 * For more details see \ref nvmlDeviceGetAccountingStats.
 *
 * \note In case of PID collision some processes might not be accessible before the circular buffer is full.
 *
 * @param device                               The identifier of the target device
 * @param count                                Reference in which to provide the \a pids array size, and
 *                                               to return the number of elements ready to be queried
 * @param pids                                 Reference in which to return list of process ids
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if pids were successfully retrieved
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a count is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device doesn't support this feature or accounting mode is disabled
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a count is too small (\a count is set to
 *                                                 expected value)
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlDeviceGetAccountingBufferSize
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetAccountingPids(nvmlDevice_st device, @Cast("unsigned int*") IntPointer count, @Cast("unsigned int*") IntPointer pids);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetAccountingPids(nvmlDevice_st device, @Cast("unsigned int*") IntBuffer count, @Cast("unsigned int*") IntBuffer pids);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetAccountingPids(nvmlDevice_st device, @Cast("unsigned int*") int[] count, @Cast("unsigned int*") int[] pids);

/**
 * Returns the number of processes that the circular buffer with accounting pids can hold.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * This is the maximum number of processes that accounting information will be stored for before information
 * about oldest processes will get overwritten by information about new processes.
 *
 * @param device                               The identifier of the target device
 * @param bufferSize                           Reference in which to provide the size (in number of elements)
 *                                               of the circular buffer for accounting stats.
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if buffer size was successfully retrieved
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a bufferSize is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device doesn't support this feature or accounting mode is disabled
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 * 
 * @see nvmlDeviceGetAccountingStats
 * @see nvmlDeviceGetAccountingPids
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetAccountingBufferSize(nvmlDevice_st device, @Cast("unsigned int*") IntPointer bufferSize);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetAccountingBufferSize(nvmlDevice_st device, @Cast("unsigned int*") IntBuffer bufferSize);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetAccountingBufferSize(nvmlDevice_st device, @Cast("unsigned int*") int[] bufferSize);

/** \} */

/** \addtogroup nvmlDeviceQueries
 *  \{
 */

/**
 * Returns the list of retired pages by source, including pages that are pending retirement
 * The address information provided from this API is the hardware address of the page that was retired.  Note
 * that this does not match the virtual address used in CUDA, but will match the address information in XID 63
 * 
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param device                            The identifier of the target device
 * @param cause                             Filter page addresses by cause of retirement
 * @param pageCount                         Reference in which to provide the \a addresses buffer size, and
 *                                          to return the number of retired pages that match \a cause
 *                                          Set to 0 to query the size without allocating an \a addresses buffer
 * @param addresses                         Buffer to write the page addresses into
 * 
 * @return
 *         - \ref NVML_SUCCESS                 if \a pageCount was populated and \a addresses was filled
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a pageCount indicates the buffer is not large enough to store all the
 *                                             matching page addresses.  \a pageCount is set to the needed size.
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, \a pageCount is NULL, \a cause is invalid, or 
 *                                             \a addresses is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device doesn't support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetRetiredPages(nvmlDevice_st device, @Cast("nvmlPageRetirementCause_t") int cause,
    @Cast("unsigned int*") IntPointer pageCount, @Cast("unsigned long long*") LongPointer addresses);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetRetiredPages(nvmlDevice_st device, @Cast("nvmlPageRetirementCause_t") int cause,
    @Cast("unsigned int*") IntBuffer pageCount, @Cast("unsigned long long*") LongBuffer addresses);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetRetiredPages(nvmlDevice_st device, @Cast("nvmlPageRetirementCause_t") int cause,
    @Cast("unsigned int*") int[] pageCount, @Cast("unsigned long long*") long[] addresses);

/**
 * Returns the list of retired pages by source, including pages that are pending retirement
 * The address information provided from this API is the hardware address of the page that was retired.  Note
 * that this does not match the virtual address used in CUDA, but will match the address information in XID 63
 *
 * \note nvmlDeviceGetRetiredPages_v2 adds an additional timestamps paramter to return the time of each page's
 *       retirement.
 * 
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param device                            The identifier of the target device
 * @param cause                             Filter page addresses by cause of retirement
 * @param pageCount                         Reference in which to provide the \a addresses buffer size, and
 *                                          to return the number of retired pages that match \a cause
 *                                          Set to 0 to query the size without allocating an \a addresses buffer
 * @param addresses                         Buffer to write the page addresses into
 * @param timestamps                        Buffer to write the timestamps of page retirement, additional for _v2
 * 
 * @return
 *         - \ref NVML_SUCCESS                 if \a pageCount was populated and \a addresses was filled
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a pageCount indicates the buffer is not large enough to store all the
 *                                             matching page addresses.  \a pageCount is set to the needed size.
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, \a pageCount is NULL, \a cause is invalid, or 
 *                                             \a addresses is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device doesn't support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetRetiredPages_v2(nvmlDevice_st device, @Cast("nvmlPageRetirementCause_t") int cause,
    @Cast("unsigned int*") IntPointer pageCount, @Cast("unsigned long long*") LongPointer addresses, @Cast("unsigned long long*") LongPointer timestamps);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetRetiredPages_v2(nvmlDevice_st device, @Cast("nvmlPageRetirementCause_t") int cause,
    @Cast("unsigned int*") IntBuffer pageCount, @Cast("unsigned long long*") LongBuffer addresses, @Cast("unsigned long long*") LongBuffer timestamps);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetRetiredPages_v2(nvmlDevice_st device, @Cast("nvmlPageRetirementCause_t") int cause,
    @Cast("unsigned int*") int[] pageCount, @Cast("unsigned long long*") long[] addresses, @Cast("unsigned long long*") long[] timestamps);

/**
 * Check if any pages are pending retirement and need a reboot to fully retire.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param device                            The identifier of the target device
 * @param isPending                         Reference in which to return the pending status
 * 
 * @return
 *         - \ref NVML_SUCCESS                 if \a isPending was populated
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a isPending is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device doesn't support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetRetiredPagesPendingStatus(nvmlDevice_st device, @Cast("nvmlEnableState_t*") IntPointer isPending);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetRetiredPagesPendingStatus(nvmlDevice_st device, @Cast("nvmlEnableState_t*") IntBuffer isPending);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetRetiredPagesPendingStatus(nvmlDevice_st device, @Cast("nvmlEnableState_t*") int[] isPending);

/** \} */

/***************************************************************************************************/
/** \defgroup nvmlUnitCommands Unit Commands
 *  This chapter describes NVML operations that change the state of the unit. For S-class products.
 *  Each of these requires root/admin access. Non-admin users will see an NVML_ERROR_NO_PERMISSION
 *  error code when invoking any of these methods.
 *  \{
 */
/***************************************************************************************************/

/**
 * Set the LED state for the unit. The LED can be either green (0) or amber (1).
 *
 * For S-class products.
 * Requires root/admin permissions.
 *
 * This operation takes effect immediately.
 * 
 *
 * Current S-Class products don't provide unique LEDs for each unit. As such, both front 
 * and back LEDs will be toggled in unison regardless of which unit is specified with this command.
 *
 * See \ref nvmlLedColor_t for available colors.
 *
 * @param unit                                 The identifier of the target unit
 * @param color                                The target LED color
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if the LED color has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a unit or \a color is invalid
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if this is not an S-class product
 *         - \ref NVML_ERROR_NO_PERMISSION     if the user doesn't have permission to perform this operation
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 * 
 * @see nvmlUnitGetLedState()
 */
public static native @Cast("nvmlReturn_t") int nvmlUnitSetLedState(nvmlUnit_st unit, @Cast("nvmlLedColor_t") int color);

/** \} */

/***************************************************************************************************/
/** \defgroup nvmlDeviceCommands Device Commands
 *  This chapter describes NVML operations that change the state of the device.
 *  Each of these requires root/admin access. Non-admin users will see an NVML_ERROR_NO_PERMISSION
 *  error code when invoking any of these methods.
 *  \{
 */
/***************************************************************************************************/

/**
 * Set the persistence mode for the device.
 *
 * For all products.
 * For Linux only.
 * Requires root/admin permissions.
 *
 * The persistence mode determines whether the GPU driver software is torn down after the last client
 * exits.
 *
 * This operation takes effect immediately. It is not persistent across reboots. After each reboot the
 * persistence mode is reset to "Disabled".
 *
 * See \ref nvmlEnableState_t for available modes.
 *
 * @param device                               The identifier of the target device
 * @param mode                                 The target persistence mode
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if the persistence mode was set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a mode is invalid
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_NO_PERMISSION     if the user doesn't have permission to perform this operation
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlDeviceGetPersistenceMode()
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceSetPersistenceMode(nvmlDevice_st device, @Cast("nvmlEnableState_t") int mode);

/**
 * Set the compute mode for the device.
 *
 * For all products.
 * Requires root/admin permissions.
 *
 * The compute mode determines whether a GPU can be used for compute operations and whether it can
 * be shared across contexts.
 *
 * This operation takes effect immediately. Under Linux it is not persistent across reboots and
 * always resets to "Default". Under windows it is persistent.
 *
 * Under windows compute mode may only be set to DEFAULT when running in WDDM
 *
 * See \ref nvmlComputeMode_t for details on available compute modes.
 *
 * @param device                               The identifier of the target device
 * @param mode                                 The target compute mode
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if the compute mode was set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a mode is invalid
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_NO_PERMISSION     if the user doesn't have permission to perform this operation
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlDeviceGetComputeMode()
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceSetComputeMode(nvmlDevice_st device, @Cast("nvmlComputeMode_t") int mode);

/**
 * Set the ECC mode for the device.
 *
 * For Kepler &tm; or newer fully supported devices.
 * Only applicable to devices with ECC.
 * Requires \a NVML_INFOROM_ECC version 1.0 or higher.
 * Requires root/admin permissions.
 *
 * The ECC mode determines whether the GPU enables its ECC support.
 *
 * This operation takes effect after the next reboot.
 *
 * See \ref nvmlEnableState_t for details on available modes.
 *
 * @param device                               The identifier of the target device
 * @param ecc                                  The target ECC mode
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if the ECC mode was set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a ecc is invalid
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_NO_PERMISSION     if the user doesn't have permission to perform this operation
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlDeviceGetEccMode()
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceSetEccMode(nvmlDevice_st device, @Cast("nvmlEnableState_t") int ecc);  

/**
 * Clear the ECC error and other memory error counts for the device.
 *
 * For Kepler &tm; or newer fully supported devices.
 * Only applicable to devices with ECC.
 * Requires \a NVML_INFOROM_ECC version 2.0 or higher to clear aggregate location-based ECC counts.
 * Requires \a NVML_INFOROM_ECC version 1.0 or higher to clear all other ECC counts.
 * Requires root/admin permissions.
 * Requires ECC Mode to be enabled.
 *
 * Sets all of the specified ECC counters to 0, including both detailed and total counts.
 *
 * This operation takes effect immediately.
 *
 * See \ref nvmlMemoryErrorType_t for details on available counter types.
 *
 * @param device                               The identifier of the target device
 * @param counterType                          Flag that indicates which type of errors should be cleared.
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if the error counts were cleared
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a counterType is invalid
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_NO_PERMISSION     if the user doesn't have permission to perform this operation
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see 
 *      - nvmlDeviceGetDetailedEccErrors()
 *      - nvmlDeviceGetTotalEccErrors()
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceClearEccErrorCounts(nvmlDevice_st device, @Cast("nvmlEccCounterType_t") int counterType);

/**
 * Set the driver model for the device.
 *
 * For Fermi &tm; or newer fully supported devices.
 * For windows only.
 * Requires root/admin permissions.
 *
 * On Windows platforms the device driver can run in either WDDM or WDM (TCC) mode. If a display is attached
 * to the device it must run in WDDM mode.  
 *
 * It is possible to force the change to WDM (TCC) while the display is still attached with a force flag (nvmlFlagForce).
 * This should only be done if the host is subsequently powered down and the display is detached from the device
 * before the next reboot. 
 *
 * This operation takes effect after the next reboot.
 * 
 * Windows driver model may only be set to WDDM when running in DEFAULT compute mode.
 *
 * Change driver model to WDDM is not supported when GPU doesn't support graphics acceleration or 
 * will not support it after reboot. See \ref nvmlDeviceSetGpuOperationMode.
 *
 * See \ref nvmlDriverModel_t for details on available driver models.
 * See \ref nvmlFlagDefault and \ref nvmlFlagForce
 *
 * @param device                               The identifier of the target device
 * @param driverModel                          The target driver model
 * @param flags                                Flags that change the default behavior
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if the driver model has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a driverModel is invalid
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the platform is not windows or the device does not support this feature
 *         - \ref NVML_ERROR_NO_PERMISSION     if the user doesn't have permission to perform this operation
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 * 
 * @see nvmlDeviceGetDriverModel()
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceSetDriverModel(nvmlDevice_st device, @Cast("nvmlDriverModel_t") int driverModel, @Cast("unsigned int") int flags);

/**
 * Set clocks that device will lock to.
 *
 * Sets the clocks that the device will be running at to the value in the range of minGpuClockMHz to maxGpuClockMHz.
 * Setting this will supercede application clock values and take effect regardless if a cuda app is running.
 * See /ref nvmlDeviceSetApplicationsClocks
 *
 * Can be used as a setting to request constant performance.
 *
 * Requires root/admin permissions.
 *
 * After system reboot or driver reload applications clocks go back to their default value.
 * See \ref nvmlDeviceResetGpuLockedClocks.
 *
 * For newer than Pascal &tm; fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param minGpuClockMHz                       Requested minimum gpu clock in MHz
 * @param maxGpuClockMHz                       Requested maximum gpu clock in MHz
 *
 * @return
 *         - \ref NVML_SUCCESS                 if new settings were successfully set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a minGpuClockMHz and \a maxGpuClockMHz
 *                                                 is not a valid clock combination
 *         - \ref NVML_ERROR_NO_PERMISSION     if the user doesn't have permission to perform this operation
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device doesn't support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceSetGpuLockedClocks(nvmlDevice_st device, @Cast("unsigned int") int minGpuClockMHz, @Cast("unsigned int") int maxGpuClockMHz);

/**
 * Resets the gpu clock to the default value
 *
 * This is the gpu clock that will be used after system reboot or driver reload.
 * Default values are idle clocks, but the current values can be changed using \ref nvmlDeviceSetApplicationsClocks.
 *
 * @see nvmlDeviceSetGpuLockedClocks
 *
 * For newer than Pascal &tm; fully supported devices.
 *
 * @param device                               The identifier of the target device
 *
 * @return
 *         - \ref NVML_SUCCESS                 if new settings were successfully set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceResetGpuLockedClocks(nvmlDevice_st device);

/**
 * Set clocks that applications will lock to.
 *
 * Sets the clocks that compute and graphics applications will be running at.
 * e.g. CUDA driver requests these clocks during context creation which means this property
 * defines clocks at which CUDA applications will be running unless some overspec event
 * occurs (e.g. over power, over thermal or external HW brake).
 *
 * Can be used as a setting to request constant performance.
 *
 * On Pascal and newer hardware, this will automatically disable automatic boosting of clocks.
 *
 * On K80 and newer Kepler and Maxwell GPUs, users desiring fixed performance should also call
 * \ref nvmlDeviceSetAutoBoostedClocksEnabled to prevent clocks from automatically boosting
 * above the clock value being set.
 *
 * For Kepler &tm; or newer non-GeForce fully supported devices and Maxwell or newer GeForce devices.
 * Requires root/admin permissions.
 *
 * See \ref nvmlDeviceGetSupportedMemoryClocks and \ref nvmlDeviceGetSupportedGraphicsClocks
 * for details on how to list available clocks combinations.
 *
 * After system reboot or driver reload applications clocks go back to their default value.
 * See \ref nvmlDeviceResetApplicationsClocks.
 *
 * @param device                               The identifier of the target device
 * @param memClockMHz                          Requested memory clock in MHz
 * @param graphicsClockMHz                     Requested graphics clock in MHz
 *
 * @return
 *         - \ref NVML_SUCCESS                 if new settings were successfully set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a memClockMHz and \a graphicsClockMHz
 *                                                 is not a valid clock combination
 *         - \ref NVML_ERROR_NO_PERMISSION     if the user doesn't have permission to perform this operation
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device doesn't support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceSetApplicationsClocks(nvmlDevice_st device, @Cast("unsigned int") int memClockMHz, @Cast("unsigned int") int graphicsClockMHz);

/**
 * Set new power limit of this device.
 * 
 * For Kepler &tm; or newer fully supported devices.
 * Requires root/admin permissions.
 *
 * See \ref nvmlDeviceGetPowerManagementLimitConstraints to check the allowed ranges of values.
 *
 * \note Limit is not persistent across reboots or driver unloads.
 * Enable persistent mode to prevent driver from unloading when no application is using the device.
 *
 * @param device                               The identifier of the target device
 * @param limit                                Power management limit in milliwatts to set
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a limit has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a defaultLimit is out of range
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support this feature
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlDeviceGetPowerManagementLimitConstraints
 * @see nvmlDeviceGetPowerManagementDefaultLimit
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceSetPowerManagementLimit(nvmlDevice_st device, @Cast("unsigned int") int limit);

/**
 * Sets new GOM. See \a nvmlGpuOperationMode_t for details.
 *
 * For GK110 M-class and X-class Tesla &tm; products from the Kepler family.
 * Modes \ref NVML_GOM_LOW_DP and \ref NVML_GOM_ALL_ON are supported on fully supported GeForce products.
 * Not supported on Quadro ® and Tesla &tm; C-class products.
 * Requires root/admin permissions.
 * 
 * Changing GOMs requires a reboot. 
 * The reboot requirement might be removed in the future.
 *
 * Compute only GOMs don't support graphics acceleration. Under windows switching to these GOMs when
 * pending driver model is WDDM is not supported. See \ref nvmlDeviceSetDriverModel.
 * 
 * @param device                               The identifier of the target device
 * @param mode                                 Target GOM
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if \a mode has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a mode incorrect
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support GOM or specific mode
 *         - \ref NVML_ERROR_NO_PERMISSION     if the user doesn't have permission to perform this operation
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlGpuOperationMode_t
 * @see nvmlDeviceGetGpuOperationMode
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceSetGpuOperationMode(nvmlDevice_st device, @Cast("nvmlGpuOperationMode_t") int mode);

/**
 * Changes the root/admin restructions on certain APIs. See \a nvmlRestrictedAPI_t for the list of supported APIs.
 * This method can be used by a root/admin user to give non-root/admin access to certain otherwise-restricted APIs.
 * The new setting lasts for the lifetime of the NVIDIA driver; it is not persistent. See \a nvmlDeviceGetAPIRestriction
 * to query the current restriction settings.
 * 
 * For Kepler &tm; or newer fully supported devices.
 * Requires root/admin permissions.
 *
 * @param device                               The identifier of the target device
 * @param apiType                              Target API type for this operation
 * @param isRestricted                         The target restriction
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a isRestricted has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a apiType incorrect
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not support changing API restrictions or the device does not support
 *                                                 the feature that api restrictions are being set for (E.G. Enabling/disabling auto 
 *                                                 boosted clocks is not supported by the device)
 *         - \ref NVML_ERROR_NO_PERMISSION     if the user doesn't have permission to perform this operation
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 *
 * @see nvmlRestrictedAPI_t
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceSetAPIRestriction(nvmlDevice_st device, @Cast("nvmlRestrictedAPI_t") int apiType, @Cast("nvmlEnableState_t") int isRestricted);

/**
 * \}
 */
 
/** \addtogroup nvmlAccountingStats
 *  \{
 */

/**
 * Enables or disables per process accounting.
 *
 * For Kepler &tm; or newer fully supported devices.
 * Requires root/admin permissions.
 *
 * \note This setting is not persistent and will default to disabled after driver unloads.
 *       Enable persistence mode to be sure the setting doesn't switch off to disabled.
 * 
 * \note Enabling accounting mode has no negative impact on the GPU performance.
 *
 * \note Disabling accounting clears all accounting pids information.
 *
 * See \ref nvmlDeviceGetAccountingMode
 * See \ref nvmlDeviceGetAccountingStats
 * See \ref nvmlDeviceClearAccountingPids
 *
 * @param device                               The identifier of the target device
 * @param mode                                 The target accounting mode
 *
 * @return 
 *         - \ref NVML_SUCCESS                 if the new mode has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device or \a mode are invalid
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device doesn't support this feature
 *         - \ref NVML_ERROR_NO_PERMISSION     if the user doesn't have permission to perform this operation
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceSetAccountingMode(nvmlDevice_st device, @Cast("nvmlEnableState_t") int mode);

/**
 * Clears accounting information about all processes that have already terminated.
 *
 * For Kepler &tm; or newer fully supported devices.
 * Requires root/admin permissions.
 *
 * See \ref nvmlDeviceGetAccountingMode
 * See \ref nvmlDeviceGetAccountingStats
 * See \ref nvmlDeviceSetAccountingMode
 *
 * @param device                               The identifier of the target device
 *
 * @return 
 *         - \ref NVML_SUCCESS                 if accounting information has been cleared 
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device are invalid
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device doesn't support this feature
 *         - \ref NVML_ERROR_NO_PERMISSION     if the user doesn't have permission to perform this operation
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceClearAccountingPids(nvmlDevice_st device);

/** \} */

/***************************************************************************************************/
/** \defgroup NvLink NvLink Methods
 * This chapter describes methods that NVML can perform on NVLINK enabled devices.
 *  \{
 */
/***************************************************************************************************/

/**
 * Retrieves the state of the device's NvLink for the link specified
 *
 * For Pascal &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param link                                 Specifies the NvLink link to be queried
 * @param isActive                             \a nvmlEnableState_t where NVML_FEATURE_ENABLED indicates that
 *                                             the link is active and NVML_FEATURE_DISABLED indicates it 
 *                                             is inactive
 *
 * @return 
 *         - \ref NVML_SUCCESS                 if \a isActive has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device or \a link is invalid or \a isActive is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device doesn't support this feature
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetNvLinkState(nvmlDevice_st device, @Cast("unsigned int") int link, @Cast("nvmlEnableState_t*") IntPointer isActive);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetNvLinkState(nvmlDevice_st device, @Cast("unsigned int") int link, @Cast("nvmlEnableState_t*") IntBuffer isActive);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetNvLinkState(nvmlDevice_st device, @Cast("unsigned int") int link, @Cast("nvmlEnableState_t*") int[] isActive);

/**
 * Retrieves the version of the device's NvLink for the link specified
 *
 * For Pascal &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param link                                 Specifies the NvLink link to be queried
 * @param version                              Requested NvLink version
 *
 * @return 
 *         - \ref NVML_SUCCESS                 if \a version has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device or \a link is invalid or \a version is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device doesn't support this feature
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetNvLinkVersion(nvmlDevice_st device, @Cast("unsigned int") int link, @Cast("unsigned int*") IntPointer version);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetNvLinkVersion(nvmlDevice_st device, @Cast("unsigned int") int link, @Cast("unsigned int*") IntBuffer version);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetNvLinkVersion(nvmlDevice_st device, @Cast("unsigned int") int link, @Cast("unsigned int*") int[] version);

/**
 * Retrieves the requested capability from the device's NvLink for the link specified
 * Please refer to the \a nvmlNvLinkCapability_t structure for the specific caps that can be queried
 * The return value should be treated as a boolean.
 *
 * For Pascal &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param link                                 Specifies the NvLink link to be queried
 * @param capability                           Specifies the \a nvmlNvLinkCapability_t to be queried
 * @param capResult                            A boolean for the queried capability indicating that feature is available
 *
 * @return 
 *         - \ref NVML_SUCCESS                 if \a capResult has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device, \a link, or \a capability is invalid or \a capResult is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device doesn't support this feature
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetNvLinkCapability(nvmlDevice_st device, @Cast("unsigned int") int link,
                                                   @Cast("nvmlNvLinkCapability_t") int capability, @Cast("unsigned int*") IntPointer capResult);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetNvLinkCapability(nvmlDevice_st device, @Cast("unsigned int") int link,
                                                   @Cast("nvmlNvLinkCapability_t") int capability, @Cast("unsigned int*") IntBuffer capResult);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetNvLinkCapability(nvmlDevice_st device, @Cast("unsigned int") int link,
                                                   @Cast("nvmlNvLinkCapability_t") int capability, @Cast("unsigned int*") int[] capResult); 

/**
 * Retrieves the PCI information for the remote node on a NvLink link 
 * Note: pciSubSystemId is not filled in this function and is indeterminate
 *
 * For Pascal &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param link                                 Specifies the NvLink link to be queried
 * @param pci                                  \a nvmlPciInfo_t of the remote node for the specified link                            
 *
 * @return 
 *         - \ref NVML_SUCCESS                 if \a pci has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device or \a link is invalid or \a pci is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device doesn't support this feature
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetNvLinkRemotePciInfo_v2(nvmlDevice_st device, @Cast("unsigned int") int link, nvmlPciInfo_t pci);

/**
 * Retrieves the specified error counter value
 * Please refer to \a nvmlNvLinkErrorCounter_t for error counters that are available
 *
 * For Pascal &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param link                                 Specifies the NvLink link to be queried
 * @param counter                              Specifies the NvLink counter to be queried
 * @param counterValue                         Returned counter value
 *
 * @return 
 *         - \ref NVML_SUCCESS                 if \a counter has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device, \a link, or \a counter is invalid or \a counterValue is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device doesn't support this feature
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetNvLinkErrorCounter(nvmlDevice_st device, @Cast("unsigned int") int link,
                                                     @Cast("nvmlNvLinkErrorCounter_t") int counter, @Cast("unsigned long long*") LongPointer counterValue);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetNvLinkErrorCounter(nvmlDevice_st device, @Cast("unsigned int") int link,
                                                     @Cast("nvmlNvLinkErrorCounter_t") int counter, @Cast("unsigned long long*") LongBuffer counterValue);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetNvLinkErrorCounter(nvmlDevice_st device, @Cast("unsigned int") int link,
                                                     @Cast("nvmlNvLinkErrorCounter_t") int counter, @Cast("unsigned long long*") long[] counterValue);

/**
 * Resets all error counters to zero
 * Please refer to \a nvmlNvLinkErrorCounter_t for the list of error counters that are reset
 *
 * For Pascal &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param link                                 Specifies the NvLink link to be queried
 *
 * @return 
 *         - \ref NVML_SUCCESS                 if the reset is successful
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device or \a link is invalid
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device doesn't support this feature
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceResetNvLinkErrorCounters(nvmlDevice_st device, @Cast("unsigned int") int link);

/**
 * Set the NVLINK utilization counter control information for the specified counter, 0 or 1.
 * Please refer to \a nvmlNvLinkUtilizationControl_t for the structure definition.  Performs a reset
 * of the counters if the reset parameter is non-zero.
 *
 * For Pascal &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param counter                              Specifies the counter that should be set (0 or 1).
 * @param link                                 Specifies the NvLink link to be queried
 * @param control                              A reference to the \a nvmlNvLinkUtilizationControl_t to set
 * @param reset                                Resets the counters on set if non-zero
 *
 * @return 
 *         - \ref NVML_SUCCESS                 if the control has been set successfully
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device, \a counter, \a link, or \a control is invalid 
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device doesn't support this feature
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceSetNvLinkUtilizationControl(nvmlDevice_st device, @Cast("unsigned int") int link, @Cast("unsigned int") int counter,
                                                           nvmlNvLinkUtilizationControl_t control, @Cast("unsigned int") int reset);

/**
 * Get the NVLINK utilization counter control information for the specified counter, 0 or 1.
 * Please refer to \a nvmlNvLinkUtilizationControl_t for the structure definition
 *
 * For Pascal &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param counter                              Specifies the counter that should be set (0 or 1).
 * @param link                                 Specifies the NvLink link to be queried
 * @param control                              A reference to the \a nvmlNvLinkUtilizationControl_t to place information
 *
 * @return 
 *         - \ref NVML_SUCCESS                 if the control has been set successfully
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device, \a counter, \a link, or \a control is invalid 
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device doesn't support this feature
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetNvLinkUtilizationControl(nvmlDevice_st device, @Cast("unsigned int") int link, @Cast("unsigned int") int counter,
                                                           nvmlNvLinkUtilizationControl_t control);


/**
 * Retrieve the NVLINK utilization counter based on the current control for a specified counter.
 * In general it is good practice to use \a nvmlDeviceSetNvLinkUtilizationControl
 *  before reading the utilization counters as they have no default state
 *
 * For Pascal &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param link                                 Specifies the NvLink link to be queried
 * @param counter                              Specifies the counter that should be read (0 or 1).
 * @param rxcounter                            Receive counter return value
 * @param txcounter                            Transmit counter return value
 *
 * @return 
 *         - \ref NVML_SUCCESS                 if \a rxcounter and \a txcounter have been successfully set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device, \a counter, or \a link is invalid or \a rxcounter or \a txcounter are NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device doesn't support this feature
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetNvLinkUtilizationCounter(nvmlDevice_st device, @Cast("unsigned int") int link, @Cast("unsigned int") int counter, 
                                                           @Cast("unsigned long long*") LongPointer rxcounter, @Cast("unsigned long long*") LongPointer txcounter);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetNvLinkUtilizationCounter(nvmlDevice_st device, @Cast("unsigned int") int link, @Cast("unsigned int") int counter, 
                                                           @Cast("unsigned long long*") LongBuffer rxcounter, @Cast("unsigned long long*") LongBuffer txcounter);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetNvLinkUtilizationCounter(nvmlDevice_st device, @Cast("unsigned int") int link, @Cast("unsigned int") int counter, 
                                                           @Cast("unsigned long long*") long[] rxcounter, @Cast("unsigned long long*") long[] txcounter);

/**
 * Freeze the NVLINK utilization counters 
 * Both the receive and transmit counters are operated on by this function
 *
 * For Pascal &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param link                                 Specifies the NvLink link to be queried
 * @param counter                              Specifies the counter that should be frozen (0 or 1).
 * @param freeze                               NVML_FEATURE_ENABLED = freeze the receive and transmit counters
 *                                             NVML_FEATURE_DISABLED = unfreeze the receive and transmit counters
 *
 * @return 
 *         - \ref NVML_SUCCESS                 if counters were successfully frozen or unfrozen
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device, \a link, \a counter, or \a freeze is invalid
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device doesn't support this feature
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceFreezeNvLinkUtilizationCounter(nvmlDevice_st device, @Cast("unsigned int") int link, 
                                            @Cast("unsigned int") int counter, @Cast("nvmlEnableState_t") int freeze);

/**
 * Reset the NVLINK utilization counters 
 * Both the receive and transmit counters are operated on by this function
 *
 * For Pascal &tm; or newer fully supported devices.
 *
 * @param device                               The identifier of the target device
 * @param link                                 Specifies the NvLink link to be reset
 * @param counter                              Specifies the counter that should be reset (0 or 1)
 *
 * @return 
 *         - \ref NVML_SUCCESS                 if counters were successfully reset
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device, \a link, or \a counter is invalid
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device doesn't support this feature
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceResetNvLinkUtilizationCounter(nvmlDevice_st device, @Cast("unsigned int") int link, @Cast("unsigned int") int counter);

/** \} */

/***************************************************************************************************/
/** \defgroup nvmlEvents Event Handling Methods
 * This chapter describes methods that NVML can perform against each device to register and wait for 
 * some event to occur.
 *  \{
 */
/***************************************************************************************************/

/**
 * Create an empty set of events.
 * Event set should be freed by \ref nvmlEventSetFree
 *
 * For Fermi &tm; or newer fully supported devices.
 * @param set                                  Reference in which to return the event handle
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if the event has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a set is NULL
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 * 
 * @see nvmlEventSetFree
 */
public static native @Cast("nvmlReturn_t") int nvmlEventSetCreate(@ByPtrPtr nvmlEventSet_st set);
public static native @Cast("nvmlReturn_t") int nvmlEventSetCreate(@Cast("nvmlEventSet_st**") PointerPointer set);

/**
 * Starts recording of events on a specified devices and add the events to specified \ref nvmlEventSet_t
 *
 * For Fermi &tm; or newer fully supported devices.
 * Ecc events are available only on ECC enabled devices (see \ref nvmlDeviceGetTotalEccErrors)
 * Power capping events are available only on Power Management enabled devices (see \ref nvmlDeviceGetPowerManagementMode)
 *
 * For Linux only.
 *
 * \b IMPORTANT: Operations on \a set are not thread safe
 *
 * This call starts recording of events on specific device.
 * All events that occurred before this call are not recorded.
 * Checking if some event occurred can be done with \ref nvmlEventSetWait
 *
 * If function reports NVML_ERROR_UNKNOWN, event set is in undefined state and should be freed.
 * If function reports NVML_ERROR_NOT_SUPPORTED, event set can still be used. None of the requested eventTypes
 *     are registered in that case.
 *
 * @param device                               The identifier of the target device
 * @param eventTypes                           Bitmask of \ref nvmlEventType to record
 * @param set                                  Set to which add new event types
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if the event has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a eventTypes is invalid or \a set is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the platform does not support this feature or some of requested event types
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 * 
 * @see nvmlEventType
 * @see nvmlDeviceGetSupportedEventTypes
 * @see nvmlEventSetWait
 * @see nvmlEventSetFree
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceRegisterEvents(nvmlDevice_st device, @Cast("unsigned long long") long eventTypes, nvmlEventSet_st set);

/**
 * Returns information about events supported on device
 *
 * For Fermi &tm; or newer fully supported devices.
 *
 * Events are not supported on Windows. So this function returns an empty mask in \a eventTypes on Windows.
 *
 * @param device                               The identifier of the target device
 * @param eventTypes                           Reference in which to return bitmask of supported events
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if the eventTypes has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a eventType is NULL
 *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 * 
 * @see nvmlEventType
 * @see nvmlDeviceRegisterEvents
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetSupportedEventTypes(nvmlDevice_st device, @Cast("unsigned long long*") LongPointer eventTypes);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetSupportedEventTypes(nvmlDevice_st device, @Cast("unsigned long long*") LongBuffer eventTypes);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetSupportedEventTypes(nvmlDevice_st device, @Cast("unsigned long long*") long[] eventTypes);

/**
 * Waits on events and delivers events
 *
 * For Fermi &tm; or newer fully supported devices.
 *
 * If some events are ready to be delivered at the time of the call, function returns immediately.
 * If there are no events ready to be delivered, function sleeps till event arrives 
 * but not longer than specified timeout. This function in certain conditions can return before
 * specified timeout passes (e.g. when interrupt arrives)
 * 
 * In case of xid error, the function returns the most recent xid error type seen by the system. If there are multiple
 * xid errors generated before nvmlEventSetWait is invoked then the last seen xid error type is returned for all
 * xid error events.
 * 
 * @param set                                  Reference to set of events to wait on
 * @param data                                 Reference in which to return event data
 * @param timeoutms                            Maximum amount of wait time in milliseconds for registered event
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if the data has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a data is NULL
 *         - \ref NVML_ERROR_TIMEOUT           if no event arrived in specified timeout or interrupt arrived
 *         - \ref NVML_ERROR_GPU_IS_LOST       if a GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 * 
 * @see nvmlEventType
 * @see nvmlDeviceRegisterEvents
 */
public static native @Cast("nvmlReturn_t") int nvmlEventSetWait(nvmlEventSet_st set, nvmlEventData_t data, @Cast("unsigned int") int timeoutms);

/**
 * Releases events in the set
 *
 * For Fermi &tm; or newer fully supported devices.
 *
 * @param set                                  Reference to events to be released 
 * 
 * @return 
 *         - \ref NVML_SUCCESS                 if the event has been successfully released
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 * 
 * @see nvmlDeviceRegisterEvents
 */
public static native @Cast("nvmlReturn_t") int nvmlEventSetFree(nvmlEventSet_st set);

/** \} */

/***************************************************************************************************/
/** \defgroup nvmlZPI Drain states 
 * This chapter describes methods that NVML can perform against each device to control their drain state
 * and recognition by NVML and NVIDIA kernel driver. These methods can be used with out-of-band tools to
 * power on/off GPUs, enable robust reset scenarios, etc.
 *  \{
 */
/***************************************************************************************************/

/**
 * Modify the drain state of a GPU.  This method forces a GPU to no longer accept new incoming requests.
 * Any new NVML process will no longer see this GPU.  Persistence mode for this GPU must be turned off before
 * this call is made.
 * Must be called as administrator.
 * For Linux only.
 * 
 * For Pascal &tm; or newer fully supported devices.
 * Some Kepler devices supported.
 *
 * @param pciInfo                              The PCI address of the GPU drain state to be modified
 * @param newState                             The drain state that should be entered, see \ref nvmlEnableState_t
 *
 * @return 
 *         - \ref NVML_SUCCESS                 if counters were successfully reset
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a nvmlIndex or \a newState is invalid
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device doesn't support this feature
 *         - \ref NVML_ERROR_NO_PERMISSION     if the calling process has insufficient permissions to perform operation
 *         - \ref NVML_ERROR_IN_USE            if the device has persistence mode turned on
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceModifyDrainState(nvmlPciInfo_t pciInfo, @Cast("nvmlEnableState_t") int newState);

/**
 * Query the drain state of a GPU.  This method is used to check if a GPU is in a currently draining
 * state.
 * For Linux only.
 * 
 * For Pascal &tm; or newer fully supported devices.
 * Some Kepler devices supported.
 *
 * @param pciInfo                              The PCI address of the GPU drain state to be queried
 * @param currentState                         The current drain state for this GPU, see \ref nvmlEnableState_t
 *
 * @return 
 *         - \ref NVML_SUCCESS                 if counters were successfully reset
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a nvmlIndex or \a currentState is invalid
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device doesn't support this feature
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceQueryDrainState(nvmlPciInfo_t pciInfo, @Cast("nvmlEnableState_t*") IntPointer currentState);
public static native @Cast("nvmlReturn_t") int nvmlDeviceQueryDrainState(nvmlPciInfo_t pciInfo, @Cast("nvmlEnableState_t*") IntBuffer currentState);
public static native @Cast("nvmlReturn_t") int nvmlDeviceQueryDrainState(nvmlPciInfo_t pciInfo, @Cast("nvmlEnableState_t*") int[] currentState);

/**
 * This method will remove the specified GPU from the view of both NVML and the NVIDIA kernel driver
 * as long as no other processes are attached. If other processes are attached, this call will return
 * NVML_ERROR_IN_USE and the GPU will be returned to its original "draining" state. Note: the
 * only situation where a process can still be attached after nvmlDeviceModifyDrainState() is called
 * to initiate the draining state is if that process was using, and is still using, a GPU before the 
 * call was made. Also note, persistence mode counts as an attachment to the GPU thus it must be disabled
 * prior to this call.
 *
 * For long-running NVML processes please note that this will change the enumeration of current GPUs.
 * For example, if there are four GPUs present and GPU1 is removed, the new enumeration will be 0-2.
 * Also, device handles after the removed GPU will not be valid and must be re-established.
 * Must be run as administrator. 
 * For Linux only.
 *
 * For Pascal &tm; or newer fully supported devices.
 * Some Kepler devices supported.
 *
 * @param pciInfo                              The PCI address of the GPU to be removed
 * @param gpuState                             Whether the GPU is to be removed, from the OS
 *                                             see \ref nvmlDetachGpuState_t
 * @param linkState                            Requested upstream PCIe link state, see \ref nvmlPcieLinkState_t
 *
 * @return
 *         - \ref NVML_SUCCESS                 if counters were successfully reset
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a nvmlIndex is invalid
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device doesn't support this feature
 *         - \ref NVML_ERROR_IN_USE            if the device is still in use and cannot be removed
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceRemoveGpu_v2(nvmlPciInfo_t pciInfo, @Cast("nvmlDetachGpuState_t") int gpuState, @Cast("nvmlPcieLinkState_t") int linkState);

/**
 * Request the OS and the NVIDIA kernel driver to rediscover a portion of the PCI subsystem looking for GPUs that
 * were previously removed. The portion of the PCI tree can be narrowed by specifying a domain, bus, and device.  
 * If all are zeroes then the entire PCI tree will be searched.  Please note that for long-running NVML processes
 * the enumeration will change based on how many GPUs are discovered and where they are inserted in bus order.
 *
 * In addition, all newly discovered GPUs will be initialized and their ECC scrubbed which may take several seconds
 * per GPU. Also, all device handles are no longer guaranteed to be valid post discovery.
 *
 * Must be run as administrator.
 * For Linux only.
 * 
 * For Pascal &tm; or newer fully supported devices.
 * Some Kepler devices supported.
 *
 * @param pciInfo                              The PCI tree to be searched.  Only the domain, bus, and device
 *                                             fields are used in this call.
 *
 * @return 
 *         - \ref NVML_SUCCESS                 if counters were successfully reset
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a pciInfo is invalid
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if the operating system does not support this feature
 *         - \ref NVML_ERROR_OPERATING_SYSTEM  if the operating system is denying this feature
 *         - \ref NVML_ERROR_NO_PERMISSION     if the calling process has insufficient permissions to perform operation
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceDiscoverGpus(nvmlPciInfo_t pciInfo);

/** \} */

/***************************************************************************************************/
/** \defgroup nvmlFieldValueQueries Field Value Queries
 *  This chapter describes NVML operations that are associated with retrieving Field Values from NVML
 *  \{
 */
/***************************************************************************************************/

/**
 * Request values for a list of fields for a device. This API allows multiple fields to be queried at once.
 * If any of the underlying fieldIds are populated by the same driver call, the results for those field IDs
 * will be populated from a single call rather than making a driver call for each fieldId.
 *
 * @param device                               The device handle of the GPU to request field values for
 * @param valuesCount                          Number of entries in values that should be retrieved
 * @param values                               Array of \a valuesCount structures to hold field values.
 *                                             Each value's fieldId must be populated prior to this call
 *
 * @return
 *         - \ref NVML_SUCCESS                 if any values in \a values were populated. Note that you must
 *                                             check the nvmlReturn field of each value for each individual
 *                                             status
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a values is NULL
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetFieldValues(nvmlDevice_st device, int valuesCount, nvmlFieldValue_t values);


/** \} */

/***************************************************************************************************/
/** \defgroup nvmlGridQueries Grid Queries
 *  This chapter describes NVML operations that are associated with NVIDIA GRID products.
 *  \{
 */
/***************************************************************************************************/

/**
 * This method is used to get the virtualization mode corresponding to the GPU.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param device                    Identifier of the target device
 * @param pVirtualMode              Reference to virtualization mode. One of NVML_GPU_VIRTUALIZATION_?
 * 
 * @return 
 *         - \ref NVML_SUCCESS                  if \a pVirtualMode is fetched
 *         - \ref NVML_ERROR_UNINITIALIZED      if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT   if \a device is invalid or \a pVirtualMode is NULL
 *         - \ref NVML_ERROR_GPU_IS_LOST        if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_UNKNOWN            on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetVirtualizationMode(nvmlDevice_st device, @Cast("nvmlGpuVirtualizationMode_t*") IntPointer pVirtualMode);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetVirtualizationMode(nvmlDevice_st device, @Cast("nvmlGpuVirtualizationMode_t*") IntBuffer pVirtualMode);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetVirtualizationMode(nvmlDevice_st device, @Cast("nvmlGpuVirtualizationMode_t*") int[] pVirtualMode);

/** \} */

/***************************************************************************************************/
/** \defgroup nvmlGridCommands Grid Commands
 *  This chapter describes NVML operations that are associated with NVIDIA GRID products.
 *  \{
 */
/***************************************************************************************************/

/**
 * This method is used to set the virtualization mode corresponding to the GPU.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param device                    Identifier of the target device
 * @param virtualMode               virtualization mode. One of NVML_GPU_VIRTUALIZATION_?
 *
 * @return 
 *         - \ref NVML_SUCCESS                  if \a pVirtualMode is set
 *         - \ref NVML_ERROR_UNINITIALIZED      if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT   if \a device is invalid or \a pVirtualMode is NULL
 *         - \ref NVML_ERROR_GPU_IS_LOST        if the target GPU has fallen off the bus or is otherwise inaccessible
 *         - \ref NVML_ERROR_NOT_SUPPORTED      if setting of virtualization mode is not supported.
 *         - \ref NVML_ERROR_NO_PERMISSION      if setting of virtualization mode is not allowed for this client.
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceSetVirtualizationMode(nvmlDevice_st device, @Cast("nvmlGpuVirtualizationMode_t") int virtualMode);

/** \} */

/***************************************************************************************************/
/** \defgroup nvmlVgpu vGPU Management
 * \{
 *
 * Set of APIs supporting GRID vGPU
 */
/***************************************************************************************************/

/**
 * Retrieve the supported vGPU types on a physical GPU (device).
 *
 * An array of supported vGPU types for the physical GPU indicated by \a device is returned in the caller-supplied buffer
 * pointed at by \a vgpuTypeIds. The element count of nvmlVgpuTypeId_t array is passed in \a vgpuCount, and \a vgpuCount
 * is used to return the number of vGPU types written to the buffer.
 *
 * If the supplied buffer is not large enough to accomodate the vGPU type array, the function returns
 * NVML_ERROR_INSUFFICIENT_SIZE, with the element count of nvmlVgpuTypeId_t array required in \a vgpuCount.
 * To query the number of vGPU types supported for the GPU, call this function with *vgpuCount = 0.
 * The code will return NVML_ERROR_INSUFFICIENT_SIZE, or NVML_SUCCESS if no vGPU types are supported.
 *
 * @param device                   The identifier of the target device
 * @param vgpuCount                Pointer to caller-supplied array size, and returns number of vGPU types
 * @param vgpuTypeIds              Pointer to caller-supplied array in which to return list of vGPU types
 *
 * @return
 *         - \ref NVML_SUCCESS                      successful completion
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE      \a vgpuTypeIds buffer is too small, array element count is returned in \a vgpuCount
 *         - \ref NVML_ERROR_INVALID_ARGUMENT       if \a vgpuCount is NULL or \a device is invalid
 *         - \ref NVML_ERROR_NOT_SUPPORTED          if vGPU is not supported by the device
 *         - \ref NVML_ERROR_VGPU_ECC_NOT_SUPPORTED if ECC is enabled on the device
 *         - \ref NVML_ERROR_UNKNOWN             on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetSupportedVgpus(nvmlDevice_st device, @Cast("unsigned int*") IntPointer vgpuCount, @Cast("nvmlVgpuTypeId_t*") IntPointer vgpuTypeIds);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetSupportedVgpus(nvmlDevice_st device, @Cast("unsigned int*") IntBuffer vgpuCount, @Cast("nvmlVgpuTypeId_t*") IntBuffer vgpuTypeIds);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetSupportedVgpus(nvmlDevice_st device, @Cast("unsigned int*") int[] vgpuCount, @Cast("nvmlVgpuTypeId_t*") int[] vgpuTypeIds);

/**
 * Retrieve the currently creatable vGPU types on a physical GPU (device).
 *
 * An array of creatable vGPU types for the physical GPU indicated by \a device is returned in the caller-supplied buffer
 * pointed at by \a vgpuTypeIds. The element count of nvmlVgpuTypeId_t array is passed in \a vgpuCount, and \a vgpuCount
 * is used to return the number of vGPU types written to the buffer.
 *
 * The creatable vGPU types for a device may differ over time, as there may be restrictions on what type of vGPU types
 * can concurrently run on a device.  For example, if only one vGPU type is allowed at a time on a device, then the creatable
 * list will be restricted to whatever vGPU type is already running on the device.
 *
 * If the supplied buffer is not large enough to accomodate the vGPU type array, the function returns
 * NVML_ERROR_INSUFFICIENT_SIZE, with the element count of nvmlVgpuTypeId_t array required in \a vgpuCount.
 * To query the number of vGPU types createable for the GPU, call this function with *vgpuCount = 0.
 * The code will return NVML_ERROR_INSUFFICIENT_SIZE, or NVML_SUCCESS if no vGPU types are creatable.
 *
 * @param device                   The identifier of the target device
 * @param vgpuCount                Pointer to caller-supplied array size, and returns number of vGPU types
 * @param vgpuTypeIds              Pointer to caller-supplied array in which to return list of vGPU types
 *
 * @return
 *         - \ref NVML_SUCCESS                      successful completion
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE      \a vgpuTypeIds buffer is too small, array element count is returned in \a vgpuCount
 *         - \ref NVML_ERROR_INVALID_ARGUMENT       if \a vgpuCount is NULL
 *         - \ref NVML_ERROR_NOT_SUPPORTED          if vGPU is not supported by the device
 *         - \ref NVML_ERROR_VGPU_ECC_NOT_SUPPORTED if ECC is enabled on the device
 *         - \ref NVML_ERROR_UNKNOWN                on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetCreatableVgpus(nvmlDevice_st device, @Cast("unsigned int*") IntPointer vgpuCount, @Cast("nvmlVgpuTypeId_t*") IntPointer vgpuTypeIds);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetCreatableVgpus(nvmlDevice_st device, @Cast("unsigned int*") IntBuffer vgpuCount, @Cast("nvmlVgpuTypeId_t*") IntBuffer vgpuTypeIds);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetCreatableVgpus(nvmlDevice_st device, @Cast("unsigned int*") int[] vgpuCount, @Cast("nvmlVgpuTypeId_t*") int[] vgpuTypeIds);

/**
 * Retrieve the class of a vGPU type. It will not exceed 64 characters in length (including the NUL terminator).
 * See \ref nvmlConstants::NVML_DEVICE_NAME_BUFFER_SIZE.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param vgpuTypeId               Handle to vGPU type
 * @param vgpuTypeClass            Pointer to string array to return class in
 * @param size                     Size of string
 *
 * @return
 *         - \ref NVML_SUCCESS                   successful completion
 *         - \ref NVML_ERROR_INVALID_ARGUMENT    if \a vgpuTypeId is invalid, or \a vgpuTypeClass is NULL
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE   if \a size is too small
 *         - \ref NVML_ERROR_UNKNOWN             on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlVgpuTypeGetClass(@Cast("nvmlVgpuTypeId_t") int vgpuTypeId, @Cast("char*") BytePointer vgpuTypeClass, @Cast("unsigned int*") IntPointer size);
public static native @Cast("nvmlReturn_t") int nvmlVgpuTypeGetClass(@Cast("nvmlVgpuTypeId_t") int vgpuTypeId, @Cast("char*") ByteBuffer vgpuTypeClass, @Cast("unsigned int*") IntBuffer size);
public static native @Cast("nvmlReturn_t") int nvmlVgpuTypeGetClass(@Cast("nvmlVgpuTypeId_t") int vgpuTypeId, @Cast("char*") byte[] vgpuTypeClass, @Cast("unsigned int*") int[] size);

/**
 * Retrieve the vGPU type name.
 *
 * The name is an alphanumeric string that denotes a particular vGPU, e.g. GRID M60-2Q. It will not
 * exceed 64 characters in length (including the NUL terminator).  See \ref
 * nvmlConstants::NVML_DEVICE_NAME_BUFFER_SIZE.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param vgpuTypeId               Handle to vGPU type
 * @param vgpuTypeName             Pointer to buffer to return name
 * @param size                     Size of buffer
 *
 * @return
 *         - \ref NVML_SUCCESS                 successful completion
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a vgpuTypeId is invalid, or \a name is NULL
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a size is too small
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlVgpuTypeGetName(@Cast("nvmlVgpuTypeId_t") int vgpuTypeId, @Cast("char*") BytePointer vgpuTypeName, @Cast("unsigned int*") IntPointer size);
public static native @Cast("nvmlReturn_t") int nvmlVgpuTypeGetName(@Cast("nvmlVgpuTypeId_t") int vgpuTypeId, @Cast("char*") ByteBuffer vgpuTypeName, @Cast("unsigned int*") IntBuffer size);
public static native @Cast("nvmlReturn_t") int nvmlVgpuTypeGetName(@Cast("nvmlVgpuTypeId_t") int vgpuTypeId, @Cast("char*") byte[] vgpuTypeName, @Cast("unsigned int*") int[] size);

/**
 * Retrieve the device ID of a vGPU type.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param vgpuTypeId               Handle to vGPU type
 * @param deviceID                 Device ID and vendor ID of the device contained in single 32 bit value
 * @param subsystemID              Subsytem ID and subsytem vendor ID of the device contained in single 32 bit value
 *
 * @return
 *         - \ref NVML_SUCCESS                 successful completion
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a vgpuTypeId is invalid, or \a deviceId or \a subsystemID are NULL
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlVgpuTypeGetDeviceID(@Cast("nvmlVgpuTypeId_t") int vgpuTypeId, @Cast("unsigned long long*") LongPointer deviceID, @Cast("unsigned long long*") LongPointer subsystemID);
public static native @Cast("nvmlReturn_t") int nvmlVgpuTypeGetDeviceID(@Cast("nvmlVgpuTypeId_t") int vgpuTypeId, @Cast("unsigned long long*") LongBuffer deviceID, @Cast("unsigned long long*") LongBuffer subsystemID);
public static native @Cast("nvmlReturn_t") int nvmlVgpuTypeGetDeviceID(@Cast("nvmlVgpuTypeId_t") int vgpuTypeId, @Cast("unsigned long long*") long[] deviceID, @Cast("unsigned long long*") long[] subsystemID);

/**
 * Retrieve the vGPU framebuffer size in bytes.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param vgpuTypeId               Handle to vGPU type
 * @param fbSize                   Pointer to framebuffer size in bytes
 *
 * @return
 *         - \ref NVML_SUCCESS                 successful completion
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a vgpuTypeId is invalid, or \a fbSize is NULL
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlVgpuTypeGetFramebufferSize(@Cast("nvmlVgpuTypeId_t") int vgpuTypeId, @Cast("unsigned long long*") LongPointer fbSize);
public static native @Cast("nvmlReturn_t") int nvmlVgpuTypeGetFramebufferSize(@Cast("nvmlVgpuTypeId_t") int vgpuTypeId, @Cast("unsigned long long*") LongBuffer fbSize);
public static native @Cast("nvmlReturn_t") int nvmlVgpuTypeGetFramebufferSize(@Cast("nvmlVgpuTypeId_t") int vgpuTypeId, @Cast("unsigned long long*") long[] fbSize);

/**
 * Retrieve count of vGPU's supported display heads.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param vgpuTypeId               Handle to vGPU type
 * @param numDisplayHeads          Pointer to number of display heads
 *
 * @return
 *         - \ref NVML_SUCCESS                 successful completion
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a vgpuTypeId is invalid, or \a numDisplayHeads is NULL
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlVgpuTypeGetNumDisplayHeads(@Cast("nvmlVgpuTypeId_t") int vgpuTypeId, @Cast("unsigned int*") IntPointer numDisplayHeads);
public static native @Cast("nvmlReturn_t") int nvmlVgpuTypeGetNumDisplayHeads(@Cast("nvmlVgpuTypeId_t") int vgpuTypeId, @Cast("unsigned int*") IntBuffer numDisplayHeads);
public static native @Cast("nvmlReturn_t") int nvmlVgpuTypeGetNumDisplayHeads(@Cast("nvmlVgpuTypeId_t") int vgpuTypeId, @Cast("unsigned int*") int[] numDisplayHeads);

/**
 * Retrieve vGPU display head's maximum supported resolution.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param vgpuTypeId               Handle to vGPU type
 * @param displayIndex             Zero-based index of display head
 * @param xdim                     Pointer to maximum number of pixels in X dimension
 * @param ydim                     Pointer to maximum number of pixels in Y dimension
 *
 * @return
 *         - \ref NVML_SUCCESS                 successful completion
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a vgpuTypeId is invalid, or \a xdim or \a ydim are NULL, or \a displayIndex
 *                                             is out of range.
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlVgpuTypeGetResolution(@Cast("nvmlVgpuTypeId_t") int vgpuTypeId, @Cast("unsigned int") int displayIndex, @Cast("unsigned int*") IntPointer xdim, @Cast("unsigned int*") IntPointer ydim);
public static native @Cast("nvmlReturn_t") int nvmlVgpuTypeGetResolution(@Cast("nvmlVgpuTypeId_t") int vgpuTypeId, @Cast("unsigned int") int displayIndex, @Cast("unsigned int*") IntBuffer xdim, @Cast("unsigned int*") IntBuffer ydim);
public static native @Cast("nvmlReturn_t") int nvmlVgpuTypeGetResolution(@Cast("nvmlVgpuTypeId_t") int vgpuTypeId, @Cast("unsigned int") int displayIndex, @Cast("unsigned int*") int[] xdim, @Cast("unsigned int*") int[] ydim);

/**
 * Retrieve license requirements for a vGPU type
 *
 * The license type and version required to run the specified vGPU type is returned as an alphanumeric string, in the form
 * ",", for example "GRID-Virtual-PC,2.0". If a vGPU is runnable with* more than one type of license,
 * the licenses are delimited by a semicolon, for example "GRID-Virtual-PC,2.0;GRID-Virtual-WS,2.0;GRID-Virtual-WS-Ext,2.0".
 *
 * The total length of the returned string will not exceed 128 characters, including the NUL terminator.
 * See \ref nvmlVgpuConstants::NVML_GRID_LICENSE_BUFFER_SIZE.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param vgpuTypeId               Handle to vGPU type
 * @param vgpuTypeLicenseString    Pointer to buffer to return license info
 * @param size                     Size of \a vgpuTypeLicenseString buffer
 *
 * @return
 *         - \ref NVML_SUCCESS                 successful completion
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a vgpuTypeId is invalid, or \a vgpuTypeLicenseString is NULL
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a size is too small
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlVgpuTypeGetLicense(@Cast("nvmlVgpuTypeId_t") int vgpuTypeId, @Cast("char*") BytePointer vgpuTypeLicenseString, @Cast("unsigned int") int size);
public static native @Cast("nvmlReturn_t") int nvmlVgpuTypeGetLicense(@Cast("nvmlVgpuTypeId_t") int vgpuTypeId, @Cast("char*") ByteBuffer vgpuTypeLicenseString, @Cast("unsigned int") int size);
public static native @Cast("nvmlReturn_t") int nvmlVgpuTypeGetLicense(@Cast("nvmlVgpuTypeId_t") int vgpuTypeId, @Cast("char*") byte[] vgpuTypeLicenseString, @Cast("unsigned int") int size);

/**
 * Retrieve the static frame rate limit value of the vGPU type
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param vgpuTypeId               Handle to vGPU type
 * @param frameRateLimit           Reference to return the frame rate limit value
 * @return
 *         - \ref NVML_SUCCESS                 successful completion
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if frame rate limiter is turned off for the vGPU type
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, or \a frameRateLimit is NULL
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlVgpuTypeGetFrameRateLimit(@Cast("nvmlVgpuTypeId_t") int vgpuTypeId, @Cast("unsigned int*") IntPointer frameRateLimit);
public static native @Cast("nvmlReturn_t") int nvmlVgpuTypeGetFrameRateLimit(@Cast("nvmlVgpuTypeId_t") int vgpuTypeId, @Cast("unsigned int*") IntBuffer frameRateLimit);
public static native @Cast("nvmlReturn_t") int nvmlVgpuTypeGetFrameRateLimit(@Cast("nvmlVgpuTypeId_t") int vgpuTypeId, @Cast("unsigned int*") int[] frameRateLimit);

/**
 * Retrieve the maximum number of vGPU instances creatable on a device for given vGPU type
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param device                   The identifier of the target device
 * @param vgpuTypeId               Handle to vGPU type
 * @param vgpuInstanceCount        Pointer to get the max number of vGPU instances
 *                                 that can be created on a deicve for given vgpuTypeId
 * @return
 *         - \ref NVML_SUCCESS                 successful completion
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a vgpuTypeId is invalid or is not supported on target device,
 *                                             or \a vgpuInstanceCount is NULL
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlVgpuTypeGetMaxInstances(nvmlDevice_st device, @Cast("nvmlVgpuTypeId_t") int vgpuTypeId, @Cast("unsigned int*") IntPointer vgpuInstanceCount);
public static native @Cast("nvmlReturn_t") int nvmlVgpuTypeGetMaxInstances(nvmlDevice_st device, @Cast("nvmlVgpuTypeId_t") int vgpuTypeId, @Cast("unsigned int*") IntBuffer vgpuInstanceCount);
public static native @Cast("nvmlReturn_t") int nvmlVgpuTypeGetMaxInstances(nvmlDevice_st device, @Cast("nvmlVgpuTypeId_t") int vgpuTypeId, @Cast("unsigned int*") int[] vgpuInstanceCount);

/**
 * Retrieve the active vGPU instances on a device.
 *
 * An array of active vGPU instances is returned in the caller-supplied buffer pointed at by \a vgpuInstances. The
 * array elememt count is passed in \a vgpuCount, and \a vgpuCount is used to return the number of vGPU instances
 * written to the buffer.
 *
 * If the supplied buffer is not large enough to accomodate the vGPU instance array, the function returns
 * NVML_ERROR_INSUFFICIENT_SIZE, with the element count of nvmlVgpuInstance_t array required in \a vgpuCount.
 * To query the number of active vGPU instances, call this function with *vgpuCount = 0.  The code will return
 * NVML_ERROR_INSUFFICIENT_SIZE, or NVML_SUCCESS if no vGPU Types are supported.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param device                   The identifier of the target device
 * @param vgpuCount                Pointer which passes in the array size as well as get
 *                                 back the number of types
 * @param vgpuInstances            Pointer to array in which to return list of vGPU instances
 *
 * @return
 *         - \ref NVML_SUCCESS                  successful completion
 *         - \ref NVML_ERROR_UNINITIALIZED      if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT   if \a device is invalid, or \a vgpuCount is NULL
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE  if \a size is too small
 *         - \ref NVML_ERROR_NOT_SUPPORTED      if vGPU is not supported by the device
 *         - \ref NVML_ERROR_UNKNOWN            on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetActiveVgpus(nvmlDevice_st device, @Cast("unsigned int*") IntPointer vgpuCount, @Cast("nvmlVgpuInstance_t*") IntPointer vgpuInstances);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetActiveVgpus(nvmlDevice_st device, @Cast("unsigned int*") IntBuffer vgpuCount, @Cast("nvmlVgpuInstance_t*") IntBuffer vgpuInstances);
public static native @Cast("nvmlReturn_t") int nvmlDeviceGetActiveVgpus(nvmlDevice_st device, @Cast("unsigned int*") int[] vgpuCount, @Cast("nvmlVgpuInstance_t*") int[] vgpuInstances);

/**
 * Retrieve the VM ID associated with a vGPU instance.
 *
 * The VM ID is returned as a string, not exceeding 80 characters in length (including the NUL terminator).
 * See \ref nvmlConstants::NVML_DEVICE_UUID_BUFFER_SIZE.
 *
 * The format of the VM ID varies by platform, and is indicated by the type identifier returned in \a vmIdType.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param vgpuInstance             Identifier of the target vGPU instance
 * @param vmId                     Pointer to caller-supplied buffer to hold VM ID
 * @param size                     Size of buffer in bytes
 * @param vmIdType                 Pointer to hold VM ID type
 *
 * @return
 *         - \ref NVML_SUCCESS                 successful completion
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a vmId or \a vmIdType is NULL, or \a vgpuInstance is 0
 *         - \ref NVML_ERROR_NOT_FOUND         if \a vgpuInstance does not match a valid active vGPU instance on the system
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a size is too small
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetVmID(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("char*") BytePointer vmId, @Cast("unsigned int") int size, @Cast("nvmlVgpuVmIdType_t*") IntPointer vmIdType);
public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetVmID(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("char*") ByteBuffer vmId, @Cast("unsigned int") int size, @Cast("nvmlVgpuVmIdType_t*") IntBuffer vmIdType);
public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetVmID(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("char*") byte[] vmId, @Cast("unsigned int") int size, @Cast("nvmlVgpuVmIdType_t*") int[] vmIdType);

/**
 * Retrieve the UUID of a vGPU instance.
 *
 * The UUID is a globally unique identifier associated with the vGPU, and is returned as a 5-part hexadecimal string,
 * not exceeding 80 characters in length (including the NULL terminator).
 * See \ref nvmlConstants::NVML_DEVICE_UUID_BUFFER_SIZE.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param vgpuInstance             Identifier of the target vGPU instance
 * @param uuid                     Pointer to caller-supplied buffer to hold vGPU UUID
 * @param size                     Size of buffer in bytes
 *
 * @return
 *         - \ref NVML_SUCCESS                 successful completion
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a vgpuInstance is 0, or \a uuid is NULL
 *         - \ref NVML_ERROR_NOT_FOUND         if \a vgpuInstance does not match a valid active vGPU instance on the system
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a size is too small
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetUUID(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("char*") BytePointer uuid, @Cast("unsigned int") int size);
public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetUUID(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("char*") ByteBuffer uuid, @Cast("unsigned int") int size);
public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetUUID(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("char*") byte[] uuid, @Cast("unsigned int") int size);

/**
 * Retrieve the NVIDIA driver version installed in the VM associated with a vGPU.
 *
 * The version is returned as an alphanumeric string in the caller-supplied buffer \a version. The length of the version
 * string will not exceed 80 characters in length (including the NUL terminator).
 * See \ref nvmlConstants::NVML_SYSTEM_DRIVER_VERSION_BUFFER_SIZE.
 *
 * nvmlVgpuInstanceGetVmDriverVersion() may be called at any time for a vGPU instance. The guest VM driver version is
 * returned as "Unknown" if no NVIDIA driver is installed in the VM, or the VM has not yet booted to the point where the
 * NVIDIA driver is loaded and initialized.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param vgpuInstance             Identifier of the target vGPU instance
 * @param version                  Caller-supplied buffer to return driver version string
 * @param length                   Size of \a version buffer
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a version has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a vgpuInstance is 0
 *         - \ref NVML_ERROR_NOT_FOUND         if \a vgpuInstance does not match a valid active vGPU instance on the system
 *         - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetVmDriverVersion(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("char*") BytePointer version, @Cast("unsigned int") int length);
public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetVmDriverVersion(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("char*") ByteBuffer version, @Cast("unsigned int") int length);
public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetVmDriverVersion(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("char*") byte[] version, @Cast("unsigned int") int length);

/**
 * Retrieve the framebuffer usage in bytes.
 *
 * Framebuffer usage is the amont of vGPU framebuffer memory that is currently in use by the VM.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param vgpuInstance             The identifier of the target instance
 * @param fbUsage                  Pointer to framebuffer usage in bytes
 *
 * @return
 *         - \ref NVML_SUCCESS                 successful completion
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a vgpuInstance is 0, or \a fbUsage is NULL
 *         - \ref NVML_ERROR_NOT_FOUND         if \a vgpuInstance does not match a valid active vGPU instance on the system
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetFbUsage(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("unsigned long long*") LongPointer fbUsage);
public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetFbUsage(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("unsigned long long*") LongBuffer fbUsage);
public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetFbUsage(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("unsigned long long*") long[] fbUsage);

/**
 * Retrieve the current licensing state of the vGPU instance.
 *
 * If the vGPU is currently licensed, \a licensed is set to 1, otherwise it is set to 0.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param vgpuInstance             Identifier of the target vGPU instance
 * @param licensed                 Reference to return the licensing status
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a licensed has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a vgpuInstance is 0, or \a licensed is NULL
 *         - \ref NVML_ERROR_NOT_FOUND         if \a vgpuInstance does not match a valid active vGPU instance on the system
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetLicenseStatus(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("unsigned int*") IntPointer licensed);
public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetLicenseStatus(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("unsigned int*") IntBuffer licensed);
public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetLicenseStatus(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("unsigned int*") int[] licensed);

/**
 * Retrieve the vGPU type of a vGPU instance.
 *
 * Returns the vGPU type ID of vgpu assigned to the vGPU instance.
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param vgpuInstance             Identifier of the target vGPU instance
 * @param vgpuTypeId               Reference to return the vgpuTypeId
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a vgpuTypeId has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a vgpuInstance is 0, or \a vgpuTypeId is NULL
 *         - \ref NVML_ERROR_NOT_FOUND         if \a vgpuInstance does not match a valid active vGPU instance on the system
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetType(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("nvmlVgpuTypeId_t*") IntPointer vgpuTypeId);
public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetType(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("nvmlVgpuTypeId_t*") IntBuffer vgpuTypeId);
public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetType(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("nvmlVgpuTypeId_t*") int[] vgpuTypeId);

/**
 * Retrieve the frame rate limit set for the vGPU instance.
 *
 * Returns the value of the frame rate limit set for the vGPU instance
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * @param vgpuInstance             Identifier of the target vGPU instance
 * @param frameRateLimit           Reference to return the frame rate limit
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a frameRateLimit has been set
 *         - \ref NVML_ERROR_NOT_SUPPORTED     if frame rate limiter is turned off for the vGPU type
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a vgpuInstance is 0, or \a frameRateLimit is NULL
 *         - \ref NVML_ERROR_NOT_FOUND         if \a vgpuInstance does not match a valid active vGPU instance on the system
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetFrameRateLimit(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("unsigned int*") IntPointer frameRateLimit);
public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetFrameRateLimit(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("unsigned int*") IntBuffer frameRateLimit);
public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetFrameRateLimit(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("unsigned int*") int[] frameRateLimit);

/**
 * Retrieve the encoder capacity of a vGPU instance, as a percentage of maximum encoder capacity with valid values in the range 0-100.
 *
 * For Maxwell &tm; or newer fully supported devices.
 *
 * @param vgpuInstance             Identifier of the target vGPU instance
 * @param encoderCapacity          Reference to an unsigned int for the encoder capacity
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a encoderCapacity has been retrived
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a vgpuInstance is 0, or \a encoderQueryType is invalid
 *         - \ref NVML_ERROR_NOT_FOUND         if \a vgpuInstance does not match a valid active vGPU instance on the system
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetEncoderCapacity(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("unsigned int*") IntPointer encoderCapacity);
public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetEncoderCapacity(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("unsigned int*") IntBuffer encoderCapacity);
public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetEncoderCapacity(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("unsigned int*") int[] encoderCapacity);

/**
 * Set the encoder capacity of a vGPU instance, as a percentage of maximum encoder capacity with valid values in the range 0-100.
 *
 * For Maxwell &tm; or newer fully supported devices.
 *
 * @param vgpuInstance             Identifier of the target vGPU instance
 * @param encoderCapacity          Unsigned int for the encoder capacity value
 *
 * @return
 *         - \ref NVML_SUCCESS                 if \a encoderCapacity has been set
 *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
 *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a vgpuInstance is 0
 *         - \ref NVML_ERROR_NOT_FOUND         if \a vgpuInstance does not match a valid active vGPU instance on the system
 *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
 */
public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceSetEncoderCapacity(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("unsigned int") int encoderCapacity);

/**
 * Retrieves current utilization for vGPUs on a physical GPU (device).
 *
 * For Kepler &tm; or newer fully supported devices.
 *
 * Reads recent utilization of GPU SM (3D/Compute), framebuffer, video encoder, and video decoder for vGPU instances running
 * on a device. Utilization values are returned as an array of utilization sample structures in the caller-supplied buffer
 * pointed at by \a utilizationSamples. One utilization sample structure is returned per vGPU instance, and includes the
 * CPU timestamp at which the samples were recorded. Individual utilization values are returned as "unsigned int" values
 * in nvmlValue_t unions. The function sets the caller-supplied \a sampleValType to NVML_VALUE_TYPE_UNSIGNED_INT to
 * indicate the returned value type.
 *
 * To read utilization values, first determine the size of buffer required to hold the samples by invoking the function with
 * \a utilizationSamples set to NULL. The function will return NVML_ERROR_INSUFFICIENT_SIZE, with the current vGPU instance
 * count in \a vgpuInstanceSamplesCount, or NVML_SUCCESS if the current vGPU instance count is zero. The caller should allocate
 * a buffer of size vgpuInstanceSamplesCount * sizeof(nvmlVgpuInstanceUtilizationSample_t). Invoke the function again with
 * the allocated buffer passed in \a utilizationSamples, and \a vgpuInstanceSamplesCount set to the number of entries the
 * buffer is sized for.
 *
 * On successful return, the function updates \a vgpuInstanceSampleCount with the number of vGPU utilization sample
 * structures that were actually written. This may differ from a previously read value as vGPU instances are created or
 * destroyed.
 *
 * lastSeenTimeStamp represents the CPU timestamp in microseconds at which utilization samples were last read. Set it to 0
 * to read utilization based on all the samples maintained by the driver's internal sample buffer. Set lastSeenTimeStamp
 * to a timeStamp retrieved from a previous query to read utilization since the previous query.
 *
 * @param device                        The identifier for the target device
 * @param lastSeenTimeStamp             Return only samples with timestamp greater than lastSeenTimeStamp.
 * @param sampleValType                 Pointer to caller-supplied buffer to hold the type of returned sample values
 * @param vgpuInstanceSamplesCount      Pointer to caller-supplied array size, and returns number of vGPU instances
 * @param utilizationSamples            Pointer to caller-supplied buffer in which vGPU utilization samples are returned
 

* @return * - \ref NVML_SUCCESS if utilization samples are successfully retrieved * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a vgpuInstanceSamplesCount or \a sampleValType is * NULL, or a sample count of 0 is passed with a non-NULL \a utilizationSamples * - \ref NVML_ERROR_INSUFFICIENT_SIZE if supplied \a vgpuInstanceSamplesCount is too small to return samples for all * vGPU instances currently executing on the device * - \ref NVML_ERROR_NOT_SUPPORTED if vGPU is not supported by the device * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible * - \ref NVML_ERROR_NOT_FOUND if sample entries are not found * - \ref NVML_ERROR_UNKNOWN on any unexpected error */ public static native @Cast("nvmlReturn_t") int nvmlDeviceGetVgpuUtilization(nvmlDevice_st device, @Cast("unsigned long long") long lastSeenTimeStamp, @Cast("nvmlValueType_t*") IntPointer sampleValType, @Cast("unsigned int*") IntPointer vgpuInstanceSamplesCount, nvmlVgpuInstanceUtilizationSample_t utilizationSamples); public static native @Cast("nvmlReturn_t") int nvmlDeviceGetVgpuUtilization(nvmlDevice_st device, @Cast("unsigned long long") long lastSeenTimeStamp, @Cast("nvmlValueType_t*") IntBuffer sampleValType, @Cast("unsigned int*") IntBuffer vgpuInstanceSamplesCount, nvmlVgpuInstanceUtilizationSample_t utilizationSamples); public static native @Cast("nvmlReturn_t") int nvmlDeviceGetVgpuUtilization(nvmlDevice_st device, @Cast("unsigned long long") long lastSeenTimeStamp, @Cast("nvmlValueType_t*") int[] sampleValType, @Cast("unsigned int*") int[] vgpuInstanceSamplesCount, nvmlVgpuInstanceUtilizationSample_t utilizationSamples); /** * Retrieves current utilization for processes running on vGPUs on a physical GPU (device). * * For Maxwell &tm; or newer fully supported devices. * * Reads recent utilization of GPU SM (3D/Compute), framebuffer, video encoder, and video decoder for processes running on * vGPU instances active on a device. Utilization values are returned as an array of utilization sample structures in the * caller-supplied buffer pointed at by \a utilizationSamples. One utilization sample structure is returned per process running * on vGPU instances, that had some non-zero utilization during the last sample period. It includes the CPU timestamp at which * the samples were recorded. Individual utilization values are returned as "unsigned int" values. * * To read utilization values, first determine the size of buffer required to hold the samples by invoking the function with * \a utilizationSamples set to NULL. The function will return NVML_ERROR_INSUFFICIENT_SIZE, with the current vGPU instance * count in \a vgpuProcessSamplesCount. The caller should allocate a buffer of size * vgpuProcessSamplesCount * sizeof(nvmlVgpuProcessUtilizationSample_t). Invoke the function again with * the allocated buffer passed in \a utilizationSamples, and \a vgpuProcessSamplesCount set to the number of entries the * buffer is sized for. * * On successful return, the function updates \a vgpuSubProcessSampleCount with the number of vGPU sub process utilization sample * structures that were actually written. This may differ from a previously read value depending on the number of processes that are active * in any given sample period. * * lastSeenTimeStamp represents the CPU timestamp in microseconds at which utilization samples were last read. Set it to 0 * to read utilization based on all the samples maintained by the driver's internal sample buffer. Set lastSeenTimeStamp * to a timeStamp retrieved from a previous query to read utilization since the previous query. * * @param device The identifier for the target device * @param lastSeenTimeStamp Return only samples with timestamp greater than lastSeenTimeStamp. * @param vgpuProcessSamplesCount Pointer to caller-supplied array size, and returns number of processes running on vGPU instances * @param utilizationSamples Pointer to caller-supplied buffer in which vGPU sub process utilization samples are returned

* @return * - \ref NVML_SUCCESS if utilization samples are successfully retrieved * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a vgpuProcessSamplesCount or a sample count of 0 is * passed with a non-NULL \a utilizationSamples * - \ref NVML_ERROR_INSUFFICIENT_SIZE if supplied \a vgpuProcessSamplesCount is too small to return samples for all * vGPU instances currently executing on the device * - \ref NVML_ERROR_NOT_SUPPORTED if vGPU is not supported by the device * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible * - \ref NVML_ERROR_NOT_FOUND if sample entries are not found * - \ref NVML_ERROR_UNKNOWN on any unexpected error */ public static native @Cast("nvmlReturn_t") int nvmlDeviceGetVgpuProcessUtilization(nvmlDevice_st device, @Cast("unsigned long long") long lastSeenTimeStamp, @Cast("unsigned int*") IntPointer vgpuProcessSamplesCount, nvmlVgpuProcessUtilizationSample_t utilizationSamples); public static native @Cast("nvmlReturn_t") int nvmlDeviceGetVgpuProcessUtilization(nvmlDevice_st device, @Cast("unsigned long long") long lastSeenTimeStamp, @Cast("unsigned int*") IntBuffer vgpuProcessSamplesCount, nvmlVgpuProcessUtilizationSample_t utilizationSamples); public static native @Cast("nvmlReturn_t") int nvmlDeviceGetVgpuProcessUtilization(nvmlDevice_st device, @Cast("unsigned long long") long lastSeenTimeStamp, @Cast("unsigned int*") int[] vgpuProcessSamplesCount, nvmlVgpuProcessUtilizationSample_t utilizationSamples); /** * Retrieve the GRID licensable features. * * Identifies whether the system supports GRID Software Licensing. If it does, return the list of licensable feature(s) * and their current license status. * * @param device Identifier of the target device * @param pGridLicensableFeatures Pointer to structure in which GRID licensable features are returned * * @return * - \ref NVML_SUCCESS if licensable features are successfully retrieved * - \ref NVML_ERROR_INVALID_ARGUMENT if \a pGridLicensableFeatures is NULL * - \ref NVML_ERROR_UNKNOWN on any unexpected error */ public static native @Cast("nvmlReturn_t") int nvmlDeviceGetGridLicensableFeatures(nvmlDevice_st device, nvmlGridLicensableFeatures_t pGridLicensableFeatures); /** * Retrieves the current encoder statistics of a vGPU Instance * * For Maxwell &tm; or newer fully supported devices. * * @param vgpuInstance Identifier of the target vGPU instance * @param sessionCount Reference to an unsigned int for count of active encoder sessions * @param averageFps Reference to an unsigned int for trailing average FPS of all active sessions * @param averageLatency Reference to an unsigned int for encode latency in microseconds * * @return * - \ref NVML_SUCCESS if \a sessionCount, \a averageFps and \a averageLatency is fetched * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized * - \ref NVML_ERROR_INVALID_ARGUMENT if \a sessionCount , or \a averageFps or \a averageLatency is NULL * or \a vgpuInstance is 0. * - \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system * - \ref NVML_ERROR_UNKNOWN on any unexpected error */ public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetEncoderStats(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("unsigned int*") IntPointer sessionCount, @Cast("unsigned int*") IntPointer averageFps, @Cast("unsigned int*") IntPointer averageLatency); public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetEncoderStats(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("unsigned int*") IntBuffer sessionCount, @Cast("unsigned int*") IntBuffer averageFps, @Cast("unsigned int*") IntBuffer averageLatency); public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetEncoderStats(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("unsigned int*") int[] sessionCount, @Cast("unsigned int*") int[] averageFps, @Cast("unsigned int*") int[] averageLatency); /** * Retrieves information about all active encoder sessions on a vGPU Instance. * * An array of active encoder sessions is returned in the caller-supplied buffer pointed at by \a sessionInfo. The * array elememt count is passed in \a sessionCount, and \a sessionCount is used to return the number of sessions * written to the buffer. * * If the supplied buffer is not large enough to accomodate the active session array, the function returns * NVML_ERROR_INSUFFICIENT_SIZE, with the element count of nvmlEncoderSessionInfo_t array required in \a sessionCount. * To query the number of active encoder sessions, call this function with *sessionCount = 0. The code will return * NVML_SUCCESS with number of active encoder sessions updated in *sessionCount. * * For Maxwell &tm; or newer fully supported devices. * * @param vgpuInstance Identifier of the target vGPU instance * @param sessionCount Reference to caller supplied array size, and returns * the number of sessions. * @param sessionInfo Reference to caller supplied array in which the list * of session information us returned. * * @return * - \ref NVML_SUCCESS if \a sessionInfo is fetched * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized * - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a sessionCount is too small, array element count is returned in \a sessionCount * - \ref NVML_ERROR_INVALID_ARGUMENT if \a sessionCount is NULL, or \a vgpuInstance is 0. * - \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system * - \ref NVML_ERROR_UNKNOWN on any unexpected error */ public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetEncoderSessions(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("unsigned int*") IntPointer sessionCount, nvmlEncoderSessionInfo_t sessionInfo); public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetEncoderSessions(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("unsigned int*") IntBuffer sessionCount, nvmlEncoderSessionInfo_t sessionInfo); public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetEncoderSessions(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("unsigned int*") int[] sessionCount, nvmlEncoderSessionInfo_t sessionInfo); /** * Retrieves the active frame buffer capture sessions statistics of a vGPU Instance * * For Maxwell &tm; or newer fully supported devices. * * @param vgpuInstance Identifier of the target vGPU instance * @param fbcStats Reference to nvmlFBCStats_t structure contianing NvFBC stats * * @return * - \ref NVML_SUCCESS if \a fbcStats is fetched * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized * - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0, or \a fbcStats is NULL * - \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system * - \ref NVML_ERROR_UNKNOWN on any unexpected error */ public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetFBCStats(@Cast("nvmlVgpuInstance_t") int vgpuInstance, nvmlFBCStats_t fbcStats); /** * Retrieves information about active frame buffer capture sessions on a vGPU Instance. * * An array of active encoder sessions is returned in the caller-supplied buffer pointed at by \a sessionInfo. The * array element count is passed in \a sessionCount, and \a sessionCount is used to return the number of sessions * written to the buffer. * * If the supplied buffer is not large enough to accomodate the active session array, the function returns * NVML_ERROR_INSUFFICIENT_SIZE, with the element count of nvmlFBCSessionInfo_t array required in \a sessionCount. * To query the number of active FBC sessions, call this function with *sessionCount = 0. The code will return * NVML_SUCCESS with number of active FBC sessions updated in *sessionCount. * * For Maxwell &tm; or newer fully supported devices. * * \note hResolution, vResolution, averageFPS and averageLatency data for a FBC session returned in \a sessionInfo may * be zero if there are no new frames captured since the session started. * * @param vgpuInstance Identifier of the target vGPU instance * @param sessionCount Reference to caller supplied array size, and returns the number of sessions. * @param sessionInfo Reference in which to return the session information * * @return * - \ref NVML_SUCCESS if \a sessionInfo is fetched * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized * - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0, or \a sessionCount is NULL. * - \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system * - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a sessionCount is too small, array element count is returned in \a sessionCount * - \ref NVML_ERROR_UNKNOWN on any unexpected error */ public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetFBCSessions(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("unsigned int*") IntPointer sessionCount, nvmlFBCSessionInfo_t sessionInfo); public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetFBCSessions(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("unsigned int*") IntBuffer sessionCount, nvmlFBCSessionInfo_t sessionInfo); public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetFBCSessions(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("unsigned int*") int[] sessionCount, nvmlFBCSessionInfo_t sessionInfo); /** * Retrieves the current utilization and process ID * * For Maxwell &tm; or newer fully supported devices. * * Reads recent utilization of GPU SM (3D/Compute), framebuffer, video encoder, and video decoder for processes running. * Utilization values are returned as an array of utilization sample structures in the caller-supplied buffer pointed at * by \a utilization. One utilization sample structure is returned per process running, that had some non-zero utilization * during the last sample period. It includes the CPU timestamp at which the samples were recorded. Individual utilization values * are returned as "unsigned int" values. * * To read utilization values, first determine the size of buffer required to hold the samples by invoking the function with * \a utilization set to NULL. The caller should allocate a buffer of size * processSamplesCount * sizeof(nvmlProcessUtilizationSample_t). Invoke the function again with the allocated buffer passed * in \a utilization, and \a processSamplesCount set to the number of entries the buffer is sized for. * * On successful return, the function updates \a processSamplesCount with the number of process utilization sample * structures that were actually written. This may differ from a previously read value as instances are created or * destroyed. * * lastSeenTimeStamp represents the CPU timestamp in microseconds at which utilization samples were last read. Set it to 0 * to read utilization based on all the samples maintained by the driver's internal sample buffer. Set lastSeenTimeStamp * to a timeStamp retrieved from a previous query to read utilization since the previous query. * * @param device The identifier of the target device * @param utilization Pointer to caller-supplied buffer in which guest process utilization samples are returned * @param processSamplesCount Pointer to caller-supplied array size, and returns number of processes running * @param lastSeenTimeStamp Return only samples with timestamp greater than lastSeenTimeStamp.

* @return * - \ref NVML_SUCCESS if \a utilization has been populated * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a utilization is NULL, or \a samplingPeriodUs is NULL * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible * - \ref NVML_ERROR_UNKNOWN on any unexpected error */ public static native @Cast("nvmlReturn_t") int nvmlDeviceGetProcessUtilization(nvmlDevice_st device, nvmlProcessUtilizationSample_t utilization, @Cast("unsigned int*") IntPointer processSamplesCount, @Cast("unsigned long long") long lastSeenTimeStamp); public static native @Cast("nvmlReturn_t") int nvmlDeviceGetProcessUtilization(nvmlDevice_st device, nvmlProcessUtilizationSample_t utilization, @Cast("unsigned int*") IntBuffer processSamplesCount, @Cast("unsigned long long") long lastSeenTimeStamp); public static native @Cast("nvmlReturn_t") int nvmlDeviceGetProcessUtilization(nvmlDevice_st device, nvmlProcessUtilizationSample_t utilization, @Cast("unsigned int*") int[] processSamplesCount, @Cast("unsigned long long") long lastSeenTimeStamp); /** * Queries the state of per process accounting mode on vGPU. * * For Maxwell &tm; or newer fully supported devices. * * @param vgpuInstance The identifier of the target vGPU VM * @param mode Reference in which to return the current accounting mode * * @return * - \ref NVML_SUCCESS if the mode has been successfully retrieved * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized * - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0, or \a mode is NULL * - \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system * - \ref NVML_ERROR_NOT_SUPPORTED if the vGPU doesn't support this feature * - \ref NVML_ERROR_UNKNOWN on any unexpected error */ public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetAccountingMode(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("nvmlEnableState_t*") IntPointer mode); public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetAccountingMode(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("nvmlEnableState_t*") IntBuffer mode); public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetAccountingMode(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("nvmlEnableState_t*") int[] mode); /** * Queries list of processes running on vGPU that can be queried for accounting stats. The list of processes * returned can be in running or terminated state. * * For Maxwell &tm; or newer fully supported devices. * * To just query the maximum number of processes that can be queried, call this function with *count = 0 and * pids=NULL. The return code will be NVML_ERROR_INSUFFICIENT_SIZE, or NVML_SUCCESS if list is empty. * * For more details see \ref nvmlVgpuInstanceGetAccountingStats. * * \note In case of PID collision some processes might not be accessible before the circular buffer is full. * * @param vgpuInstance The identifier of the target vGPU VM * @param count Reference in which to provide the \a pids array size, and * to return the number of elements ready to be queried * @param pids Reference in which to return list of process ids * * @return * - \ref NVML_SUCCESS if pids were successfully retrieved * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized * - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0, or \a count is NULL * - \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system * - \ref NVML_ERROR_NOT_SUPPORTED if the vGPU doesn't support this feature or accounting mode is disabled * - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a count is too small (\a count is set to expected value) * - \ref NVML_ERROR_UNKNOWN on any unexpected error * * @see nvmlVgpuInstanceGetAccountingPids */ public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetAccountingPids(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("unsigned int*") IntPointer count, @Cast("unsigned int*") IntPointer pids); public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetAccountingPids(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("unsigned int*") IntBuffer count, @Cast("unsigned int*") IntBuffer pids); public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetAccountingPids(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("unsigned int*") int[] count, @Cast("unsigned int*") int[] pids); /** * Queries process's accounting stats. * * For Maxwell &tm; or newer fully supported devices. * * Accounting stats capture GPU utilization and other statistics across the lifetime of a process, and * can be queried during life time of the process or after its termination. * The time field in \ref nvmlAccountingStats_t is reported as 0 during the lifetime of the process and * updated to actual running time after its termination. * Accounting stats are kept in a circular buffer, newly created processes overwrite information about old * processes. * * See \ref nvmlAccountingStats_t for description of each returned metric. * List of processes that can be queried can be retrieved from \ref nvmlVgpuInstanceGetAccountingPids. * * \note Accounting Mode needs to be on. See \ref nvmlVgpuInstanceGetAccountingMode. * \note Only compute and graphics applications stats can be queried. Monitoring applications stats can't be * queried since they don't contribute to GPU utilization. * \note In case of pid collision stats of only the latest process (that terminated last) will be reported * * @param vgpuInstance The identifier of the target vGPU VM * @param pid Process Id of the target process to query stats for * @param stats Reference in which to return the process's accounting stats * * @return * - \ref NVML_SUCCESS if stats have been successfully retrieved * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized * - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0, or \a stats is NULL * - \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system * or \a stats is not found * - \ref NVML_ERROR_NOT_SUPPORTED if the vGPU doesn't support this feature or accounting mode is disabled * - \ref NVML_ERROR_UNKNOWN on any unexpected error */ public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetAccountingStats(@Cast("nvmlVgpuInstance_t") int vgpuInstance, @Cast("unsigned int") int pid, nvmlAccountingStats_t stats); /** \} */ /***************************************************************************************************/ /** \defgroup nvml vGPU Migration * This chapter describes NVML operations that are associated with vGPU Migration. * \{ */ /***************************************************************************************************/ /** * vGPU metadata structure. */ public static class nvmlVgpuMetadata_t extends Pointer { static { Loader.load(); } /** Default native constructor. */ public nvmlVgpuMetadata_t() { super((Pointer)null); allocate(); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public nvmlVgpuMetadata_t(long size) { super((Pointer)null); allocateArray(size); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public nvmlVgpuMetadata_t(Pointer p) { super(p); } private native void allocate(); private native void allocateArray(long size); @Override public nvmlVgpuMetadata_t position(long position) { return (nvmlVgpuMetadata_t)super.position(position); } /** Current version of the structure */ public native @Cast("unsigned int") int version(); public native nvmlVgpuMetadata_t version(int version); /** Current revision of the structure */ public native @Cast("unsigned int") int revision(); public native nvmlVgpuMetadata_t revision(int revision); /** Current state of Guest-dependent fields */ public native @Cast("nvmlVgpuGuestInfoState_t") int guestInfoState(); public native nvmlVgpuMetadata_t guestInfoState(int guestInfoState); /** Version of driver installed in guest */ public native @Cast("char") byte guestDriverVersion(int i); public native nvmlVgpuMetadata_t guestDriverVersion(int i, byte guestDriverVersion); @MemberGetter public native @Cast("char*") BytePointer guestDriverVersion(); /** Version of driver installed in host */ public native @Cast("char") byte hostDriverVersion(int i); public native nvmlVgpuMetadata_t hostDriverVersion(int i, byte hostDriverVersion); @MemberGetter public native @Cast("char*") BytePointer hostDriverVersion(); /** Reserved for internal use */ public native @Cast("unsigned int") int reserved(int i); public native nvmlVgpuMetadata_t reserved(int i, int reserved); @MemberGetter public native @Cast("unsigned int*") IntPointer reserved(); /** Size of opaque data field in bytes */ public native @Cast("unsigned int") int opaqueDataSize(); public native nvmlVgpuMetadata_t opaqueDataSize(int opaqueDataSize); /** Opaque data */ public native @Cast("char") byte opaqueData(int i); public native nvmlVgpuMetadata_t opaqueData(int i, byte opaqueData); @MemberGetter public native @Cast("char*") BytePointer opaqueData(); } /** * Physical GPU metadata structure */ public static class nvmlVgpuPgpuMetadata_t extends Pointer { static { Loader.load(); } /** Default native constructor. */ public nvmlVgpuPgpuMetadata_t() { super((Pointer)null); allocate(); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public nvmlVgpuPgpuMetadata_t(long size) { super((Pointer)null); allocateArray(size); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public nvmlVgpuPgpuMetadata_t(Pointer p) { super(p); } private native void allocate(); private native void allocateArray(long size); @Override public nvmlVgpuPgpuMetadata_t position(long position) { return (nvmlVgpuPgpuMetadata_t)super.position(position); } /** Current version of the structure */ public native @Cast("unsigned int") int version(); public native nvmlVgpuPgpuMetadata_t version(int version); /** Current revision of the structure */ public native @Cast("unsigned int") int revision(); public native nvmlVgpuPgpuMetadata_t revision(int revision); /** Host driver version */ public native @Cast("char") byte hostDriverVersion(int i); public native nvmlVgpuPgpuMetadata_t hostDriverVersion(int i, byte hostDriverVersion); @MemberGetter public native @Cast("char*") BytePointer hostDriverVersion(); /** Pgpu virtualizaion capabilities bitfileld */ public native @Cast("unsigned int") int pgpuVirtualizationCaps(); public native nvmlVgpuPgpuMetadata_t pgpuVirtualizationCaps(int pgpuVirtualizationCaps); /** Reserved for internal use */ public native @Cast("unsigned int") int reserved(int i); public native nvmlVgpuPgpuMetadata_t reserved(int i, int reserved); @MemberGetter public native @Cast("unsigned int*") IntPointer reserved(); /** Size of opaque data field in bytes */ public native @Cast("unsigned int") int opaqueDataSize(); public native nvmlVgpuPgpuMetadata_t opaqueDataSize(int opaqueDataSize); /** Opaque data */ public native @Cast("char") byte opaqueData(int i); public native nvmlVgpuPgpuMetadata_t opaqueData(int i, byte opaqueData); @MemberGetter public native @Cast("char*") BytePointer opaqueData(); } /** * vGPU VM compatibility codes */ /** enum nvmlVgpuVmCompatibility_enum */ public static final int /** vGPU is not runnable */ NVML_VGPU_VM_COMPATIBILITY_NONE = 0x0, /** vGPU is runnable from a cold / powered-off state (ACPI S5) */ NVML_VGPU_VM_COMPATIBILITY_COLD = 0x1, /** vGPU is runnable from a hibernated state (ACPI S4) */ NVML_VGPU_VM_COMPATIBILITY_HIBERNATE = 0x2, /** vGPU is runnable from a sleeped state (ACPI S3) */ NVML_VGPU_VM_COMPATIBILITY_SLEEP = 0x4, /** vGPU is runnable from a live/paused (ACPI S0) */ NVML_VGPU_VM_COMPATIBILITY_LIVE = 0x8; /** * vGPU-pGPU compatibility limit codes */ /** enum nvmlVgpuPgpuCompatibilityLimitCode_enum */ public static final int /** Compatibility is not limited. */ NVML_VGPU_COMPATIBILITY_LIMIT_NONE = 0x0, /** Compatibility is limited by host driver version. */ NVML_VGPU_COMPATIBILITY_LIMIT_HOST_DRIVER = 0x1, /** Compatibility is limited by guest driver version. */ NVML_VGPU_COMPATIBILITY_LIMIT_GUEST_DRIVER = 0x2, /** Compatibility is limited by GPU hardware. */ NVML_VGPU_COMPATIBILITY_LIMIT_GPU = 0x4, /** Compatibility is limited by an undefined factor. */ NVML_VGPU_COMPATIBILITY_LIMIT_OTHER = 0x80000000; /** * vGPU-pGPU compatibility structure */ public static class nvmlVgpuPgpuCompatibility_t extends Pointer { static { Loader.load(); } /** Default native constructor. */ public nvmlVgpuPgpuCompatibility_t() { super((Pointer)null); allocate(); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public nvmlVgpuPgpuCompatibility_t(long size) { super((Pointer)null); allocateArray(size); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public nvmlVgpuPgpuCompatibility_t(Pointer p) { super(p); } private native void allocate(); private native void allocateArray(long size); @Override public nvmlVgpuPgpuCompatibility_t position(long position) { return (nvmlVgpuPgpuCompatibility_t)super.position(position); } /** Compatibility of vGPU VM. See \ref nvmlVgpuVmCompatibility_t */ public native @Cast("nvmlVgpuVmCompatibility_t") int vgpuVmCompatibility(); public native nvmlVgpuPgpuCompatibility_t vgpuVmCompatibility(int vgpuVmCompatibility); /** Limiting factor for vGPU-pGPU compatibility. See \ref nvmlVgpuPgpuCompatibilityLimitCode_t */ public native @Cast("nvmlVgpuPgpuCompatibilityLimitCode_t") int compatibilityLimitCode(); public native nvmlVgpuPgpuCompatibility_t compatibilityLimitCode(int compatibilityLimitCode); } /** * Returns vGPU metadata structure for a running vGPU. The structure contains information about the vGPU and its associated VM * such as the currently installed NVIDIA guest driver version, together with host driver version and an opaque data section * containing internal state. * * nvmlVgpuInstanceGetMetadata() may be called at any time for a vGPU instance. Some fields in the returned structure are * dependent on information obtained from the guest VM, which may not yet have reached a state where that information * is available. The current state of these dependent fields is reflected in the info structure's \ref guestInfoState field. * * The VMM may choose to read and save the vGPU's VM info as persistent metadata associated with the VM, and provide * it to GRID Virtual GPU Manager when creating a vGPU for subsequent instances of the VM. * * The caller passes in a buffer via \a vgpuMetadata, with the size of the buffer in \a bufferSize. If the vGPU Metadata structure * is too large to fit in the supplied buffer, the function returns NVML_ERROR_INSUFFICIENT_SIZE with the size needed * in \a bufferSize. * * @param vgpuInstance vGPU instance handle * @param vgpuMetadata Pointer to caller-supplied buffer into which vGPU metadata is written * @param bufferSize Size of vgpuMetadata buffer * * @return * - \ref NVML_SUCCESS vGPU metadata structure was successfully returned * - \ref NVML_ERROR_INSUFFICIENT_SIZE vgpuMetadata buffer is too small, required size is returned in \a bufferSize * - \ref NVML_ERROR_INVALID_ARGUMENT if \a bufferSize is NULL or \a vgpuInstance is 0; if \a vgpuMetadata is NULL and the value of \a bufferSize is not 0. * - \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system * - \ref NVML_ERROR_UNKNOWN on any unexpected error */ public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetMetadata(@Cast("nvmlVgpuInstance_t") int vgpuInstance, nvmlVgpuMetadata_t vgpuMetadata, @Cast("unsigned int*") IntPointer bufferSize); public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetMetadata(@Cast("nvmlVgpuInstance_t") int vgpuInstance, nvmlVgpuMetadata_t vgpuMetadata, @Cast("unsigned int*") IntBuffer bufferSize); public static native @Cast("nvmlReturn_t") int nvmlVgpuInstanceGetMetadata(@Cast("nvmlVgpuInstance_t") int vgpuInstance, nvmlVgpuMetadata_t vgpuMetadata, @Cast("unsigned int*") int[] bufferSize); /** * Returns a vGPU metadata structure for the physical GPU indicated by \a device. The structure contains information about * the GPU and the currently installed NVIDIA host driver version that's controlling it, together with an opaque data section * containing internal state. * * The caller passes in a buffer via \a pgpuMetadata, with the size of the buffer in \a bufferSize. If the \a pgpuMetadata * structure is too large to fit in the supplied buffer, the function returns NVML_ERROR_INSUFFICIENT_SIZE with the size needed * in \a bufferSize. * * @param device The identifier of the target device * @param pgpuMetadata Pointer to caller-supplied buffer into which \a pgpuMetadata is written * @param bufferSize Pointer to size of \a pgpuMetadata buffer * * @return * - \ref NVML_SUCCESS GPU metadata structure was successfully returned * - \ref NVML_ERROR_INSUFFICIENT_SIZE pgpuMetadata buffer is too small, required size is returned in \a bufferSize * - \ref NVML_ERROR_INVALID_ARGUMENT if \a bufferSize is NULL or \a device is invalid; if \a pgpuMetadata is NULL and the value of \a bufferSize is not 0. * - \ref NVML_ERROR_NOT_SUPPORTED vGPU is not supported by the system * - \ref NVML_ERROR_UNKNOWN on any unexpected error */ public static native @Cast("nvmlReturn_t") int nvmlDeviceGetVgpuMetadata(nvmlDevice_st device, nvmlVgpuPgpuMetadata_t pgpuMetadata, @Cast("unsigned int*") IntPointer bufferSize); public static native @Cast("nvmlReturn_t") int nvmlDeviceGetVgpuMetadata(nvmlDevice_st device, nvmlVgpuPgpuMetadata_t pgpuMetadata, @Cast("unsigned int*") IntBuffer bufferSize); public static native @Cast("nvmlReturn_t") int nvmlDeviceGetVgpuMetadata(nvmlDevice_st device, nvmlVgpuPgpuMetadata_t pgpuMetadata, @Cast("unsigned int*") int[] bufferSize); /** * Takes a vGPU instance metadata structure read from \ref nvmlVgpuInstanceGetMetadata(), and a vGPU metadata structure for a * physical GPU read from \ref nvmlDeviceGetVgpuMetadata(), and returns compatibility information of the vGPU instance and the * physical GPU. * * The caller passes in a buffer via \a compatibilityInfo, into which a compatibility information structure is written. The * structure defines the states in which the vGPU / VM may be booted on the physical GPU. If the vGPU / VM compatibility * with the physical GPU is limited, a limit code indicates the factor limiting compability. * (see \ref nvmlVgpuPgpuCompatibilityLimitCode_t for details). * * Note: vGPU compatibility does not take into account dynamic capacity conditions that may limit a system's ability to * boot a given vGPU or associated VM. * * @param vgpuMetadata Pointer to caller-supplied vGPU metadata structure * @param pgpuMetadata Pointer to caller-supplied GPU metadata structure * @param compatibilityInfo Pointer to caller-supplied buffer to hold compatibility info * * @return * - \ref NVML_SUCCESS vGPU metadata structure was successfully returned * - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuMetadata or \a pgpuMetadata or \a bufferSize are NULL * - \ref NVML_ERROR_UNKNOWN on any unexpected error */ public static native @Cast("nvmlReturn_t") int nvmlGetVgpuCompatibility(nvmlVgpuMetadata_t vgpuMetadata, nvmlVgpuPgpuMetadata_t pgpuMetadata, nvmlVgpuPgpuCompatibility_t compatibilityInfo); /** \} */ /***************************************************************************************************/ /** \defgroup nvmlGpuBlacklistQueries GPU Blacklist Queries * This chapter describes NVML operations that are associated with blacklisted GPUs. * \{ */ /***************************************************************************************************/ /** * Blacklist GPU device information **/ public static class nvmlBlacklistDeviceInfo_t extends Pointer { static { Loader.load(); } /** Default native constructor. */ public nvmlBlacklistDeviceInfo_t() { super((Pointer)null); allocate(); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public nvmlBlacklistDeviceInfo_t(long size) { super((Pointer)null); allocateArray(size); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public nvmlBlacklistDeviceInfo_t(Pointer p) { super(p); } private native void allocate(); private native void allocateArray(long size); @Override public nvmlBlacklistDeviceInfo_t position(long position) { return (nvmlBlacklistDeviceInfo_t)super.position(position); } /** The PCI information for the blacklisted GPU */ public native @ByRef nvmlPciInfo_t pciInfo(); public native nvmlBlacklistDeviceInfo_t pciInfo(nvmlPciInfo_t pciInfo); /** The ASCII string UUID for the blacklisted GPU */ public native @Cast("char") byte uuid(int i); public native nvmlBlacklistDeviceInfo_t uuid(int i, byte uuid); @MemberGetter public native @Cast("char*") BytePointer uuid(); } /** * Retrieves the number of blacklisted GPU devices in the system. * * For all products. * * @param deviceCount Reference in which to return the number of blacklisted devices * * @return * - \ref NVML_SUCCESS if \a deviceCount has been set * - \ref NVML_ERROR_INVALID_ARGUMENT if \a deviceCount is NULL */ public static native @Cast("nvmlReturn_t") int nvmlGetBlacklistDeviceCount(@Cast("unsigned int*") IntPointer deviceCount); public static native @Cast("nvmlReturn_t") int nvmlGetBlacklistDeviceCount(@Cast("unsigned int*") IntBuffer deviceCount); public static native @Cast("nvmlReturn_t") int nvmlGetBlacklistDeviceCount(@Cast("unsigned int*") int[] deviceCount); /** * Acquire the device information for a blacklisted device, based on its index. * * For all products. * * Valid indices are derived from the \a deviceCount returned by * \ref nvmlGetBlacklistDeviceCount(). For example, if \a deviceCount is 2 the valid indices * are 0 and 1, corresponding to GPU 0 and GPU 1. * * @param index The index of the target GPU, >= 0 and < \a deviceCount * @param info Reference in which to return the device information * * @return * - \ref NVML_SUCCESS if \a device has been set * - \ref NVML_ERROR_INVALID_ARGUMENT if \a index is invalid or \a info is NULL * * @see nvmlGetBlacklistDeviceCount */ public static native @Cast("nvmlReturn_t") int nvmlGetBlacklistDeviceInfoByIndex(@Cast("unsigned int") int index, nvmlBlacklistDeviceInfo_t info); /** \} */ /** * NVML API versioning support */ // #if defined(__NVML_API_VERSION_INTERNAL) // #undef nvmlDeviceRemoveGpu // #undef nvmlDeviceGetNvLinkRemotePciInfo // #undef nvmlDeviceGetPciInfo // #undef nvmlDeviceGetCount // #undef nvmlDeviceGetHandleByIndex // #undef nvmlDeviceGetHandleByPciBusId // #undef nvmlInit // #endif // #ifdef __cplusplus // #endif // #endif }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy