Skip to content

Instantly share code, notes, and snippets.

@michael-baker
Last active April 4, 2022 06:07
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save michael-baker/f3962ba8d21ebd680b8e76c20eaa48c1 to your computer and use it in GitHub Desktop.
Save michael-baker/f3962ba8d21ebd680b8e76c20eaa48c1 to your computer and use it in GitHub Desktop.
Apply an Intel XTU profile from PowerShell
# Must be run under 32-bit PowerShell as ProfilesApi is x86
[System.Reflection.Assembly]::LoadFrom("C:\Program Files (x86)\Intel\Intel(R) Extreme Tuning Utility\Client\ProfilesApi.dll") | Out-Null
# This script programmatically applies an Intel XTU profile.
# This script can replace the CLI method outlined here: https://www.reddit.com/r/Surface/comments/3vslko/change_cpu_voltage_offset_with_intel_xtu_on/
[ProfilesApi.XtuProfileReturnCode]$applyProfileResult = 0
$profileApi = [ProfilesApi.XtuProfiles]::new()
$profileApi.Initialize() | Out-Null
[ProfilesApi.XtuProfileReturnCode]$result = 0
$profiles = $profileApi.GetProfiles([ref] $result)
$profile = $profiles | Where-Object { $_.ProfileName -eq "Undervolt" } | Select-Object -First 1
if ($profile) {
$applied = $profileApi.ApplyProfile($profile.ProfileID, [ref]$applyProfileResult)
if ($applied) {
Write-Host "$applyProfileResult. Profile applied"
} else {
Write-Host "$applyProfileResult. Profile not applied."
}
}
sleep 10
@atipapp
Copy link

atipapp commented Sep 22, 2017

Hi,

Nice work, but if i run this the following message is thrown: InvalidProfileID. Profile not applied.

I am 100% sure that my profile name is correct. Do you have any ideas what might cause this problem?

@JohannesKauffmann
Copy link

Hey, I know your message is more than half a year old, but you could try this:

run XtuCLI.exe -I ALL from C:\Program Files (x86)\Intel\Intel(R) Extreme Tuning Utility\Client

It will create 3 text files in C:\XTU_xmlFiles

In Tuning.txt you will see all the IDs that are valid for your system. Note that not all of them can be modified, for instance on my 7500U I couldn't modify Processor Core Ratio, Overclocking Lock, Core Voltage, etc, but it will give you an idea which IDs are valid for your system, as that is different for each system.

@jasonboukheir
Copy link

Just to make sure, do I have to name my profile "Undervolt" to get this script to work?

@default-writer
Copy link

just run command

"%SystemRoot%\syswow64\WindowsPowerShell\v1.0\powershell.exe" -noprofile -executionpolicy unrestricted -file .\tune_ps2.ps1

and fix profile name in it

@githoniel
Copy link

run perfect! greate script !

@danlu01
Copy link

danlu01 commented Sep 25, 2018

I tried it but got:

Success. Profile not applied.

@SilverGhostBS
Copy link

Hi, same here, got:

Success. Profile not applied.

I can apply profile successfully from the GUI...

@jayagami
Copy link

jayagami commented Jan 5, 2019

good job,

Hi, same here, got:

Success. Profile not applied.

I can apply profile successfully from the GUI...

Same too, not working

@krrr
Copy link

krrr commented Aug 11, 2019

it works with xtu 6.4.1.25, not 6.5.xxx

@rtibby
Copy link

rtibby commented May 15, 2021

XTU version 7.4.0.26: runnig this is very temperamental

Sometimes it's working and sometimes it's not .
Also, sometimes it's working only with powershell_ise .
Sometimes it's working to apply the "default" profile , but not others ..

I have no clue how to make it to work all the time...

@michael-baker
Copy link
Author

michael-baker commented May 17, 2021

Perhaps Intel have changed some internal stuff? Maybe moved the platform to 64-bit?
Does it make any difference if you stop the XTU service, apply the profile and then start the service?
I don't use the app anymore so I don't have any insights to offer I'm afraid.

@n3pjk
Copy link

n3pjk commented Sep 15, 2021

I'm running XTU 7.5.2.3. It is installed as an app, rather than a program. It's target is {6D809377-6AF0-444B-8957-A3773F02200E}\Intel\Intel(R) Extreme Tuning Utility\Client\XtuUiLauncher.exe Any idea how to programmatically run this? The typical methods for running an app from the MS Store don't seem to apply here, or aren't apparent.

@RGD2
Copy link

RGD2 commented Apr 4, 2022

XTU 6.5.1.371 : I get 'Sucess Profile applied', but it doesn't actually work.

Still have to go into XTU an manually tweak settings each boot to get it to do what I want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment