2

I have a HP Pavilion g7 running elementary OS (based on Ubuntu) which is known to be loud and overheat.Mine doesn't shutdown but it does get loud which is very annoying (and 91°C with both Prime95 and Furmark).I searched the internet and found some people under-volt CPUs and get 5 - 20°C lower temperatures.Here's what I tried to install Linux PHC.

I downloaded PHC for AMD K8 (my CPU is K10) from here http://www.linux-phc.org/forum/viewtopic.php?f=13&t=2 (the top one).Unzipped it and ran sudo make dkms_install.Then I added cpufreq_driver=phc-k8 to the boot command line and rebooted.

I pressed Esc so I can view the boot messages and I saw a kernel panic although the system booted (most likely the PHC module) without the CPUFreq driver.When it had booted the PHC module was not loaded so that did not work.

How can I install PHC on Ubunut Ubuntu 14.04 with AMD K10 CPU.

Panic Message :

[   46.670211] kernel BUG at /var/lib/dkms/phc-k8/0.4.6/build/phc-k8.c:667!
[   46.670253] invalid opcode: 0000 [#1] SMP 
[   46.670281] Modules linked in: phc_k8(OE+) kvm_amd(+) dm_multipath scsi_dh kvm crct10dif_pclmul crc32_pclmul aesni_intel aes_x86_64 lrw gf128mul glue_helper ablk_helper cryptd snd_seq_midi snd_seq_midi_event snd_rawmidi snd_hda_codec_hdmi snd_hda_codec_idt snd_hda_codec_generic arc4 psmouse snd_hda_intel bnep snd_hda_controller snd_seq snd_hda_codec snd_hwdep rt2800pci serio_raw rt2800mmio snd_seq_device rt2800lib rt2x00pci rt2x00mmio rt2x00lib k10temp mac80211 rtbth(OE) snd_pcm r8169 rfcomm rtsx_pci mii cfg80211 i2c_piix4 snd_timer bluetooth eeprom_93cx6 crc_ccitt snd shpchp soundcore amd_iommu_v2 hp_accel lis3lv02d input_polldev hp_wireless mac_hid parport_pc ppdev lp parport binfmt_misc nls_iso8859_1 ahci libahci wmi video
[   46.670758] CPU: 2 PID: 548 Comm: systemd-udevd Tainted: G           OE  3.19.0-59-generic #66~14.04.1-Ubuntu
[   46.670817] Hardware name: Hewlett-Packard HP Pavilion g7 Notebook PC/184B, BIOS F.15 10/04/2012
[   46.670871] task: ffff8800aecc89d0 ti: ffff88018b9a0000 task.ti: ffff88018b9a0000
[   46.670916] RIP: 0010:[<ffffffffc080ea14>]  [<ffffffffc080ea14>] freq_from_fid_did+0x44/0x50 [phc_k8]
[   46.670975] RSP: 0018:ffff88018b9a3b28  EFLAGS: 00010202
[   46.671009] RAX: 0000000000000015 RBX: 0000000000006800 RCX: 000000000000000f
[   46.671053] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 000000000000000c
[   46.671096] RBP: ffff88018b9a3b28 R08: ffff88019ec0a108 R09: ffff880198801a00
[   46.671140] R10: ffffffffc0810c21 R11: 0000000000000005 R12: 0000000000000004
[   46.671183] R13: ffff88018b97b300 R14: ffff88018b9a3bc8 R15: ffff88018b9ba200
[   46.671227] FS:  00007f2a08f56880(0000) GS:ffff88019ed00000(0000) knlGS:0000000000000000
[   46.671275] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[   46.671311] CR2: 00007f2a08f14360 CR3: 000000018b9e5000 CR4: 00000000000407e0
[   46.671353] Stack:
[   46.673098]  ffff88018b9a3b58 ffffffffc080eb23 00000000ffffffed ffff88018b97b300
[   46.674891]  0000000000000004 000000000000a100 ffff88018b9a3c08 ffffffffc08116ad
[   46.676686]  0000000000000096 ffffffff81c546d0 ffff88018b9ba200 ffff88018b9a3bc8
[   46.678498] Call Trace:
[   46.680308]  [<ffffffffc080eb23>] print_basics+0x103/0x130 [phc_k8]
[   46.682152]  [<ffffffffc08116ad>] powernowk8_cpu_init+0x12bd/0x14e0 [phc_k8]
[   46.682158]  [<ffffffff8164b1d2>] __cpufreq_add_dev.isra.24+0x312/0xa10
[   46.682162]  [<ffffffff817a613e>] ? klist_next+0x7e/0xf0
[   46.682167]  [<ffffffffc08118d0>] ? powernowk8_cpu_init+0x14e0/0x14e0 [phc_k8]
[   46.682170]  [<ffffffff8164b8de>] cpufreq_add_dev+0xe/0x10
[   46.682175]  [<ffffffff814f82c9>] subsys_interface_register+0xa9/0xf0
[   46.682178]  [<ffffffff8164bdb8>] cpufreq_register_driver+0x118/0x330
[   46.682182]  [<ffffffffc0811a78>] powernowk8_init+0x1a8/0x20f [phc_k8]
[   46.682187]  [<ffffffffc08118d0>] ? powernowk8_cpu_init+0x14e0/0x14e0 [phc_k8]
[   46.682191]  [<ffffffff81002144>] do_one_initcall+0xd4/0x210
[   46.682200]  [<ffffffff811d1085>] ? kmem_cache_alloc_trace+0x1d5/0x270
[   46.682204]  [<ffffffff810f9c5c>] ? load_module+0x164c/0x1ce0
[   46.682207]  [<ffffffff810f9c95>] load_module+0x1685/0x1ce0
[   46.682209]  [<ffffffff810f55a0>] ? store_uevent+0x40/0x40
[   46.682215]  [<ffffffff810fa466>] SyS_finit_module+0x86/0xb0
[   46.682220]  [<ffffffff817bdbcd>] system_call_fastpath+0x16/0x1b
[   46.682247] Code: c7 64 89 f1 5d 05 20 03 00 00 d3 e8 69 c0 e8 03 00 00 c3 0f 1f 40 00 6b c7 64 89 f1 5d 05 40 06 00 00 d3 e8 69 c0 e8 03 00 00 c3 <0f> 0b 66 2e 0f 1f 84 00 00 00 00 00 66 66 66 66 90 55 48 89 e5 
[   46.682252] RIP  [<ffffffffc080ea14>] freq_from_fid_did+0x44/0x50 [phc_k8]
[   46.682253]  RSP <ffff88018b9a3b28>
Suici Doga
  • 2,177
  • 4
  • 16
  • 28
  • Seems like PHC doesn't support AMD K10 (my CPU) – Suici Doga Jul 06 '16 at 04:13
  • From a quick read PHC is to undervolt your CPU - this won't change the clock speed of the processor... Also, what options does your BIOS have? – Kinnectus Jul 08 '16 at 06:23
  • But it will reduce the temperature and reduce power consumption which is also what I want.I also need lower clock speed at idle.And my BIOS doesn't have any options for this – Suici Doga Jul 08 '16 at 06:25
  • A quick read adn there may be a Linux package to install that may help... don't know. http://www.thinkwiki.org/wiki/How_to_use_cpufrequtils – Kinnectus Jul 08 '16 at 06:27
  • @BigChris tried that and it only lets me go to 1.4GHZ – Suici Doga Jul 08 '16 at 06:31
  • Does your laptop BIOS have any advanced processor settings? Your laptop may very well be configured to not all CPU speed less than 1400MHz... – Kinnectus Jul 08 '16 at 06:34
  • No it is a very basic BIOS with nothing other than AMD-V , Secure Boot , Fan Always on (I set it to off) , etc – Suici Doga Jul 08 '16 at 06:35
  • Anyway, only lowering frequency does not reduce power consumption that much. It would be neglible I suppose, at those frequencies and no heating. If you can reduce CPU voltage, it means much less power consumption and heating. I am noy stating an absolute thing, but that I know is true more or less. P.S. sorry for bad english, and autocorrect! – vfsoraki Jul 08 '16 at 13:02
  • @thelastblack Then how do I lower the voltage in Linux.And I do think that downclocking reduces heat since when I reduce my clock speed to 1.4Ghz the temperature never goes above 65C even when running Prime95 – Suici Doga Jul 08 '16 at 13:29
  • 2
    Lowering voltage can cause instablity, and I don't know how you should do it. And I said "just" lowering frequency does not give you that much power saving, not absolutely zero of course. Maybe half an hour over the 8 hours you usually get. Playing with those matters, you can easily burn your CPU in moments! Beware, and don't go for it unless you know what you are doing. Lowering voltage is called "under-clocking", search to find tools. And care! – vfsoraki Jul 08 '16 at 17:26
  • @thelastblack I searched and they say it doesn't damage the CPU.It may cause instability though.And I am going to add information about what I tried in my answer – Suici Doga Jul 09 '16 at 01:35
  • You totally changed question? You could just ask a new one. And about damaging, under-volting is not a dangerous thing, but over-clocking (or over-volting) may cause extreme heat and so on. Anyway, care when you play with electronics! :) – vfsoraki Jul 09 '16 at 06:53
  • I am not overvolting and I did change the question – Suici Doga Jul 09 '16 at 07:32
  • http://askubuntu.com/questions/203303/power-savings-and-performance-modes-on-ubuntu-system – Uğur Gümüşhan Jul 11 '16 at 14:35

2 Answers2

2

I think you are likely trying to use the wrong tool for the job.

There is a project called TurionPowerControl which specifically supports underclocking (and undervolting) AMD K10 processors on linux. The project has been active for a number of years.

From their project site:

TurionPowerControl, despite its name, allows to view and control many parameters of modern AMD processors. It can manipulate power states, frequencies, DRAM timings, power settings and can report temperatures, monitor pstate changes and precise cpu usage. It is available for Windows and Linux, for both 32 bit and 64 bit architectures and fully supports multiprocessor machines.

Currently supported processors are:

Family 10h: All Phenom, Phenom II, Athlon II, Turion Mxxx and Pxxx processors

<\snip>

Which covers most of the K10 Family

They state that it compiles fine on recent versions of Ubuntu (Ubuntu Use Case), and has some very thorough documentation..

A basic overview of it's usage / capabilities is in this document, excerpted here:

Change frequency and voltage

If you want to change voltage or frequency in a easy manner, you have to use the -set command switch. It is really easy to use and pretty user friendly.

Let's see a simple example. If you want to set the frequency of your pstate 0 to 2000 Mhz to all cores you just have to launch such a command:

TurionPowerControl -­set core all pstate 0 frequency 2000

The program will warn you if there isn't a perfect combination that matches the frequency you requested, and will round the result.

If you wish to set core voltage too, let's say 1.200 volts, then the command will become like this:

TurionPowerControl -­set core all pstate 0 frequency 2000 vcore 1.200

<\snip>

I think this the tool that you need to use to achieve your goal; it actually sounds better suited than what you are currently trying to get working. It is possible that it won't work for you, but based on the information in your question it seems like a solid fit to me.

Link:

Primary Project Page (Github)

Update

Default pstates for AMD A8-4500M (source):

#1: 1800 MHz, 0.375V
#2: 1700 MHz, 0.275V
#3: 1600 MHz, 0.225V
#4: 1400 MHz, 0.175V
#5: 900 MHz, 0.175V

In the context of your question, I wouldn't use the same voltage - try a minor decrease to 0.165 or 0.170 to start.

Argonauts
  • 4,410
  • 19
  • 23
  • And does it support Trinity (AMD A8-4500M).And if I put an unstable voltage will it be set to that at startup (something I won't want since it will be unbootable) – Suici Doga Jul 11 '16 at 09:58
  • Ok , I got it installed, how do I reduce the voltage of the max state.I have 2 boost states (2.8ghz and 2.3ghz) and I have heard that my CPU only goes up-to 2.3Ghz when using 4 cores.So which one should I change and is it recommended to use Prime95 for the stress testinng ? – Suici Doga Jul 11 '16 at 10:28
  • Did you see the readme.odt file in the package? Its in the docs directory. Its very thorough and covers how to modify these settings better than I could. Section 3 is where the most relevant material is. Best place to start is run the command TurionPowerControl -l which will list all the adjustable parameters for your CPU. By the way, specifically what CPU do you have? And prime95 is a solid test in my opinion. – Argonauts Jul 11 '16 at 19:19
  • I have an AMD A8-4500M – Suici Doga Jul 12 '16 at 01:12
  • When I ran `sudo TurionPowerControl -set core 1 pstate 1 vcore 1.1100` to reduce my 2.3Ghz boost voltage by **-0.0025** it says **All nodes core: 1 pstate: 1 -- set core voltage to 1.1100 (actual: 1.1125V)** and as a result `sudo TurionPowerControl -l` doesn't show the changed voltages. – Suici Doga Jul 12 '16 at 01:56
  • I don't have a system with a CPU that I could use to help figure out the correct usage. I did find a thread from an ubuntu 14.04 user with a similar processor (A4-4335M) who describes / provides directions making these changes to his setup successfully: http://ubuntuforums.org/showthread.php?t=2221545 Even if he isn't doing exactly what it is you are trying to do, I think it's probably worth it to duplicate his results to make sure your installation is solid. – Argonauts Jul 12 '16 at 02:37
  • Can I use the same voltages ? And boosting is enabled for me but throttles when it goes above 85C – Suici Doga Jul 12 '16 at 03:01
  • I updated the answer with the pstates and their default voltages for your processor. – Argonauts Jul 12 '16 at 03:19
  • When I run `TurionPowerControl -l` it shows higher voltages – Suici Doga Jul 12 '16 at 03:36
  • Added the source for the info. I can't independently verify the accuracy and I couldn't find an AMD doc with the info – Argonauts Jul 12 '16 at 03:50
  • So why can't I change the voltage ? It seems to round it – Suici Doga Jul 12 '16 at 03:52
  • I changed the 2.3Ghz voltage to 1.0000 and now when running Prime95 the frequency is not going above 1.8Ghz.I reverted the voltage but it is still happening.And my Google Octane score has gone from 13000 to 5000 :( – Suici Doga Jul 12 '16 at 04:08
  • I rebooted and the problem is still there.Its like my CPU has been throttled and my laptop has turned into an old computer.It doesn't go above 1.6Ghz in Prime95 and in Google Octane it doesn't boost for more than a second.My system has got slower after this .Can you help me reset this and get my system back to normal – Suici Doga Jul 12 '16 at 04:20
  • And when running Prime95 `/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq` becomes 1.7Ghz. Before it was 1.9Ghz and it boosted.Now whenever I run Prime95 it is reduced to 1.7Ghz from 1.9Ghz.My system does boost when just web browsing but when I run Prime95 or another intensive program it doesn't.Do you know how to clear all these settings and make my system like it was before – Suici Doga Jul 12 '16 at 04:28
  • Remove any persistent setting changes, if any such as in rc.local and then power down the laptop. Remove the ac power cord and the battery. Then do a bios reset (remove battery for 15 second or so) That will take care of it. – Argonauts Jul 12 '16 at 04:40
  • Where is rc.local. The file /etc/rc.local is empty.And yes I did underclock the CPU – Suici Doga Jul 12 '16 at 04:43
  • On the bright side you were successful in under clocking your CPU, so the answer I provided works. – Argonauts Jul 12 '16 at 04:43
  • lol @ "answer I provided works." Sure does have seemed to. +1 – ThatOneDude Jul 12 '16 at 05:41
  • I pulled out the battery and now it is not throttling – Suici Doga Jul 12 '16 at 07:13
  • I tried again today and I could lower the voltage **0.9375** (-0.175 from stock) (any thing lower makes it panic with flashing caps lock light) for 2.3 Ghz boost and is stable with Prime95.Now when the frequency goes to the 1.9 Ghz (because Turbo Core only can boost for a limited time) the temperature actually increases (yes , increases) because the 1.9 Ghz Voltage is higher.Temperature doesn't go above 80 any more which is very good and should increase my APUs life.Here is the output of `sudo TurionPowerControl -l` after the undervolt http://paste.ubuntu.com/19741553/ – Suici Doga Jul 17 '16 at 08:12
  • @Argonauts Do you know how I can install or compile TurionPowerControl on Windows 10 – Suici Doga Aug 16 '16 at 11:18
  • No it won't. Check this question for some ideas http://superuser.com/questions/429249/underclocking-without-bios-option – Argonauts Aug 16 '16 at 11:55
  • @Argonauts Wasn't TurionPowerControl also for Windows before ? Is there any other software I can use (and my fans are clean and my laptop is not a lap burner unless you game on it) – Suici Doga Aug 25 '16 at 02:41
0

You need to use an OS, kernel of which has an up to date ACPI module to benefit from CPU package C states. Otherwise, your CPU will not receive HALT instructions from the OS, waste power and produce heat.

Uğur Gümüşhan
  • 1,356
  • 2
  • 15
  • 32
  • Do you think I use MS DOS which doesn't halt the CPU ? I use elementary OS freya – Suici Doga Jul 11 '16 at 13:19
  • @SuiciDoga is your computer silent when it's idle? ACPI module may not be active if the OS doesn't identify your CPU since it's relatively newer generation – Uğur Gümüşhan Jul 11 '16 at 13:31
  • It is very quiet and about 50 - 55C and after a minute it goes to 49C and the fan turns off – Suici Doga Jul 11 '16 at 14:01
  • @SuiciDoga so you want to cap your max multiplier. I'd use bios for that. also I think you should add that info to the question so that I can delete my answer which is invalid at the moment – Uğur Gümüşhan Jul 11 '16 at 14:06
  • No , I want to undervolt my CPU to reduce the temperature and also reduce the minimum clock speed.I still want the speed when I need it – Suici Doga Jul 11 '16 at 14:24