Ejemplo n.º 1
0
        public OverClockRange GetClockRange(int gpuIndex)
        {
            OverClockRange result = new OverClockRange(gpuIndex);

            try {
                if (!TryGpuAdapterIndex(gpuIndex, out int adapterIndex))
                {
                    return(result);
                }
                ADLODNCapabilitiesX2 info = new ADLODNCapabilitiesX2();
                var r = AdlNativeMethods.ADL2_OverdriveN_CapabilitiesX2_Get(context, adapterIndex, ref info);
                if (r < AdlStatus.ADL_OK)
                {
                    Write.DevError($"{nameof(AdlNativeMethods.ADL2_OverdriveN_CapabilitiesX2_Get)} {r}");
                    return(result);
                }
                result.PowerCurr = GetPowerLimit(gpuIndex);
                result.TempCurr  = GetTempLimit(gpuIndex);
                if (GetMemoryClock(gpuIndex, out int memoryClock, out int iVddc))
                {
                    result.MemoryClockDelta = memoryClock;
                    result.MemoryVoltage    = iVddc;
                }
                if (GetCoreClock(gpuIndex, out int coreClock, out iVddc))
                {
                    result.CoreClockDelta = coreClock;
                    result.CoreVoltage    = iVddc;
                }
                result.CoreClockMin     = info.sEngineClockRange.iMin * 10;
                result.CoreClockMax     = info.sEngineClockRange.iMax * 10;
                result.MemoryClockMin   = info.sMemoryClockRange.iMin * 10;
                result.MemoryClockMax   = info.sMemoryClockRange.iMax * 10;
                result.PowerMin         = info.power.iMin + 100;
                result.PowerMax         = info.power.iMax + 100;
                result.PowerDefault     = info.power.iDefault + 100;
                result.TempLimitMin     = info.powerTuneTemperature.iMin;
                result.TempLimitMax     = info.powerTuneTemperature.iMax;
                result.TempLimitDefault = info.powerTuneTemperature.iDefault;
                result.VoltMin          = info.svddcRange.iMin;
                result.VoltMax          = info.svddcRange.iMax;
                result.VoltDefault      = info.svddcRange.iDefault;
                if (info.fanSpeed.iMax == 0)
                {
                    result.FanSpeedMin = 0;
                }
                else
                {
                    result.FanSpeedMin = info.fanSpeed.iMin * 100 / info.fanSpeed.iMax;
                }
                result.FanSpeedMax     = 100;
                result.FanSpeedDefault = info.fanSpeed.iDefault;
#if DEBUG
                Write.DevWarn($"GetClockRange {result.ToString()}");
#endif
            }
            catch (Exception e) {
                Logger.ErrorDebugLine(e);
            }
            return(result);
        }
Ejemplo n.º 2
0
        public OverClockRange GetClockRange(IGpu gpu)
        {
            int            busId  = gpu.GetOverClockId();
            OverClockRange result = new OverClockRange(busId);

            try {
                if (GetClockDelta(busId,
                                  out int outCoreCurrFreqDelta, out int outCoreMinFreqDelta,
                                  out int outCoreMaxFreqDelta,
                                  out int outMemoryCurrFreqDelta, out int outMemoryMinFreqDelta,
                                  out int outMemoryMaxFreqDelta))
                {
                    result.CoreClockMin     = outCoreMinFreqDelta;
                    result.CoreClockMax     = outCoreMaxFreqDelta;
                    result.CoreClockDelta   = outCoreCurrFreqDelta;
                    result.MemoryClockMin   = outMemoryMinFreqDelta;
                    result.MemoryClockMax   = outMemoryMaxFreqDelta;
                    result.MemoryClockDelta = outMemoryCurrFreqDelta;
                    int voltage = GetVoltage(busId);
                    result.CoreVoltage   = voltage;
                    result.MemoryVoltage = voltage;
                    result.VoltMin       = 0;
                    result.VoltMax       = 0;
                }

                if (GetPowerLimit(busId, out uint outCurrPower, out uint outMinPower, out uint outDefPower, out uint outMaxPower))
                {
                    result.PowerMin     = (int)outMinPower;
                    result.PowerMax     = (int)outMaxPower;
                    result.PowerDefault = (int)outDefPower;
                    result.PowerCurr    = (int)outCurrPower;
                }

                if (GetTempLimit(busId, out int outCurrTemp, out int outMinTemp, out int outDefTemp, out int outMaxTemp))
                {
                    result.TempLimitMin     = outMinTemp;
                    result.TempLimitMax     = outMaxTemp;
                    result.TempLimitDefault = outDefTemp;
                    result.TempCurr         = outCurrTemp;
                }

                if (GetCooler(busId, out uint minCooler, out uint currCooler, out uint maxCooler))
                {
                    result.FanSpeedCurr = (int)currCooler;
                    result.FanSpeedMin  = (int)minCooler;
                    result.FanSpeedMax  = (int)maxCooler;
                }
#if DEBUG
                NTMinerConsole.DevWarn(() => $"GetClockRange {result.ToString()}");
#endif
            }
            catch (Exception e) {
                Logger.ErrorDebugLine(e);
            }
            return(result);
        }
Ejemplo n.º 3
0
        public OverClockRange GetClockRange(int busId)
        {
            OverClockRange result = new OverClockRange(busId);

            try {
                if (GetClockDelta(busId,
                                  out int outCoreCurrFreqDelta, out int outCoreMinFreqDelta, out int outCoreMaxFreqDelta,
                                  out int outMemoryCurrFreqDelta, out int outMemoryMinFreqDelta, out int outMemoryMaxFreqDelta))
                {
                    result.CoreClockMin     = outCoreMinFreqDelta;
                    result.CoreClockMax     = outCoreMaxFreqDelta;
                    result.CoreClockDelta   = outCoreCurrFreqDelta;
                    result.MemoryClockMin   = outMemoryMinFreqDelta;
                    result.MemoryClockMax   = outMemoryMaxFreqDelta;
                    result.MemoryClockDelta = outMemoryCurrFreqDelta;
                }

                if (GetPowerLimit(busId, out uint outCurrPower, out uint outMinPower, out uint outDefPower, out uint outMaxPower))
                {
                    result.PowerMin     = (int)outMinPower;
                    result.PowerMax     = (int)outMaxPower;
                    result.PowerDefault = (int)outDefPower;
                    result.PowerCurr    = (int)outCurrPower;
                }

                if (GetTempLimit(busId, out int outCurrTemp, out int outMinTemp, out int outDefTemp, out int outMaxTemp))
                {
                    result.TempLimitMin     = outMinTemp;
                    result.TempLimitMax     = outMaxTemp;
                    result.TempLimitDefault = outDefTemp;
                    result.TempCurr         = outCurrTemp;
                }

                if (GetCooler(busId, out uint currCooler, out uint minCooler, out uint defCooler, out uint maxCooler))
                {
                    result.FanSpeedCurr    = (int)currCooler;
                    result.FanSpeedMin     = (int)minCooler;
                    result.FanSpeedMax     = (int)maxCooler;
                    result.FanSpeedDefault = (int)defCooler;
                }
#if DEBUG
                Write.DevWarn($"GetClockRange {result.ToString()}");
#endif
            }
            catch (Exception e) {
                Logger.ErrorDebugLine(e);
            }
            return(result);
        }
Ejemplo n.º 4
0
        public OverClockRange GetClockRange(int gpuIndex)
        {
            OverClockRange result = new OverClockRange(gpuIndex);

            try {
                if (!TryGetAtiGpu(gpuIndex, out ATIGPU gpuInfo))
                {
                    return(result);
                }
                GetTempLimitAndPowerLimit(gpuIndex, out int powerLimit, out int tempLimit);
                GetClockAndVolt(gpuIndex, out int memoryClock, out int memoryiVddc, out int coreClock, out int coreiVddc);
                result.PowerCurr        = powerLimit;
                result.TempCurr         = tempLimit;
                result.MemoryClockDelta = memoryClock;
                result.MemoryVoltage    = memoryiVddc;
                result.CoreClockDelta   = coreClock;
                result.CoreVoltage      = coreiVddc;
                result.CoreClockMin     = gpuInfo.CoreClockMin;
                result.CoreClockMax     = gpuInfo.CoreClockMax;
                result.MemoryClockMin   = gpuInfo.MemoryClockMin;
                result.MemoryClockMax   = gpuInfo.MemoryClockMax;
                result.PowerMin         = gpuInfo.PowerMin;
                result.PowerMax         = gpuInfo.PowerMax;
                result.PowerDefault     = gpuInfo.PowerDefault;
                result.TempLimitMin     = gpuInfo.TempLimitMin;
                result.TempLimitMax     = gpuInfo.TempLimitMax;
                result.TempLimitDefault = gpuInfo.TempLimitDefault;
                result.VoltMin          = gpuInfo.VoltMin;
                result.VoltMax          = gpuInfo.VoltMax;
                result.VoltDefault      = gpuInfo.VoltDefault;
                result.FanSpeedMin      = gpuInfo.FanSpeedMin;
                result.FanSpeedMax      = gpuInfo.FanSpeedMax;
#if DEBUG
                NTMinerConsole.DevDebug(() => $"GetClockRange {result.ToString()}");
#endif
            }
            catch (Exception e) {
                Logger.ErrorDebugLine(e);
            }
            return(result);
        }