@@ -15,6 +15,7 @@ public static class OverclockCatalog
1515 public const string NvapiBackendId = "nvidia-nvapi" ;
1616 public const string IntelPolicyBackendId = "intel-policy" ;
1717 public const string SmbiosMemoryBackendId = "smbios-memory" ;
18+ public const string AmdAdlxBackendId = "amd-adlx" ;
1819
1920 /// <summary>Knobs for NVIDIA GPUs, served by nvapi64.dll.</summary>
2021 public static IReadOnlyList < OverclockKnob > NvidiaGpuKnobs { get ; } =
@@ -87,6 +88,27 @@ public static class OverclockCatalog
8788 "knob_nvidia_clock_readout" , "knob_nvidia_clock_readout_desc" , requiresReboot : false ,
8889 presets : [ ] ) ,
8990 ] ;
91+ /// <summary>
92+ /// AMD knobs, served by amdadlx64.dll. Power limit only: ADLX reports it in
93+ /// percent of TDP, which is exactly the catalog unit, so there is no anchor
94+ /// to resolve and no conversion to get wrong. AMD clocks stay out on
95+ /// purpose: from Navi4 up SetGPUMaxFrequency takes an offset, before that
96+ /// an absolute frequency, and guessing which one a card expects is how a
97+ /// number the hardware never meant gets written.
98+ /// </summary>
99+ public static IReadOnlyList < OverclockKnob > AmdGpuKnobs { get ; } =
100+ [
101+ Build ( new KnobId ( "amd.gpu.powerLimit" ) , OverclockComponent . Gpu ,
102+ KnobRange . Scalar ( 0 , 100 ) , 1 , KnobUnit . Percent , RiskLevel . Moderate , EvidenceLevel . Vendor ,
103+ "knob_amd_power_limit" , "knob_amd_power_limit_desc" , requiresReboot : false ,
104+ presets :
105+ [
106+ ( OverclockProfile . Conservative , 100 ) ,
107+ ( OverclockProfile . Balanced , 110 ) ,
108+ ( OverclockProfile . Performance , 120 ) ,
109+ ] ,
110+ backendId : AmdAdlxBackendId ) ,
111+ ] ;
90112
91113 /// <summary>
92114 /// CPU policy knobs. These are Windows power-plan settings, not clock
@@ -145,14 +167,15 @@ private static OverclockKnob Build(
145167 string descriptionKey ,
146168 bool requiresReboot ,
147169 ( OverclockProfile Profile , KnobValue Value ) [ ] presets ,
148- IReadOnlyList < KnobDependency > ? dependsOn = null )
170+ IReadOnlyList < KnobDependency > ? dependsOn = null ,
171+ string ? backendId = null )
149172 {
150- string backendId = component switch
173+ string resolvedBackendId = backendId ?? ( component switch
151174 {
152175 OverclockComponent . Gpu => NvapiBackendId ,
153176 OverclockComponent . Cpu => IntelPolicyBackendId ,
154177 _ => SmbiosMemoryBackendId ,
155- } ;
178+ } ) ;
156179
157180 return new OverclockKnob (
158181 id ,
@@ -167,7 +190,7 @@ private static OverclockKnob Build(
167190 descriptionKey ,
168191 requiresReboot ,
169192 KnobScope . Session ,
170- backendId ,
193+ resolvedBackendId ,
171194 presets . Select ( p => new KnobPreset ( p . Profile , p . Value , $ "preset_{ p . Profile . ToString ( ) . ToLowerInvariant ( ) } ") ) . ToArray ( ) ,
172195 dependsOn ?? [ ] ) ;
173196 }
0 commit comments