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 GpuViewModel(GpuData gpuData, GpuData[] gpuDatas) { if (gpuData == null) { throw new System.ArgumentNullException(nameof(gpuData)); } if (gpuDatas == null) { throw new System.ArgumentNullException(nameof(gpuDatas)); } _isGpuData = true; _gpuDatas = gpuDatas.Where(a => a.Index != NTMinerRoot.GpuAllId).ToArray(); _overClock = new EmptyOverClock(); _index = gpuData.Index; _name = gpuData.Name; _temperature = 0; _fanSpeed = 0; _powerUsage = 0; _coreClockDelta = 0; _memoryClockDelta = 0; _coreClockDeltaMin = gpuData.CoreClockDeltaMin; _coreClockDeltaMax = gpuData.CoreClockDeltaMax; _memoryClockDeltaMin = gpuData.MemoryClockDeltaMin; _memoryClockDeltaMax = gpuData.MemoryClockDeltaMax; _cool = 0; _coolMin = gpuData.CoolMin; _coolMax = gpuData.CoolMax; _power = 0; _powerMin = gpuData.PowerMin; _powerMax = gpuData.PowerMax; }
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); }); }
public GpuViewModel(IGpu data) { _overClock = data.OverClock; _index = data.Index; _name = data.Name; _temperature = data.Temperature; _fanSpeed = data.FanSpeed; _powerUsage = data.PowerUsage; _coreClockDelta = data.CoreClockDelta; _memoryClockDelta = data.MemoryClockDelta; _coreClockDeltaMin = data.CoreClockDeltaMin; _coreClockDeltaMax = data.CoreClockDeltaMax; _memoryClockDeltaMin = data.MemoryClockDeltaMin; _memoryClockDeltaMax = data.MemoryClockDeltaMax; _cool = data.Cool; _coolMin = data.CoolMin; _coolMax = data.CoolMax; _power = data.Power; _powerMin = data.PowerMin; _powerMax = data.PowerMax; }
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 }