Example #1
0
        public static NvmlReturn GetDeviceUUID(NvmlDevice device, out string uuid)
        {
            StringBuilder builder = new StringBuilder(DEVICE_UUID_BUFFER_SIZE);
            NvmlReturn    result  = NvmlDeviceGetUUID(device, builder, DEVICE_UUID_BUFFER_SIZE);

            uuid = builder.ToString();
            return(result);
        }
Example #2
0
        public static NvmlReturn GetDeviceName(NvmlDevice device, out string name)
        {
            StringBuilder builder = new StringBuilder(DEVICE_NAME_BUFFER_SIZE);
            NvmlReturn    result  = NvmlDeviceGetName(device, builder, DEVICE_NAME_BUFFER_SIZE);

            name = builder.ToString();
            return(result);
        }
Example #3
0
        public static NvmlReturn GetDeviceVbiosVersionString(NvmlDevice device, out string version)
        {
            StringBuilder builder = new StringBuilder(DEVICE_VBIOS_VERSION_BUFFER_SIZE);
            NvmlReturn    result  = NvmlDeviceGetVbiosVersion(device, builder, DEVICE_VBIOS_VERSION_BUFFER_SIZE);

            version = builder.ToString();
            return(result);
        }
Example #4
0
        public static NvmlReturn GetDeviceUUID(uint index, out string uuid)
        {
            NvmlReturn result;
            NvmlDevice device = new NvmlDevice();

            result = NvmlDeviceGetHandleByIndex(index, ref device);
            if (result == NvmlReturn.SUCCESS)
            {
                return(GetDeviceUUID(device, out uuid));
            }
            else
            {
                uuid = "";
            }

            return(result);
        }
Example #5
0
        public static NvmlReturn GetDeviceVbiosVersionString(uint index, out string version)
        {
            NvmlReturn result;
            NvmlDevice device = new NvmlDevice();

            result = NvmlDeviceGetHandleByIndex(index, ref device);
            if (result == NvmlReturn.SUCCESS)
            {
                return(GetDeviceVbiosVersionString(device, out version));
            }
            else
            {
                version = "";
            }

            return(result);
        }
Example #6
0
        public static NvmlReturn GetDeviceName(uint index, out string name)
        {
            NvmlReturn result;
            NvmlDevice device = new NvmlDevice();

            result = NvmlDeviceGetHandleByIndex(index, ref device);
            if (result == NvmlReturn.SUCCESS)
            {
                return(GetDeviceName(device, out name));
            }
            else
            {
                name = "";
            }

            return(result);
        }
Example #7
0
        internal int?NvmlDeviceGetPowerUsage(NvmlDevice nvmlDevice)
        {
            if (Initialised)
            {
                int powerUsage;
                if (Software.OperatingSystem.IsLinux)
                {
                    if (LinuxNvmlDeviceGetPowerUsage(nvmlDevice, out powerUsage) == NvmlReturn.Success)
                    {
                        return(powerUsage);
                    }
                }
                else if (WindowsNvmlDeviceGetPowerUsage(nvmlDevice, out powerUsage) == NvmlReturn.Success)
                {
                    return(powerUsage);
                }
            }

            return(null);
        }
Example #8
0
        internal NvmlDevice?NvmlDeviceGetHandleByIndex(int index)
        {
            if (Initialised)
            {
                var nvmlDevice = new NvmlDevice();
                if (Software.OperatingSystem.IsLinux)
                {
                    try {
                        if (LinuxNvmlDeviceGetHandleByIndex(Convert.ToUInt32(index), ref nvmlDevice) == NvmlReturn.Success)
                        {
                            return(nvmlDevice);
                        }
                    }
                    catch (EntryPointNotFoundException) {
                        if (LinuxNvmlDeviceGetHandleByIndexLegacy(Convert.ToUInt32(index), ref nvmlDevice) == NvmlReturn.Success)
                        {
                            return(nvmlDevice);
                        }
                    }
                }
                else
                {
                    try {
                        if (WindowsNvmlDeviceGetHandleByIndex(Convert.ToUInt32(index), ref nvmlDevice) == NvmlReturn.Success)
                        {
                            return(nvmlDevice);
                        }
                    }
                    catch (EntryPointNotFoundException) {
                        if (WindowsNvmlDeviceGetHandleByIndexLegacy(Convert.ToUInt32(index), ref nvmlDevice) == NvmlReturn.Success)
                        {
                            return(nvmlDevice);
                        }
                    }
                }
            }

            return(null);
        }
Example #9
0
 public static extern NvmlReturn NvmlDeviceGetVbiosVersion(
     NvmlDevice device, StringBuilder version, uint length);
Example #10
0
 public static extern NvmlReturn NvmlDeviceGetSupportedClocksThrottleReasons(
     NvmlDevice device, out ulong supportedClocksThrottleReasons);
Example #11
0
 public static extern NvmlReturn NvmlDeviceGetSerial(
     NvmlDevice device, StringBuilder serial, uint length);
Example #12
0
 public static extern NvmlReturn NvmlDeviceGetTemperature(
     NvmlDevice device, NvmlTemperatureSensors sensorType, out uint temp);
Example #13
0
 public static extern NvmlReturn NvmlDeviceGetSupportedMemoryClocks(
     NvmlDevice device, out uint count, [Out] uint[] clocksMHz);
Example #14
0
 public static extern NvmlReturn NvmlDeviceGetTopologyCommonAncestor(
     NvmlDevice device1, NvmlDevice device2, out NvmlGpuTopologyLevel pathInfo);
Example #15
0
 public static extern NvmlReturn NvmlDeviceGetTemperatureThreshold(
     NvmlDevice device, NvmlTemperatureThresholds thresholdType, out uint temp);
Example #16
0
 public static extern NvmlReturn NvmlDeviceGetSamples(
     NvmlDevice device, NvmlSamplingType type, ulong lastSeenTimeStamp,
     out NvmlValueType sampleValType, out uint sampleCount, [Out] NvmlSample[] samples);
Example #17
0
 public static extern NvmlReturn NvmlSystemGetTopologyGpuSet(
     uint cpuNumber, out uint count, ref NvmlDevice deviceArray);
Example #18
0
 private static extern NvmlReturn LinuxNvmlDeviceGetHandleByIndex(uint index, ref NvmlDevice device);
Example #19
0
 private static extern NvmlReturn LinuxNvmlDeviceGetHandleByIndexLegacy(int index, out NvmlDevice device);
Example #20
0
 private static extern NvmlReturn WindowsNvmlDeviceGetHandleByIndexLegacy(uint index, ref NvmlDevice device);
Example #21
0
 public static extern NvmlReturn NvmlDeviceGetUtilizationRates(
     NvmlDevice device, ref NvmlUtilization utilization);
Example #22
0
 public static extern NvmlReturn NvmlDeviceGetUUID(
     NvmlDevice device, StringBuilder uuid, uint length);
Example #23
0
 public static extern NvmlReturn NvmlDeviceGetTotalEccErrors(
     NvmlDevice device, NvmlMemoryErrorType errorType, NvmlEccCounterType counterType, out ulong eccCounts);
Example #24
0
 public static extern NvmlReturn NvmlDeviceGetTopologyNearestGpus(
     NvmlDevice device, NvmlGpuTopologyLevel level, out uint count, ref NvmlDevice deviceArray);
Example #25
0
 private static extern NvmlReturn WindowsNvmlDeviceGetPowerUsage(NvmlDevice device, ref uint power);
Example #26
0
 public static extern NvmlReturn NvmlDeviceGetViolationStatus(
     NvmlDevice device, NvmlPerfPolicyType perfPolicyType, ref NvmlViolationTime violTime);
Example #27
0
 public static extern NvmlReturn NvmlDeviceOnSameBoard(
     NvmlDevice device1, NvmlDevice device2, out bool onSameBoard);
Example #28
0
 public static extern NvmlReturn NvmlDeviceValidateInforom(
     NvmlDevice device);
Example #29
0
 private static extern NvmlReturn LinuxNvmlDeviceGetPowerUsage(NvmlDevice device, out int power);
Example #30
0
 public static extern NvmlReturn NvmlDeviceGetRetiredPagesPendingStatus(
     NvmlDevice device, out NvmlEnableState isPending);