Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a version for Windows 10, or is Windows 10 available #23

Open
Dukecccp opened this issue Aug 18, 2022 · 6 comments
Open

Is there a version for Windows 10, or is Windows 10 available #23

Dukecccp opened this issue Aug 18, 2022 · 6 comments

Comments

@Dukecccp
Copy link

No description provided.

@shanoaice
Copy link

I don't think it's possible since Windows 10 lacks the API EnergyStar relies on (EcoQoS).

@zqhong
Copy link

zqhong commented Aug 24, 2022

EnergyStar does two things for processes that don't need performance:

One is to set the process to PROCESS_POWER_THROTTLING_EXECUTION_SPEED. If it is a Windows 10 system, it is marked as LowQoS. Windows 11 is EcoQoS. Processes marked as LowQoS select the most efficient CPU frequency and schedule to efficient cores only when using battery. Processes marked with EcoQoS always choose the most efficient CPU frequency and schedule to efficient cores.

The second is to set the process to IDLE_PRIORITY_CLASS. The thread of the process that is set to IDLE_PRIORITY_CLASS only runs when the system is idle.

in conclusion:
Windows 10 1709 and above, except that EcoQoS is not supported, all others are supported.

Reference documentation:
https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-setprocessinformation

https://docs.microsoft.com/en-us/windows/win32/procthread/quality-of-service

@zqhong
Copy link

zqhong commented Aug 25, 2022

I wrote a tool that integrates ryzenadj and EnergyStar called RyzenTuner.

Since version 1.2.1, a function similar to EnergyStar has been built in, which supports Windows 10 and above.

Project URL:
https://github.com/zqhong/RyzenTuner

@weifeng12x
Copy link

weifeng12x commented Aug 29, 2022

EnergyStar does two things for processes that don't need performance:

One is to set the process to PROCESS_POWER_THROTTLING_EXECUTION_SPEED. If it is a Windows 10 system, it is marked as LowQoS. Windows 11 is EcoQoS. Processes marked as LowQoS select the most efficient CPU frequency and schedule to efficient cores only when using battery. Processes marked with EcoQoS always choose the most efficient CPU frequency and schedule to efficient cores.

The second is to set the process to IDLE_PRIORITY_CLASS. The thread of the process that is set to IDLE_PRIORITY_CLASS only runs when the system is idle.

in conclusion: Windows 10 1709 and above, except that EcoQoS is not supported, all others are supported.

Reference documentation: https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-setprocessinformation

https://docs.microsoft.com/en-us/windows/win32/procthread/quality-of-service

if (Environment.OSVersion.Version.Build < 22000)
{
    Console.WriteLine("E: You are too poor to use this program.");
    Console.WriteLine("E: Please upgrade to Windows 11 22H2 for best result, and consider ThinkPad Z13 as your next laptop.");
    // ERROR_CALL_NOT_IMPLEMENTED
    Environment.Exit(120);
}     

From my knowledge, Windows 10 Version.Build less than 22000

@zqhong
Copy link

zqhong commented Aug 29, 2022

if (Environment.OSVersion.Version.Build < 22000)
{
    Console.WriteLine("E: You are too poor to use this program.");
    Console.WriteLine("E: Please upgrade to Windows 11 22H2 for best result, and consider ThinkPad Z13 as your next laptop.");
    // ERROR_CALL_NOT_IMPLEMENTED
    Environment.Exit(120);
}     

From my knowledge, Windows 10 Version.Build less than 22000

As mentioned in the article below, EcoQoS was introduced in Windows 11 Preview Build 21359.

https://devblogs.microsoft.com/performance-diagnostics/introducing-ecoqos/

In the article below, LowQoS has been supported since Windows 10 1709. The system version of the computer I am using is Windows 10 Build 17763, and there is no error in calling the ToggleEfficiencyMode method. I have not actually tested whether it actually affects the battery life. From the official documentation, it is recommended to use the latest version of Windows 11, which has the best support for EcoQoS.

private static void ToggleEfficiencyMode(IntPtr hProcess, bool enable)
{
Win32Api.SetProcessInformation(hProcess, Win32Api.PROCESS_INFORMATION_CLASS.ProcessPowerThrottling,
enable ? pThrottleOn : pThrottleOff, (uint)szControlBlock);
Win32Api.SetPriorityClass(hProcess, enable ? Win32Api.PriorityClass.IDLE_PRIORITY_CLASS : Win32Api.PriorityClass.NORMAL_PRIORITY_CLASS);
}

https://docs.microsoft.com/en-us/windows/win32/procthread/quality-of-service

In conclusion: Windows 10 1709 and above, except that EcoQoS is not supported, all others are supported.

Going back to the summary of my first reply, I think it's ok.

@weifeng12x
Copy link

OK, I commented out the limit code, the application is running now. I will follow up the application's performance.

thanks for your explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants