private static bool NvThermalPoliciesSetLimit(int busId, ref NvGpuThermalLimit info) { if (NvapiNativeMethods.NvThermalPoliciesSetLimit == null) { return(false); } try { if (!HandlesByBusId.TryGetValue(busId, out NvPhysicalGpuHandle handle)) { return(false); } var r = NvapiNativeMethods.NvThermalPoliciesSetLimit(handle, ref info); if (r != NvStatus.NVAPI_OK) { NTMinerConsole.DevError(() => $"{nameof(NvapiNativeMethods.NvThermalPoliciesSetLimit)} {r.ToString()}"); } if (r == NvStatus.NVAPI_OK) { return(true); } } catch { } return(false); }
private bool NvThermalPoliciesSetLimit(int busId, ref NvGpuThermalLimit info) { if (NvapiNativeMethods.NvThermalPoliciesSetLimit == null) { return(false); } try { if (!HandlesByBusId.TryGetValue(busId, out NvPhysicalGpuHandle handle)) { return(false); } info.version = (uint)(VERSION2 | (Marshal.SizeOf(typeof(NvGpuThermalLimit)))); var r = NvapiNativeMethods.NvThermalPoliciesSetLimit(handle, ref info); if (r != NvStatus.NVAPI_OK) { Write.DevError($"{nameof(NvapiNativeMethods.NvThermalPoliciesSetLimit)} {r.ToString()}"); } if (r == NvStatus.NVAPI_OK) { return(true); } } catch { } return(false); }
private bool NvThermalPoliciesSetLimit(int busId, ref NvGpuThermalLimit info) { if (NvapiNativeMethods.NvThermalPoliciesSetLimit == null) { return(false); } try { info.version = (uint)(VERSION2 | (Marshal.SizeOf(typeof(NvGpuThermalLimit)))); var r = NvapiNativeMethods.NvThermalPoliciesSetLimit(HandlesByBusId[busId], ref info); if (r != NvStatus.OK) { Write.DevError($"{nameof(NvapiNativeMethods.NvThermalPoliciesSetLimit)} {r}"); } if (r == NvStatus.OK) { return(true); } } catch { } return(false); }