mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Clocks fixes
This commit is contained in:
@@ -92,7 +92,7 @@ public static class ControlHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
var chk = control as CheckBox;
|
var chk = control as CheckBox;
|
||||||
if (chk != null && chk.Padding.Left > 5)
|
if (chk != null && chk.Padding.Right > 5)
|
||||||
{
|
{
|
||||||
chk.BackColor = RForm.buttonSecond;
|
chk.BackColor = RForm.buttonSecond;
|
||||||
}
|
}
|
||||||
|
|||||||
12
app/Fans.cs
12
app/Fans.cs
@@ -119,7 +119,8 @@ namespace GHelper
|
|||||||
|
|
||||||
private void TrackGPU_MouseUp(object? sender, MouseEventArgs e)
|
private void TrackGPU_MouseUp(object? sender, MouseEventArgs e)
|
||||||
{
|
{
|
||||||
Program.settingsForm.SetGPUSettings(true);
|
Program.settingsForm.SetGPUPower();
|
||||||
|
Program.settingsForm.SetGPUClocks(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void InitGPU(bool readClocks = false)
|
public void InitGPU(bool readClocks = false)
|
||||||
@@ -509,7 +510,14 @@ namespace GHelper
|
|||||||
trackGPUBoost.Value = ASUSWmi.MaxGPUBoost;
|
trackGPUBoost.Value = ASUSWmi.MaxGPUBoost;
|
||||||
trackGPUTemp.Value = ASUSWmi.MaxGPUTemp;
|
trackGPUTemp.Value = ASUSWmi.MaxGPUTemp;
|
||||||
|
|
||||||
Program.settingsForm.SetGPUSettings(true);
|
Program.config.setConfigPerf("gpu_boost", trackGPUBoost.Value);
|
||||||
|
Program.config.setConfigPerf("gpu_temp", trackGPUTemp.Value);
|
||||||
|
Program.config.setConfigPerf("gpu_core", trackGPUCore.Value);
|
||||||
|
Program.config.setConfigPerf("gpu_memory", trackGPUMemory.Value);
|
||||||
|
VisualiseGPUSettings();
|
||||||
|
|
||||||
|
Program.settingsForm.SetGPUClocks(true);
|
||||||
|
Program.settingsForm.SetGPUPower();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ChartCPU_MouseUp(object? sender, MouseEventArgs e)
|
private void ChartCPU_MouseUp(object? sender, MouseEventArgs e)
|
||||||
|
|||||||
@@ -95,8 +95,8 @@ public class NvidiaGpuControl : IGpuControl
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
Logger.WriteLine($"SET GPU Clock : {core}, {memory}");
|
||||||
GPUApi.SetPerformanceStates20(internalGpu.Handle, overclock);
|
GPUApi.SetPerformanceStates20(internalGpu.Handle, overclock);
|
||||||
Logger.WriteLine($"SET GPU Clock offsets : {core}, {memory}");
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1045,27 +1045,14 @@ namespace GHelper
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetGPUSettings(bool launchAsAdmin = true)
|
|
||||||
{
|
|
||||||
|
|
||||||
int gpu_boost = Program.config.getConfigPerf("gpu_boost");
|
public void SetGPUClocks(bool launchAsAdmin = true)
|
||||||
int gpu_temp = Program.config.getConfigPerf("gpu_temp");
|
{
|
||||||
|
|
||||||
int gpu_core = Program.config.getConfigPerf("gpu_core");
|
int gpu_core = Program.config.getConfigPerf("gpu_core");
|
||||||
int gpu_memory = Program.config.getConfigPerf("gpu_memory");
|
int gpu_memory = Program.config.getConfigPerf("gpu_memory");
|
||||||
|
|
||||||
if (gpu_boost < ASUSWmi.MinGPUBoost || gpu_boost > ASUSWmi.MaxGPUBoost ) return;
|
if (gpu_core == -1 && gpu_memory == -1) return;
|
||||||
if (gpu_temp < ASUSWmi.MinGPUTemp || gpu_temp > ASUSWmi.MaxGPUTemp) return;
|
|
||||||
|
|
||||||
if (Program.wmi.DeviceGet(ASUSWmi.PPT_GPUC0) >= 0)
|
|
||||||
{
|
|
||||||
Program.wmi.DeviceSet(ASUSWmi.PPT_GPUC0, gpu_boost, "PowerLimit C0");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Program.wmi.DeviceGet(ASUSWmi.PPT_GPUC2) >= 0)
|
|
||||||
{
|
|
||||||
Program.wmi.DeviceSet(ASUSWmi.PPT_GPUC2, gpu_temp, "PowerLimit C2");
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((gpu_core > -5 && gpu_core < 5) && (gpu_memory > -5 && gpu_memory < 5)) launchAsAdmin = false;
|
if ((gpu_core > -5 && gpu_core < 5) && (gpu_memory > -5 && gpu_memory < 5)) launchAsAdmin = false;
|
||||||
|
|
||||||
@@ -1082,7 +1069,27 @@ namespace GHelper
|
|||||||
Logger.WriteLine(ex.ToString());
|
Logger.WriteLine(ex.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetGPUPower()
|
||||||
|
{
|
||||||
|
|
||||||
|
int gpu_boost = Program.config.getConfigPerf("gpu_boost");
|
||||||
|
int gpu_temp = Program.config.getConfigPerf("gpu_temp");
|
||||||
|
|
||||||
|
|
||||||
|
if (gpu_boost < ASUSWmi.MinGPUBoost || gpu_boost > ASUSWmi.MaxGPUBoost ) return;
|
||||||
|
if (gpu_temp < ASUSWmi.MinGPUTemp || gpu_temp > ASUSWmi.MaxGPUTemp) return;
|
||||||
|
|
||||||
|
if (Program.wmi.DeviceGet(ASUSWmi.PPT_GPUC0) >= 0)
|
||||||
|
{
|
||||||
|
Program.wmi.DeviceSet(ASUSWmi.PPT_GPUC0, gpu_boost, "PowerLimit C0");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Program.wmi.DeviceGet(ASUSWmi.PPT_GPUC2) >= 0)
|
||||||
|
{
|
||||||
|
Program.wmi.DeviceSet(ASUSWmi.PPT_GPUC2, gpu_temp, "PowerLimit C2");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1159,14 +1166,14 @@ namespace GHelper
|
|||||||
timer.Stop();
|
timer.Stop();
|
||||||
timer.Dispose();
|
timer.Dispose();
|
||||||
if (applyPower) SetPower();
|
if (applyPower) SetPower();
|
||||||
SetGPUSettings();
|
SetGPUPower();
|
||||||
};
|
};
|
||||||
timer.Start();
|
timer.Start();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (applyPower) SetPower();
|
if (applyPower) SetPower();
|
||||||
SetGPUSettings();
|
SetGPUPower();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1221,6 +1228,8 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SetGPUClocks();
|
||||||
|
|
||||||
AutoFans();
|
AutoFans();
|
||||||
AutoPower(1000);
|
AutoPower(1000);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user