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