-
Notifications
You must be signed in to change notification settings - Fork 22
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
Help on family 14H #16
Comments
It looks like CPU_FID can be read from MainPllOpFreqId (bits 5:0) of D18F3xD4 register. |
I know how to read D18F3xD4 from linux command line. We need to read from a PCI device.
Notice that 00:18.3 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 12h/14h Processor Function 3 is on the list. To read the D18F3xD4 register:
You need to execute it as superuser, otherwise the result will be like In my case the FID are the bits 5:0. The https://www.amd.com/system/files/TechDocs/43170_14h_Mod_00h-0Fh_BKDG.pdf (page 296) gives the formula for a PLL COF:
which for my case is 100MHz * (11h + 10h) = 100MHz * 21h = 100MHz * 33 = 3300 MHz |
In amdctl.c use
to read the value from PCI device. To read MainPllOpFreqId use this:
|
I'll have a look at your issue tonight, haven't had time yet, sorry. |
I'm not sure if disabling 1 core reduces power usage (on 14h CPU's), maybe disabling the core just tells the kernel to not use it ? I know on some CPU's, the same voltage is applied to all cores, which might be why when you disable a core you see the same power usage?
According to the manual you linked, there should be 8 pstates (page 55). From what I can gather, the cpu frequency for your cpu needs to be calculated like this (page 430):
Then you'd get the COF, like you did in #16 (comment)
Then you can calculate cpu frequency with You'd need to edit amdctl.c to check if the family is 14h and do this in the loop here: https://github.com/kevinlekiller/amdctl/blob/master/amdctl.c#L238 since it seems to be implied in the manual that COF is volatile. They also say this, which I don't understand : |
Thanks @kevinlekiller for the tips. I have modified the amdctl.c so at least it prints the P-States table for 14H family. Related to this:
I did more tests in this topic. I have HP T610 Plus thin client with AMD G-T56N processor (with two cores). OS is latest Debian without GUI (just a console output is available). The processor has only three valid P-States available. I have no idea who configured them, maybe it is by factory default or maybe Debian manages this. In debian I have also cpupower available with an automatic power management set to on demand. It means that Debian controls the P-States automatically, it depends on the current load. I did the following tests:
Finally, it looks like Debian with cpupower automatically manages the power consumption. The power management policy switches the low power mode by default and switches to high performance automatically on demand. I think I will stay with this policy, so for now I will not use amdctl to controll P-States, however I will use it to monitor it as it has a nice output table with everything (cpu clock, voltage and power). |
I have no idea. Maybe: there is 5 bits for a decimal value and 4 bits for fraction of the divider. When all bits are set then the equation:
gives the result 35.75. Maybe not all avlaues are supported by the processor, however the equation can deliver them? |
If you change the P-State (2) of the disabled core to have lower clock speed / voltage, does that reduce power usage ? |
I do not know if that is possible to do. I can only disable second core cpu1. When it is disabled then:
Moreover I have modified amdctl to only read from 14H family; write operation is not supported. |
Hi! |
This now supported in #38 |
Hi @kevinlekiller,
I have a HP T610 Plus thin client device which has a AMD G-T56N processor on board. It is a 14H family and it is not supported by your amdctl software. However I was able to make some changes in amdctl.c file, so at least the amdctl -g will show me some generic output of what I have inside of my processor.
At first I took a look at the https://www.amd.com/system/files/TechDocs/43170_14h_Mod_00h-0Fh_BKDG.pdf documentation and according to this, I have added some bit definitions in your
checkFamily()
method:It looks like there is no FID bits in 14H (or it was moved or replaced by something else), so I faked them to be the same as DID bits. Moreover I have noticed that the data stored in a DID bits are in a different format (as for example in 15H family): they contain a decimal and fraction parts, so the calculations of the divider are a bit complex.
But for now I just wanted to have some output from amdctl -g, which is as below:
The data may be not correcty calculated, like for example the clock divider or the cpu frequency. It looks like there is something wrong in my case in the number of currently P-State.
Consider this:
it says that cores are in a different current P-States, however this:
may indicate (by the 1350mV voltage) that both cores are in the first P-State, so each core should consume more than 6W. This seems to be correct because my power/energy meter shows that the computer consumes around 14W.
@kevinlekiller, before I continue with my research I have a question: if I totaly disable one core of the CPU, will the total consumed power drop about 6W? Then instead of 14W of consumption, my computer will draw around 8W?
Second thing: I have also used a cpupower utility to control the frequency of CPU but it looks like it doesn't control the power states as my computer was still at 14W no matter what I have chosen.
Third thing: I have also put one core into an offline state by executing as root:
echo 0 > /sys/devices/system/cpu/cpu1/online
but that not really helped if it goes about power consumption: it still draw 14W, however the htop command line utility showed me only one active CPU core available.
@kevinlekiller, could you please help me a bit, to understand?
The text was updated successfully, but these errors were encountered: