Beispiel #1
0
        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);
            }
        }
Beispiel #2
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 {
            }
        }
Beispiel #3
0
        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);
            }
        }
Beispiel #4
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)
                {
                    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);
            }
        }