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