Skip to content

Commit

Permalink
Add FIVR voltage and power balance control for Intel CPUs
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesCJ60 committed Aug 13, 2024
1 parent 78950e7 commit 4cfb8e2
Show file tree
Hide file tree
Showing 5 changed files with 208 additions and 9 deletions.
10 changes: 5 additions & 5 deletions Universal x86 Tuning Utility/Scripts/PremadePresets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public static void SetPremadePresets()
{
EcoPreset = "--tctl-temp=95 --ppt-limit=65000 --edc-limit=90000 --tdc-limit=90000 ";
BalPreset = "--tctl-temp=95 --ppt-limit=95000 --edc-limit=130000 --tdc-limit=130000 ";
PerformancePreset = "--tctl-temp=95 --ppt-limit=125000 --edc-limit=142 --tdc-limit=142000 ";
PerformancePreset = "--tctl-temp=95 --ppt-limit=125000 --edc-limit=142000 --tdc-limit=142000 ";
ExtremePreset = "--tctl-temp=95 --ppt-limit=170000 --edc-limit=230000 --tdc-limit=230000 ";
}
else if (cpuName.Contains("X"))
Expand All @@ -194,10 +194,10 @@ public static void SetPremadePresets()
}
else
{
EcoPreset = "--tctl-temp=95 --ppt-limit=45 --edc-limit=90 --tdc-limit=90 ";
BalPreset = "--tctl-temp=95 --ppt-limit=65 --edc-limit=90 --tdc-limit=90 ";
PerformancePreset = "--tctl-temp=95 --ppt-limit=88 --edc-limit=125 --tdc-limit=125 ";
ExtremePreset = "--tctl-temp=95 --ppt-limit=105 --edc-limit=142 --tdc-limit=142 ";
EcoPreset = "--tctl-temp=95 --ppt-limit=45000 --edc-limit=90000 --tdc-limit=90000 ";
BalPreset = "--tctl-temp=95 --ppt-limit=65000 --edc-limit=90000 --tdc-limit=90000 ";
PerformancePreset = "--tctl-temp=95 --ppt-limit=88000 --edc-limit=125000 --tdc-limit=125000 ";
ExtremePreset = "--tctl-temp=95 --ppt-limit=105000 --edc-limit=142000 --tdc-limit=142000 ";
}
}
else
Expand Down
8 changes: 7 additions & 1 deletion Universal x86 Tuning Utility/Scripts/RyzenAdj_To_UXTU.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ internal class RyzenAdj_To_UXTU
[DllImport("powrprof.dll", EntryPoint = "PowerSetActiveOverlayScheme")]
public static extern uint PowerSetActiveOverlayScheme(Guid OverlaySchemeGuid);

static string balancedPowerScheme = "3af9B8d9-7c97-431d-ad78-34a8bfea439f";
static string balancedPowerScheme = "00000000-0000-0000-0000-000000000000";
static string highPerformancePowerScheme = "DED574B5-45A0-4F42-8737-46345C09C238";
static string powerSaverPowerScheme = "961CC777-2547-4F9D-8174-7D86181b8A7A";

Expand Down Expand Up @@ -91,6 +91,12 @@ await Task.Run(() =>
int ryzenAdjCommandValue = Convert.ToInt32(ryzenAdjCommandValueString);

if (ryzenAdjCommandString == "intel-pl") Intel_Management.changeTDPAll(ryzenAdjCommandValue);
else if (ryzenAdjCommandString == "intel-volt-cpu") Intel_Management.changeVoltageOffset(0, ryzenAdjCommandValue);
else if (ryzenAdjCommandString == "intel-volt-gpu") Intel_Management.changeVoltageOffset(1, ryzenAdjCommandValue);
else if (ryzenAdjCommandString == "intel-volt-cache") Intel_Management.changeVoltageOffset(2, ryzenAdjCommandValue);
else if (ryzenAdjCommandString == "intel-volt-sa") Intel_Management.changeVoltageOffset(3, ryzenAdjCommandValue);
else if (ryzenAdjCommandString == "intel-bal-cpu") Intel_Management.changePowerBalance(0, ryzenAdjCommandValue);
else if (ryzenAdjCommandString == "intel-bal-gpu") Intel_Management.changePowerBalance(1, ryzenAdjCommandValue);
//else if (ryzenAdjCommandString == "power-limit-1") TDP_Management.changePL1(ryzenAdjCommandValue);
//else if (ryzenAdjCommandString == "power-limit-2") TDP_Management.changePL2(ryzenAdjCommandValue);
}
Expand Down
11 changes: 11 additions & 0 deletions Universal x86 Tuning Utility/Services/PresetManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@ public class Preset

public int IntelPL1 { get; set; }
public int IntelPL2 { get; set; }

public bool IsIntelVolt { get; set; }
public int IntelVoltCPU { get; set; }
public int IntelVoltGPU { get; set; }
public int IntelVoltCache { get; set; }
public int IntelVoltSA { get; set; }

public bool IsIntelBal { get; set; }
public int IntelBalCPU { get; set; }
public int IntelBalGPU { get; set; }

public int rsr { get; set; }
public int boost { get; set; }
public int imageSharp { get; set; }
Expand Down
156 changes: 155 additions & 1 deletion Universal x86 Tuning Utility/Views/Pages/CustomPresets.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ VerticalAlignment="Center" SelectedIndex="0" MinWidth="138" Name="cbxResScale" H
<TextBlock
FontSize="12"
Foreground="{DynamicResource TextFillColorTertiaryBrush}"
Text="Provides the ability to set tune your NVIDIA GPU."/>
Text="Provides the ability to tune your NVIDIA GPU."/>
</StackPanel>

<StackPanel Orientation="Horizontal" Grid.Column="1">
Expand Down Expand Up @@ -1080,6 +1080,160 @@ VerticalAlignment="Center" SelectedIndex="0" MinWidth="138" Name="cbxResScale" H
Text="Warning: We are not liable for any damages to hardware or resulting instabilities caused by adjustment of frequencies and voltages." TextWrapping="WrapWithOverflow" Margin="0,8,0,0"/>
</StackPanel>
</ui:CardExpander>
<ui:CardExpander Name="sdIntelBal"
IsEnabled="True"
IsExpanded="False"
Icon="Pulse20" Margin="0,8,15,0">
<ui:CardExpander.Header>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" VerticalAlignment="Center">
<TextBlock
FontSize="14"
FontWeight="Medium"
Text="Intel Power Balance" />
<TextBlock
FontSize="12"
Foreground="{DynamicResource TextFillColorTertiaryBrush}"
Text="Provides the ability to tune the power balance of your Intel CPU."/>
</StackPanel>

<StackPanel Orientation="Horizontal" Grid.Column="1">
<ui:ToggleSwitch Name="tsIntelBal" Margin="0,0,9,0"/>
</StackPanel>
</Grid>
</ui:CardExpander.Header>
<!-- CardExpander content -->
<StackPanel>
<StackPanel Margin="0,-8,0,0">
<StackPanel Orientation="Horizontal">
<TextBlock FontWeight="DemiBold" FontSize="13" Foreground="{DynamicResource TextFillColorPrimaryBrush}">CPU Balance</TextBlock>
<!--<ui:SymbolIcon Symbol="Info20" Margin="6,0,0,-2" Foreground="{DynamicResource TextFillColorPrimaryBrush}" ToolTip="Controls the maximum voltage your GPU will run within the Frequency/Voltage curve based on clock speed. You can undervolt your NVIDIA GPU by lowering this clock speed below stock and increasing the core clock offset. Start at your GPU's rated boost clock and work down. To reset it, set it to the maximum possible clock the slider allows." VerticalAlignment="Bottom" />-->
</StackPanel>

<Grid Margin="0,8,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<ui:NumberBox Name="nudIntelCpuBal" Text="{Binding ElementName=sdIntelCpuBal, Path=Value}" Value="{Binding ElementName=sdIntelCpuBal, Path=Value}" Maximum="31" Minimum="0" Grid.Column="0" SmallChange="5" MaxDecimalPlaces="0" />
<Slider Name="sdIntelCpuBal" Value="{Binding ElementName=nudIntelCpuBal, Path=Value}" Maximum="31" Minimum="0" Grid.Column="1" Margin="12,0,0,0" TickFrequency="5" VerticalAlignment="Center" IsSnapToTickEnabled="True" TouchDown="SizeSlider_TouchDown"/>
</Grid>
</StackPanel>
<StackPanel Margin="0,8,0,0">
<StackPanel Orientation="Horizontal">
<TextBlock FontWeight="DemiBold" FontSize="13" Foreground="{DynamicResource TextFillColorPrimaryBrush}">GPU Balance</TextBlock>
<!--<ui:SymbolIcon Symbol="Info20" Margin="6,0,0,-2" Foreground="{DynamicResource TextFillColorPrimaryBrush}" ToolTip="Controls the clock offset for your NVIDIA GPU's core clock" VerticalAlignment="Bottom" />-->
</StackPanel>

<Grid Margin="0,8,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<ui:NumberBox Name="nudIntelGpuBal" Text="{Binding ElementName=sdIntelGpuBal, Path=Value}" Value="{Binding ElementName=sdIntelGpuBal, Path=Value}" Maximum="31" Minimum="0" Grid.Column="0" SmallChange="5" MaxDecimalPlaces="0" />
<Slider Name="sdIntelGpuBal" Value="{Binding ElementName=nudIntelGpuBal, Path=Value}" Maximum="31" Minimum="0" Grid.Column="1" Margin="12,0,0,0" TickFrequency="5" VerticalAlignment="Center" IsSnapToTickEnabled="True" TouchDown="SizeSlider_TouchDown"/>
</Grid>
</StackPanel>
</StackPanel>
</ui:CardExpander>
<ui:CardExpander Name="sdIntelUV"
IsEnabled="True"
IsExpanded="False"
Icon="Pulse20" Margin="0,8,15,0">
<ui:CardExpander.Header>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" VerticalAlignment="Center">
<TextBlock
FontSize="14"
FontWeight="Medium"
Text="Intel FIVR Tuning" />
<TextBlock
FontSize="12"
Foreground="{DynamicResource TextFillColorTertiaryBrush}"
Text="Provides the ability to tune the voltages of your Intel CPU."/>
</StackPanel>

<StackPanel Orientation="Horizontal" Grid.Column="1">
<ui:ToggleSwitch Name="tsIntelUV" Margin="0,0,9,0"/>
</StackPanel>
</Grid>
</ui:CardExpander.Header>
<!-- CardExpander content -->
<StackPanel>
<StackPanel Margin="0,-8,0,0">
<StackPanel Orientation="Horizontal">
<TextBlock FontWeight="DemiBold" FontSize="13" Foreground="{DynamicResource TextFillColorPrimaryBrush}">Core Offset (mV)</TextBlock>
<!--<ui:SymbolIcon Symbol="Info20" Margin="6,0,0,-2" Foreground="{DynamicResource TextFillColorPrimaryBrush}" ToolTip="Controls the maximum voltage your GPU will run within the Frequency/Voltage curve based on clock speed. You can undervolt your NVIDIA GPU by lowering this clock speed below stock and increasing the core clock offset. Start at your GPU's rated boost clock and work down. To reset it, set it to the maximum possible clock the slider allows." VerticalAlignment="Bottom" />-->
</StackPanel>

<Grid Margin="0,8,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<ui:NumberBox Name="nudIntelCoreUV" Text="{Binding ElementName=sdIntelCoreUV, Path=Value}" Value="{Binding ElementName=sdIntelCoreUV, Path=Value}" Maximum="250" Minimum="-250" Grid.Column="0" SmallChange="5" MaxDecimalPlaces="0" />
<Slider Name="sdIntelCoreUV" Value="{Binding ElementName=nudIntelCoreUV, Path=Value}" Maximum="250" Minimum="-250" Grid.Column="1" Margin="12,0,0,0" TickFrequency="5" VerticalAlignment="Center" IsSnapToTickEnabled="True" TouchDown="SizeSlider_TouchDown"/>
</Grid>
</StackPanel>
<StackPanel Margin="0,8,0,0">
<StackPanel Orientation="Horizontal">
<TextBlock FontWeight="DemiBold" FontSize="13" Foreground="{DynamicResource TextFillColorPrimaryBrush}">iGPU Offset (mV)</TextBlock>
<!--<ui:SymbolIcon Symbol="Info20" Margin="6,0,0,-2" Foreground="{DynamicResource TextFillColorPrimaryBrush}" ToolTip="Controls the clock offset for your NVIDIA GPU's core clock" VerticalAlignment="Bottom" />-->
</StackPanel>

<Grid Margin="0,8,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<ui:NumberBox Name="nudIntelGfxUV" Text="{Binding ElementName=sdIntelGfxUV, Path=Value}" Value="{Binding ElementName=sdIntelGfxUV, Path=Value}" Maximum="250" Minimum="-250" Grid.Column="0" SmallChange="5" MaxDecimalPlaces="0" />
<Slider Name="sdIntelGfxUV" Value="{Binding ElementName=nudIntelGfxUV, Path=Value}" Maximum="250" Minimum="-250" Grid.Column="1" Margin="12,0,0,0" TickFrequency="5" VerticalAlignment="Center" IsSnapToTickEnabled="True" TouchDown="SizeSlider_TouchDown"/>
</Grid>
</StackPanel>
<StackPanel Margin="0,8,0,0">
<StackPanel Orientation="Horizontal">
<TextBlock FontWeight="DemiBold" FontSize="13" Foreground="{DynamicResource TextFillColorPrimaryBrush}">Cache Offset (mV)</TextBlock>
<!--<ui:SymbolIcon Symbol="Info20" Margin="6,0,0,-2" Foreground="{DynamicResource TextFillColorPrimaryBrush}" ToolTip="Controls the clock offset for your NVIDIA GPU's core clock" VerticalAlignment="Bottom" />-->
</StackPanel>

<Grid Margin="0,8,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<ui:NumberBox Name="nudIntelCacheUV" Text="{Binding ElementName=sdIntelCacheUV, Path=Value}" Value="{Binding ElementName=sdIntelCacheUV, Path=Value}" Maximum="250" Minimum="-250" Grid.Column="0" SmallChange="5" MaxDecimalPlaces="0" />
<Slider Name="sdIntelCacheUV" Value="{Binding ElementName=nudIntelCacheUV, Path=Value}" Maximum="250" Minimum="-250" Grid.Column="1" Margin="12,0,0,0" TickFrequency="5" VerticalAlignment="Center" IsSnapToTickEnabled="True" TouchDown="SizeSlider_TouchDown"/>
</Grid>
</StackPanel>
<StackPanel Margin="0,8,0,0">
<StackPanel Orientation="Horizontal">
<TextBlock FontWeight="DemiBold" FontSize="13" Foreground="{DynamicResource TextFillColorPrimaryBrush}">System Agent Offset (mV)</TextBlock>
<!--<ui:SymbolIcon Symbol="Info20" Margin="6,0,0,-2" Foreground="{DynamicResource TextFillColorPrimaryBrush}" ToolTip="Controls the clock offset for your NVIDIA GPU's core clock" VerticalAlignment="Bottom" />-->
</StackPanel>

<Grid Margin="0,8,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<ui:NumberBox Name="nudIntelSAUV" Text="{Binding ElementName=sdIntelSAUV, Path=Value}" Value="{Binding ElementName=sdIntelSAUV, Path=Value}" Maximum="250" Minimum="-250" Grid.Column="0" SmallChange="5" MaxDecimalPlaces="0" />
<Slider Name="sdIntelSAUV" Value="{Binding ElementName=nudIntelSAUV, Path=Value}" Maximum="250" Minimum="-250" Grid.Column="1" Margin="12,0,0,0" TickFrequency="5" VerticalAlignment="Center" IsSnapToTickEnabled="True" TouchDown="SizeSlider_TouchDown"/>
</Grid>
</StackPanel>
<TextBlock
FontSize="12"
Foreground="{DynamicResource TextFillColorTertiaryBrush}"
Text="Warning: We are not liable for any damages to hardware or resulting instabilities caused by adjustment of frequencies and voltages." TextWrapping="WrapWithOverflow" Margin="0,8,0,0"/>
</StackPanel>
</ui:CardExpander>
<ui:CardExpander Name="sdAmdCpuTune" Visibility="Collapsed"
IsEnabled="True"
IsExpanded="False"
Expand Down
Loading

0 comments on commit 4cfb8e2

Please sign in to comment.