Skip to content

Commit

Permalink
Add per core Curve Optimiser for CZN and RMB APUs
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesCJ60 committed Jan 11, 2023
1 parent 6313c96 commit b203a04
Show file tree
Hide file tree
Showing 7 changed files with 259 additions and 13 deletions.
6 changes: 6 additions & 0 deletions App.config
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@
<setting name="StartUp" serializeAs="String">
<value>0</value>
</setting>
<setting name="isPerCO" serializeAs="String">
<value>False</value>
</setting>
<setting name="PerCOCCD1" serializeAs="String">
<value>5,5,5,5,5,5,5,5</value>
</setting>
</UXTU.Properties.Settings>
<AATUV3.Properties.Settings>
<setting name="AATUVersion" serializeAs="String">
Expand Down
100 changes: 89 additions & 11 deletions Pages/ClockControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,23 +100,91 @@
<StackPanel Margin="0,6,0,0">
<Label Content="Curve Optimiser Settings:" FontSize="18" Foreground="White"/>
<StackPanel Orientation="Horizontal" Margin="20,6,0,0">
<CheckBox Name="cbCOCPU" Content="CPU:" Foreground="White" BorderBrush="White" FontSize="16" Height="18" Width="150" BorderThickness="0,1,1,1" Padding="8,-4,0,0"/>
<CheckBox Name="cbCOCPU" Content="All Core:" Foreground="White" BorderBrush="White" FontSize="16" Height="18" Width="150" BorderThickness="0,1,1,1" Padding="8,-4,0,0" Click="cbCOCPU_Click"/>
<Controls:NumericSpinner x:Name="nudCOCPU" Width="95" Height="22" MinValue="-999" Value="0" MaxValue="30" Step="1"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="20,3,0,0">
<CheckBox Name="cbCOIGPU" Content="iGPU:" Foreground="White" BorderBrush="White" FontSize="16" Height="18" Width="150" BorderThickness="0,1,1,1" Padding="8,-4,0,0"/>
<Controls:NumericSpinner x:Name="nudCOIGPU" Width="95" Height="22" MinValue="-999" Value="0" MaxValue="30" Step="1"/>
</StackPanel>
</StackPanel>
<StackPanel Margin="0,16,0,0">
<CheckBox Name="cbdGPUCore" Content="NVIDIA dGPU Offset Settings:" FontSize="17.2" Foreground="White" BorderThickness="0,1,1,1" Padding="4,-4,0,0" Margin="3,0,0,0" />
<StackPanel Orientation="Horizontal" Margin="20,2,0,0">
<Label Content="Core Clock:" Foreground="White" BorderBrush="White" FontSize="16" Height="auto" Width="150" />
<Controls:NumericSpinner x:Name="nuddGPUCore" Width="95" Height="22" MinValue="-500" Value="0" Step="25"/>

<StackPanel Orientation="Horizontal" Margin="20,3,0,0">
<CheckBox Name="cbCOPerCPU" Content="Per-core:" Foreground="White" BorderBrush="White" FontSize="16" Height="18" Width="150" BorderThickness="0,1,1,1" Padding="8,-4,0,0" Click="cbCOPer_Click" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="20,-5,0,0">
<Label Content="Memory Clock:" Foreground="White" BorderBrush="White" FontSize="16" Height="auto" Width="150"/>
<Controls:NumericSpinner x:Name="nuddGPUMem" Width="95" Height="22" MinValue="-700" Value="0" Step="25"/>

<StackPanel Name="COCCD1">
<StackPanel Orientation="Horizontal" Margin="20,8,0,0">
<TextBlock Foreground="White" FontSize="16">CCD1:</TextBlock>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="40,0,0,0">
<TextBlock Text="Core 1:" Foreground="White" FontSize="16" Height="18" Width="130"/>
<Controls:NumericSpinner x:Name="nudCCD1C1" Width="95" Height="22" MinValue="-999" Value="0" MaxValue="30" Step="1"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="40,6,0,0">
<TextBlock Text="Core 2:" Foreground="White" FontSize="16" Height="18" Width="130"/>
<Controls:NumericSpinner x:Name="nudCCD1C2" Width="95" Height="22" MinValue="-999" Value="0" MaxValue="30" Step="1"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="40,6,0,0">
<TextBlock Text="Core 3:" Foreground="White" FontSize="16" Height="18" Width="130"/>
<Controls:NumericSpinner x:Name="nudCCD1C3" Width="95" Height="22" MinValue="-999" Value="0" MaxValue="30" Step="1"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="40,6,0,0">
<TextBlock Text="Core 4:" Foreground="White" FontSize="16" Height="18" Width="130"/>
<Controls:NumericSpinner x:Name="nudCCD1C4" Width="95" Height="22" MinValue="-999" Value="0" MaxValue="30" Step="1"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="40,6,0,0">
<TextBlock Text="Core 5:" Foreground="White" FontSize="16" Height="18" Width="130"/>
<Controls:NumericSpinner x:Name="nudCCD1C5" Width="95" Height="22" MinValue="-999" Value="0" MaxValue="30" Step="1"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="40,6,0,0">
<TextBlock Text="Core 6:" Foreground="White" FontSize="16" Height="18" Width="130"/>
<Controls:NumericSpinner x:Name="nudCCD1C6" Width="95" Height="22" MinValue="-999" Value="0" MaxValue="30" Step="1"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="40,6,0,0">
<TextBlock Text="Core 7:" Foreground="White" FontSize="16" Height="18" Width="130"/>
<Controls:NumericSpinner x:Name="nudCCD1C7" Width="95" Height="22" MinValue="-999" Value="0" MaxValue="30" Step="1"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="40,6,0,0">
<TextBlock Text="Core 8:" Foreground="White" FontSize="16" Height="18" Width="130"/>
<Controls:NumericSpinner x:Name="nudCCD1C8" Width="95" Height="22" MinValue="-999" Value="0" MaxValue="30" Step="1"/>
</StackPanel>
</StackPanel>
<StackPanel Name="COCCD2" Visibility="Collapsed">
<StackPanel Orientation="Horizontal" Margin="20,8,0,0">
<TextBlock Foreground="White" FontSize="16">CCD2:</TextBlock>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="40,0,0,0">
<TextBlock Text="Core 1:" Foreground="White" FontSize="16" Height="18" Width="130"/>
<Controls:NumericSpinner x:Name="nudCCD2C1" Width="95" Height="22" MinValue="-999" Value="0" MaxValue="30" Step="1"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="40,6,0,0">
<TextBlock Text="Core 2:" Foreground="White" FontSize="16" Height="18" Width="130"/>
<Controls:NumericSpinner x:Name="nudCCD2C2" Width="95" Height="22" MinValue="-999" Value="0" MaxValue="30" Step="1"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="40,6,0,0">
<TextBlock Text="Core 3:" Foreground="White" FontSize="16" Height="18" Width="130"/>
<Controls:NumericSpinner x:Name="nudCCD2C3" Width="95" Height="22" MinValue="-999" Value="0" MaxValue="30" Step="1"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="40,6,0,0">
<TextBlock Text="Core 4:" Foreground="White" FontSize="16" Height="18" Width="130"/>
<Controls:NumericSpinner x:Name="nudCCD2C4" Width="95" Height="22" MinValue="-999" Value="0" MaxValue="30" Step="1"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="40,6,0,0">
<TextBlock Text="Core 5:" Foreground="White" FontSize="16" Height="18" Width="130"/>
<Controls:NumericSpinner x:Name="nudCCD2C5" Width="95" Height="22" MinValue="-999" Value="0" MaxValue="30" Step="1"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="40,6,0,0">
<TextBlock Text="Core 6:" Foreground="White" FontSize="16" Height="18" Width="130"/>
<Controls:NumericSpinner x:Name="nudCCD2C6" Width="95" Height="22" MinValue="-999" Value="0" MaxValue="30" Step="1"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="40,6,0,0">
<TextBlock Text="Core 7:" Foreground="White" FontSize="16" Height="18" Width="130"/>
<Controls:NumericSpinner x:Name="nudCCD2C7" Width="95" Height="22" MinValue="-999" Value="0" MaxValue="30" Step="1"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="40,6,0,0">
<TextBlock Text="Core 8:" Foreground="White" FontSize="16" Height="18" Width="130"/>
<Controls:NumericSpinner x:Name="nudCCD2C8" Width="95" Height="22" MinValue="-999" Value="0" MaxValue="30" Step="1"/>
</StackPanel>
</StackPanel>
</StackPanel>
</StackPanel>
Expand Down Expand Up @@ -166,7 +234,17 @@
</StackPanel>
</StackPanel>
</StackPanel>

<StackPanel Margin="0,16,0,0">
<CheckBox Name="cbdGPUCore" Content="NVIDIA dGPU Offset Settings:" FontSize="17.2" Foreground="White" BorderThickness="0,1,1,1" Padding="4,-4,0,0" Margin="3,0,0,0" />
<StackPanel Orientation="Horizontal" Margin="20,2,0,0">
<Label Content="Core Clock:" Foreground="White" BorderBrush="White" FontSize="16" Height="auto" Width="150" />
<Controls:NumericSpinner x:Name="nuddGPUCore" Width="95" Height="22" MinValue="-500" Value="0" Step="25"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="20,-5,0,0">
<Label Content="Memory Clock:" Foreground="White" BorderBrush="White" FontSize="16" Height="auto" Width="150"/>
<Controls:NumericSpinner x:Name="nuddGPUMem" Width="95" Height="22" MinValue="-700" Value="0" Step="25"/>
</StackPanel>
</StackPanel>
</StackPanel>
</DockPanel>
</ScrollViewer>
Expand Down
97 changes: 97 additions & 0 deletions Pages/ClockControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
using System.Diagnostics;
using LibreHardwareMonitor.Hardware;
using System.Security.Cryptography;
using Stopbyte.Controls;

namespace AATUV3.Pages
{
Expand Down Expand Up @@ -49,6 +50,7 @@ public ClockControl()
cbCOIGPU.IsChecked = Settings.Default.isGPUCO;
cbdGPUCore.IsChecked = Settings.Default.isNV;
cbiGPU.IsChecked = Settings.Default.isiGPUClk;
cbCOPerCPU.IsChecked = Settings.Default.isPerCO;

cbRaddGPUCore.IsChecked = Settings.Default.isRadOC;

Expand All @@ -58,6 +60,35 @@ public ClockControl()
else if (Settings.Default.RadOption == 3) rbOCVRAM.IsChecked = true;
else if (Settings.Default.RadOption == 4) rbMan.IsChecked = true;

string CCD1 = Settings.Default.PerCOCCD1;
string[] CCD1Array = CCD1.Split(',');
NumericSpinner[] nudCCD1 = { nudCCD1C1, nudCCD1C2, nudCCD1C3, nudCCD1C4, nudCCD1C5, nudCCD1C6, nudCCD1C7, nudCCD1C8 };
int x = 0;
do
{
nudCCD1[x].Value = Convert.ToInt32(CCD1Array[x]);

x++;
} while (x < 8);

if(Families.FAMID > 6 && Families.FAMID < 9)
{
cbCOPerCPU.Visibility= Visibility.Visible;
}
else
{
cbCOPerCPU.Visibility = Visibility.Collapsed;
}

if(cbCOPerCPU.IsChecked == true)
{
COCCD1.Visibility = Visibility.Visible;
}
else
{
COCCD1.Visibility = Visibility.Collapsed;
}

//GetPowerInfo();
//getGPURange();
//getVRAMInfo();
Expand Down Expand Up @@ -133,6 +164,39 @@ private async void Apply_Click(object sender, RoutedEventArgs e)
i++;
}

NumericSpinner[] CCD1 = { nudCCD1C1, nudCCD1C2, nudCCD1C3, nudCCD1C4, nudCCD1C5, nudCCD1C6, nudCCD1C7, nudCCD1C8 };

if (cbCOPerCPU.IsChecked == true)
{
int x = 0;
do
{
int CCD, CCX, CORE, magnitude;

CCD = 0;
CCX = 0;
CORE = x + 1;

magnitude = (int)CCD1[x].Value;

if (magnitude >= 0)
{
uint CO = Convert.ToUInt32(((CCD << 4 | CCX % 1 & 15) << 4 | CORE % 8 & 15) << 20 | magnitude & 0xFFFFF);
SendCommand.set_coper(CO);
}
else
{
uint CO = Convert.ToUInt32(((CCD << 4 | CCX % 1 & 15) << 4 | CORE % 8 & 15) << 20 | (0x100000 - magnitude) & 0xFFFFF);
SendCommand.set_coper(CO);
}


x++;
} while (x < 8);
i++;
}


if (cbCOIGPU.IsChecked == true)
{
if (nudCOCPU.Value >= 0)
Expand Down Expand Up @@ -212,15 +276,20 @@ private async void Apply_Click(object sender, RoutedEventArgs e)
BasicExeBackend.ApplySettings("\\bin\\Notification.exe", "1 Settings-Applied! Your-settings-have-been-applied-successfully.", false);
}

string CCD1output = $"{CCD1[0].Value},{CCD1[1].Value},{CCD1[2].Value},{CCD1[3].Value},{CCD1[4].Value},{CCD1[5].Value},{CCD1[6].Value},{CCD1[7].Value}";

Settings.Default.isAllCoreCLK = (bool)cbCoreClock.IsChecked;
Settings.Default.isVID = (bool)cbCoreVolt.IsChecked;
Settings.Default.isBUS = (bool)cbBus.IsChecked;
Settings.Default.isCPUCO = (bool)cbCOCPU.IsChecked;
Settings.Default.isPerCO = (bool)cbCOPerCPU.IsChecked;
Settings.Default.isGPUCO = (bool)cbCOIGPU.IsChecked;
Settings.Default.isNV = (bool)cbdGPUCore.IsChecked;
Settings.Default.isiGPUClk = (bool)cbiGPU.IsChecked;
Settings.Default.isRadOC = (bool)cbRaddGPUCore.IsChecked;

Settings.Default.PerCOCCD1 = CCD1output;

if (rbFactory.IsChecked == true) Settings.Default.RadOption = 0;
else if (rbUVGPU.IsChecked == true) Settings.Default.RadOption = 1;
else if (rbOCGPU.IsChecked == true) Settings.Default.RadOption = 2;
Expand All @@ -236,6 +305,34 @@ private void rbMan_Unchecked(object sender, RoutedEventArgs e)
spManual.Visibility = Visibility.Collapsed;
}

private void cbCOCPU_Click(object sender, RoutedEventArgs e)
{
if(cbCOCPU.IsChecked == true) cbCOPerCPU.IsChecked = false;

if (cbCOPerCPU.IsChecked == true)
{
COCCD1.Visibility = Visibility.Visible;
}
else
{
COCCD1.Visibility = Visibility.Collapsed;
}
}

private void cbCOPer_Click(object sender, RoutedEventArgs e)
{
if (cbCOPerCPU.IsChecked == true) cbCOCPU.IsChecked = false;

if (cbCOPerCPU.IsChecked == true)
{
COCCD1.Visibility = Visibility.Visible;
}
else
{
COCCD1.Visibility = Visibility.Collapsed;
}
}

private void rbMan_Checked(object sender, RoutedEventArgs e)
{
spManual.Visibility = Visibility.Visible;
Expand Down
2 changes: 1 addition & 1 deletion Pages/HomeMenu.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<RadioButton Style="{DynamicResource ButtonWithIcon}" Tag="{DynamicResource GitHub}" Margin="440,397,160,33" FontSize="20" Foreground="White" Content="Latest Releases" Height="70" Width="250" Click="Releases_Click"/>
<TextBlock Foreground="White" FontSize="16" Margin="1,0,0,-1.5" HorizontalAlignment="Left" VerticalAlignment="Bottom">

<Run Text="Universal x86 Tuning Utility - V1.0.0 Beta Build 9.3"/>
<Run Text="Universal x86 Tuning Utility - V1.0.0 Beta Build 9.4"/>
<LineBreak/>
<Run Text="Created by JamesCJ, sbski, and ProjectSBC"/>
</TextBlock>
Expand Down
Loading

0 comments on commit b203a04

Please sign in to comment.