public int GetTempLimitByIndex(int gpuIndex) { int adapterIndex = GpuIndexToAdapterIndex(gpuIndex); ADLODNPowerLimitSetting lpODPowerLimit = new ADLODNPowerLimitSetting(); try { int result = ADL.ADL2_OverdriveN_PowerLimit_Get(context, adapterIndex, ref lpODPowerLimit); if (result == ADL.ADL_OK) { return(lpODPowerLimit.iMaxOperatingTemperature); } return(0); } catch { return(0); } }
public void SetTempLimitByIndex(int gpuIndex, int value) { int adapterIndex = GpuIndexToAdapterIndex(gpuIndex); ADLODNPowerLimitSetting lpODPowerLimit = new ADLODNPowerLimitSetting(); try { int result = ADL.ADL2_OverdriveN_PowerLimit_Get(context, adapterIndex, ref lpODPowerLimit); if (result == ADL.ADL_OK) { lpODPowerLimit.iMode = ADL.ODNControlType_Manual; lpODPowerLimit.iMaxOperatingTemperature = value; ADL.ADL2_OverdriveN_PowerLimit_Set(context, adapterIndex, ref lpODPowerLimit); } } catch { } }
public void SetPowerLimitByIndex(int gpuIndex, int value) { int adapterIndex = GpuIndexToAdapterIndex(gpuIndex); ADLODNPowerLimitSetting lpODPowerLimit = new ADLODNPowerLimitSetting(); try { int result = ADL.ADL2_OverdriveN_PowerLimit_Get(context, adapterIndex, ref lpODPowerLimit); #if DEBUG Write.DevWarn($"ADL2_OverdriveN_PowerLimit_Get result={result},iMode={lpODPowerLimit.iMode},iTDPLimit={lpODPowerLimit.iTDPLimit},iMaxOperatingTemperature={lpODPowerLimit.iMaxOperatingTemperature}"); #endif if (result == ADL.ADL_OK) { lpODPowerLimit.iMode = ADL.ODNControlType_Manual; lpODPowerLimit.iTDPLimit = value - 100; ADL.ADL2_OverdriveN_PowerLimit_Set(context, adapterIndex, ref lpODPowerLimit); } } catch (Exception e) { Logger.ErrorDebugLine(e); } }
public void SetTempLimitByIndex(int gpuIndex, int value) { int adapterIndex = GpuIndexToAdapterIndex(gpuIndex); ADLODNPowerLimitSetting lpODPowerLimit = new ADLODNPowerLimitSetting(); try { int result = ADL.ADL2_OverdriveN_PowerLimit_Get(context, adapterIndex, ref lpODPowerLimit); if (result == ADL.ADL_OK) { if (value == 0) { ADLODNCapabilitiesX2 lpODCapabilities = new ADLODNCapabilitiesX2(); result = ADL.ADL2_OverdriveN_CapabilitiesX2_Get(context, adapterIndex, ref lpODCapabilities); value = lpODCapabilities.powerTuneTemperature.iDefault; } lpODPowerLimit.iMode = ADL.ODNControlType_Manual; lpODPowerLimit.iMaxOperatingTemperature = value; ADL.ADL2_OverdriveN_PowerLimit_Set(context, adapterIndex, ref lpODPowerLimit); } } catch (Exception e) { Logger.ErrorDebugLine(e); } }