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 }
public static void OverClock(this IGpuProfile data, IOverClock overClock) { overClock.SetCoreClock(data); overClock.SetMemoryClock(data); overClock.SetPowerCapacity(data); overClock.SetCool(data); TimeSpan.FromSeconds(2).Delay().ContinueWith(t => { overClock.RefreshGpuState(data.Index); }); }
private void OverClock(INTMinerRoot root, IGpuProfile data) { if (root.GpuSet.TryGetGpu(data.Index, out IGpu gpu)) { IOverClock overClock = root.GpuSet.OverClock; HashSet <int> effectGpus = new HashSet <int>(); overClock.SetCoreClock(data.Index, data.CoreClockDelta, ref effectGpus); overClock.SetMemoryClock(data.Index, data.MemoryClockDelta, ref effectGpus); overClock.SetPowerCapacity(data.Index, data.PowerCapacity, ref effectGpus); overClock.SetThermCapacity(data.Index, data.TempLimit, ref effectGpus); if (!data.IsAutoFanSpeed) { overClock.SetCool(data.Index, data.Cool, ref effectGpus); } string coreClockText = "默认"; if (data.CoreClockDelta != 0) { coreClockText = data.CoreClockDelta.ToString(); } string memoryClockText = "默认"; if (data.MemoryClockDelta != 0) { memoryClockText = data.MemoryClockDelta.ToString(); } if (data.Index == NTMinerRoot.GpuAllId) { Write.UserLine($"统一超频:核心({coreClockText}),显存({memoryClockText}),功耗({data.PowerCapacity}),温度({data.TempLimit}),风扇({data.Cool})", "超频", ConsoleColor.Yellow); } else { Write.UserLine($"GPU{gpu.Index}超频:核心({coreClockText}),显存({memoryClockText}),功耗({data.PowerCapacity}),温度({data.TempLimit}),风扇({data.Cool})", "超频", ConsoleColor.Yellow); } TimeSpan.FromSeconds(2).Delay().ContinueWith(t => { foreach (var gpuIndex in effectGpus) { overClock.RefreshGpuState(gpuIndex); } }); } }
private void OverClock(INTMinerRoot root, IGpuProfile data) { if (root.GpuSet.TryGetGpu(data.Index, out IGpu gpu)) { IOverClock overClock = root.GpuSet.OverClock; HashSet <int> effectGpus = new HashSet <int>(); overClock.SetCoreClock(data.Index, data.CoreClockDelta, ref effectGpus); overClock.SetMemoryClock(data.Index, data.MemoryClockDelta, ref effectGpus); overClock.SetPowerCapacity(data.Index, data.PowerCapacity, ref effectGpus); overClock.SetThermCapacity(data.Index, data.TempLimit, ref effectGpus); if (!data.IsAutoFanSpeed) { overClock.SetCool(data.Index, data.Cool, ref effectGpus); } TimeSpan.FromSeconds(2).Delay().ContinueWith(t => { foreach (var gpuIndex in effectGpus) { overClock.RefreshGpuState(gpuIndex); } }); } }
private void OverClock(INTMinerRoot root, IGpuProfile data) { if (root.GpuSet.TryGetGpu(data.Index, out IGpu gpu)) { IOverClock overClock = root.GpuSet.OverClock; if (!data.IsAutoFanSpeed) { overClock.SetCool(data.Index, data.Cool); } overClock.SetCoreClock(data.Index, data.CoreClockDelta); overClock.SetMemoryClock(data.Index, data.MemoryClockDelta); overClock.SetPowerCapacity(data.Index, data.PowerCapacity); overClock.SetThermCapacity(data.Index, data.TempLimit); string coreClockText = "默认"; if (data.CoreClockDelta != 0) { coreClockText = data.CoreClockDelta.ToString(); } string memoryClockText = "默认"; if (data.MemoryClockDelta != 0) { memoryClockText = data.MemoryClockDelta.ToString(); } if (data.Index == NTMinerRoot.GpuAllId) { Write.UserLine($"统一超频:核心({coreClockText}),显存({memoryClockText}),功耗({data.PowerCapacity}),温度({data.TempLimit}),风扇({data.Cool})", "超频", ConsoleColor.Yellow); } else { Write.UserLine($"GPU{gpu.Index}超频:核心({coreClockText}),显存({memoryClockText}),功耗({data.PowerCapacity}),温度({data.TempLimit}),风扇({data.Cool})", "超频", ConsoleColor.Yellow); } if (root.GpuSet.GpuType == GpuType.AMD) { overClock.RefreshGpuState(data.Index); } } }
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 }