Exemple #1
0
        private static NvGpuThermalLimit NvThermalPoliciesGetLimit(int busId)
        {
            NvGpuThermalLimit info = NvGpuThermalLimit.Create();

            if (NvapiNativeMethods.NvThermalPoliciesGetLimit == null)
            {
                return(info);
            }
            try {
                if (!HandlesByBusId.TryGetValue(busId, out NvPhysicalGpuHandle handle))
                {
                    return(info);
                }
                var r = NvapiNativeMethods.NvThermalPoliciesGetLimit(handle, ref info);
                if (r != NvStatus.NVAPI_OK)
                {
                    NTMinerConsole.DevError(() => $"{nameof(NvapiNativeMethods.NvThermalPoliciesGetLimit)} {r.ToString()}");
                }
                if (r == NvStatus.NVAPI_OK)
                {
                    return(info);
                }
            }
            catch {
            }
            return(info);
        }
Exemple #2
0
        private NvGpuThermalLimit NvThermalPoliciesGetLimit(int busId)
        {
            NvGpuThermalLimit info = new NvGpuThermalLimit();

            if (NvapiNativeMethods.NvThermalPoliciesGetLimit == null)
            {
                return(info);
            }
            try {
                if (!HandlesByBusId.TryGetValue(busId, out NvPhysicalGpuHandle handle))
                {
                    return(info);
                }
                info.version = (uint)(VERSION2 | (Marshal.SizeOf(typeof(NvGpuThermalLimit))));
                var r = NvapiNativeMethods.NvThermalPoliciesGetLimit(handle, ref info);
                if (r != NvStatus.NVAPI_OK)
                {
                    NTMinerConsole.DevError(() => $"{nameof(NvapiNativeMethods.NvThermalPoliciesGetLimit)} {r.ToString()}");
                }
                if (r == NvStatus.NVAPI_OK)
                {
                    return(info);
                }
            }
            catch {
            }
            return(info);
        }
Exemple #3
0
        private NvGpuThermalLimit NvThermalPoliciesGetLimit(int busId)
        {
            NvGpuThermalLimit info = new NvGpuThermalLimit();

            if (NvapiNativeMethods.NvThermalPoliciesGetLimit == null)
            {
                return(info);
            }
            try {
                info.version = (uint)(VERSION2 | (Marshal.SizeOf(typeof(NvGpuThermalLimit))));
                var r = NvapiNativeMethods.NvThermalPoliciesGetLimit(HandlesByBusId[busId], ref info);
                if (r != NvStatus.OK)
                {
                    Write.DevError($"{nameof(NvapiNativeMethods.NvThermalPoliciesGetLimit)} {r}");
                }
                if (r == NvStatus.OK)
                {
                    return(info);
                }
            }
            catch {
            }
            return(info);
        }