• Announcements

    • xper

      MSFN Sponsorship and AdBlockers!   07/10/2016

      Dear members, MSFN is made available via subscriptions, donations and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, become a site sponsor and ads will be disabled automatically and by subscribing you get other sponsor benefits.
Sign in to follow this  
Followers 0
Glenn9999

Disable Dynamic Frequency Scaling

3 posts in this topic

One thing I've been looking to do (actually requested by someone - and I'm handicapped because of no way to test it, personally), is how to disable dynamic frequency scaling on CPUs via CODE. The problem I'm having is that the search engine really hasn't revealed a good way to do it. Lots on OS settings for both Windows and Linux but nothing that will shut the feature off and let you run something (and maybe let you turn it back on). Does anyone have any clues as to how to do it? Sample source would be great, too, if possible.

0

Share this post


Link to post
Share on other sites

First i don't think the code will be the same for any cpu as Amd "cool and quiet" and Intel "speed step" should not share the same source code.

Perhaps the resource kit or dev kit offered by Amd and Intel might provide steps or not.

But if you are trying on linux, there is c++ source code included in recent kernel and instructions to use those features. The source code of the described kernel modules in the link, might help you to port it to another OS.

0

Share this post


Link to post
Share on other sites

FWIW, the answer that seems to exist for Windows (most all of this stuff has to have an API somewhere) in reading the API, is as follows:

function CallNtPowerInformation(InformationLeveL: POWER_INFORMATION_LEVEL;
lpInputBuffer: PVOID; nInputBufferSize: ULONG; lpOutputBuffer: PVOID;
nOutputBufferSize: ULONG): NTSTATUS; stdcall;
external powrproflib name 'CallNtPowerInformation';

I have code calling this which seems to work in that it identifies that all the stuff I have as not supporting the feature (which is true). The problem for me is in having known good code which will do the job. Calling this using SystemPowerCapabilities brings back or sends a structure, which seems to have the following interesting parts:

 
BOOLEAN ProcessorThrottle;
BYTE ProcessorMinThrottle;
BYTE ProcessorMaxThrottle;

From the documentation:

ProcessorThrottle

If this member is TRUE, the system supports processor throttling.

ProcessorMinThrottle

The minimum level of system processor throttling supported, expressed as a percentage.

ProcessorMaxThrottle

The maximum level of system processor throttling supported, expressed as a percentage.

Of course it looks promising (set some number to the later two where they are equal would effectively "disable" the feature), but really no way to be sure. What I thought was it would be nice to find some code sample on the Internet where someone has done this already and use that, but I really haven't found any code samples either that claim to do the task. Odd thing being that I see it mentioned enough that it would be a useful enough task to more than just a few.

Hope that helps explain where I'm at with the research on things (since I have a little more time now than when I first posted that).

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.