Esempio n. 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
        }
Esempio n. 2
0
        private void OverClock(INTMinerContext root, IGpuProfile data)
        {
#if DEBUG
            NTStopwatch.Start();
#endif
            if (root.GpuSet.TryGetGpu(data.Index, out IGpu gpu))
            {
                // fanSpeed == -1表示开源自动温控
                int fanSpeed = data.IsAutoFanSpeed ? -1 : data.Cool;
                root.GpuSet.OverClock.OverClock(data.Index, data.CoreClockDelta, data.CoreVoltage, data.MemoryClockDelta,
                                                data.MemoryVoltage, data.PowerCapacity, data.TempLimit, fanSpeed);
                if (data.Index == NTMinerContext.GpuAllId)
                {
                    NTMinerConsole.UserOk($"统一超频:{data.ToOverClockString()}");
                }
                else
                {
                    NTMinerConsole.UserOk($"GPU{gpu.Index}超频:{data.ToOverClockString()}");
                }
                2.SecondsDelay().ContinueWith(t => {
                    root.GpuSet.OverClock.RefreshGpuState(data.Index);
                });
            }
#if DEBUG
            var elapsedMilliseconds = NTStopwatch.Stop();
            if (elapsedMilliseconds.ElapsedMilliseconds > NTStopwatch.ElapsedMilliseconds)
            {
                NTMinerConsole.DevTimeSpan($"耗时{elapsedMilliseconds} {this.GetType().Name}.{nameof(OverClock)}");
            }
#endif
        }
Esempio n. 3
0
        private void OverClock(INTMinerContext ntminerContext, IGpuProfile data)
        {
#if DEBUG
            NTStopwatch.Start();
#endif
            if (ntminerContext.GpuSet.TryGetGpu(data.Index, out IGpu gpu))
            {
                ntminerContext.GpuSet.OverClock.OverClock(gpuIndex: data.Index, OverClockValue.Create(data));
                if (data.Index == NTMinerContext.GpuAllId)
                {
                    NTMinerConsole.UserOk($"统一超频:{data.ToOverClockString()}");
                }
                else
                {
                    NTMinerConsole.UserOk($"GPU{gpu.Index}超频:{data.ToOverClockString()}");
                }
                2.SecondsDelay().ContinueWith(t => {
                    ntminerContext.GpuSet.OverClock.RefreshGpuState(data.Index);
                });
            }
#if DEBUG
            var elapsedMilliseconds = NTStopwatch.Stop();
            if (elapsedMilliseconds.ElapsedMilliseconds > NTStopwatch.ElapsedMilliseconds)
            {
                NTMinerConsole.DevTimeSpan($"耗时{elapsedMilliseconds} {this.GetType().Name}.{nameof(OverClock)}");
            }
#endif
        }
Esempio n. 4
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
        }