示例#1
0
        private void OverClock(INTMinerRoot root, IGpuProfile data)
        {
#if DEBUG
            Write.Stopwatch.Restart();
#endif
            if (root.GpuSet.TryGetGpu(data.Index, out IGpu gpu))
            {
                IOverClock overClock = root.GpuSet.OverClock;
                if (!data.IsAutoFanSpeed)
                {
                    overClock.SetFanSpeed(data.Index, data.Cool);
                }
                overClock.SetCoreClock(data.Index, data.CoreClockDelta, data.CoreVoltage);
                overClock.SetMemoryClock(data.Index, data.MemoryClockDelta, data.MemoryVoltage);
                overClock.SetPowerLimit(data.Index, data.PowerCapacity);
                overClock.SetTempLimit(data.Index, data.TempLimit);
                if (data.Index == NTMinerRoot.GpuAllId)
                {
                    Write.UserOk($"统一超频:{data.ToOverClockString()}");
                }
                else
                {
                    Write.UserOk($"GPU{gpu.Index}超频:{data.ToOverClockString()}");
                }
                overClock.RefreshGpuState(data.Index);
            }
#if DEBUG
            Write.DevTimeSpan($"耗时{Write.Stopwatch.ElapsedMilliseconds}毫秒 {this.GetType().Name}.OverClock");
#endif
        }
示例#2
0
        private void OverClock(INTMinerContext root, IGpuProfile data)
        {
#if DEBUG
            NTStopwatch.Start();
#endif
            if (root.GpuSet.TryGetGpu(data.Index, out IGpu gpu))
            {
                IOverClock overClock = root.GpuSet.OverClock;
                if (!data.IsAutoFanSpeed)
                {
                    overClock.SetFanSpeed(data.Index, data.Cool);
                }
                overClock.SetCoreClock(data.Index, data.CoreClockDelta, data.CoreVoltage);
                overClock.SetMemoryClock(data.Index, data.MemoryClockDelta, data.MemoryVoltage);
                overClock.SetPowerLimit(data.Index, data.PowerCapacity);
                overClock.SetTempLimit(data.Index, data.TempLimit);
                if (data.Index == NTMinerContext.GpuAllId)
                {
                    NTMinerConsole.UserOk($"统一超频:{data.ToOverClockString()}");
                }
                else
                {
                    NTMinerConsole.UserOk($"GPU{gpu.Index}超频:{data.ToOverClockString()}");
                }
                1.SecondsDelay().ContinueWith(t => {
                    overClock.RefreshGpuState(data.Index);
                });
            }
#if DEBUG
            var elapsedMilliseconds = NTStopwatch.Stop();
            if (elapsedMilliseconds.ElapsedMilliseconds > NTStopwatch.ElapsedMilliseconds)
            {
                NTMinerConsole.DevTimeSpan($"耗时{elapsedMilliseconds} {this.GetType().Name}.OverClock");
            }
#endif
        }