Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › Overclock CPU in Linux - Necessary Program Names Given!
New Posts  All Forums:Forum Nav:

Overclock CPU in Linux - Necessary Program Names Given!

Poll Results: Prior to this thread, have you found it difficult to find software to overclock the CPU in Linux, that isn't tied to a specific machine (like the Linux overclocking software for the Eee PC)?

 
  • 25% (6)
    It was a breeze to find, what are you talking about?!
  • 8% (2)
    It was moderately easy to find.
  • 12% (3)
    Medium difficulty
  • 29% (7)
    Difficult
  • 25% (6)
    Absurdly difficult/ I did not succeed
24 Total Votes  
post #1 of 34
Thread Starter 
tags: MSR kernel module, c2ctl, k10ctl, TurionPowerControl, indicator-cpufreq, cpupowered, overclock, linux

c2ctl: a program for overclocking Intel processors in Linux
k10ctl: a program for overclocking AMD processors in Linux
MSR kernel module: the mean 'n' patatas

*Edit: New addition: TurionPowerContol, another utility for overclocking an AMD CPU in Linux. (There is also a Windows version.)

*Edit: New additions: CrazyGangster spotted this one: indicator-cpufreq, which, if you have apt-get and the indicator-cpufreq repository in apt-get's list, can be obtained via "sudo indicator-cpufreq". Another new addition: cpupowered, which is for AMD.

And go here: https://wiki.archlinux.org/index.php/Fan_Speed_Control

DISCLAIMER: I have never overclocked in my life. That probably will change, however. Well, maybe I overclocked my graphics card one time when I was going through settings. And there was a time I tried to overclock but did not succeed...anyways...


What I am doing and why am I posting, especially given I have never overclocked in my life? To improve the Internet. More specifically, search results when one tries to find a Linux program for overclocking the CPU.

Please excuse the lengthy post, put there's some things that really need to be said/asked. I joined this forum so that I could post this. There's some things I've been wondering for quite a while and haven't found answers to, that I think others would like to find answers to as well.

I am almost angered by the fact that it is essentially impossible (at time of writing) to find the actual names of programs necessary to overclock the CPU in Linux using search strings like "overclock linux", "overclock cpu in linux", "overclock Intel CPU in Linux", "FSB overclock AMD CPU linux", and the list goes on. You can go through pages of search results and not come across a single link that gets you closer to overclocking in Linux.

You do find a lot of pages on how to overclock an nVIDIA graphics card in Linux, which is great and all, but that's really irksome when someone wants to know how to overclock the CPU in Linux and all they get is how to overclock a GPU in Linux

You might even find people talking about PerlMon, a program that supposedly can overclock the CPU in Linux, but all download links to it have apparently been wiped off the face of the Internet.

And before someone says something about the BIOS, this is for the majority of consumers that have a "normal" motherboard that doesn't have an in-BIOS overclocking feature. Of my encounters, only very few ready-made computers (Dell, HP, etc.) have a BIOS that has its own overclocking feature. So for the rest of the world that has to run an overclocking program from the OS....

I have been doing some research on overclocking. What actually happens? People say they can overclock from the BIOS or use a program in an operating system to overclock. The general option seems to be that using the BIOS is vastly superior.

Well, I have discovered the magic password for good search results: MSR. Yep. Google "linux MSR" and you get all kinds of info on how to overclock a CPU in Linux. The MSR is the Machine/Model Specific Register. Registers are parts of the processor that are like the processor's workbench. It can directly work on stuff in registers. Often, stuff has to be copied from RAM into a register before the CPU can work with that data.
Anyways, modern processors look to the MSR to see how fast they should be going. The clockspeed is encoded into the MSR. By writing to the MSR, you can change the clockspeed of the processor.

Once you have the Linux MSR kernel module installed, programs like c2ctl and k10ctl can use the Linux MSR kernel model to read from and write to the MSR, allowing you to...oh my gosh...overclock your CPU form Linux!

But this leaves me with some massive, burning questions. I hear a lot of things like “It's impossible to overclock the CPU on a Dell”, or “That BIOS locks the system so that you can't overclock”, or “You're going to have to hack the BIOS in order to overclock.”

WHOA WHOA WHOA! A few things. First, you're booted into the operating system now, and the BIOS is gone. It is not running on the processor at all. Sure, you might be able to invoke BIOS runtimes via an interrupt, but you don't have to. Furthermore, in the case of Linux, it's my understanding that it doesn't use any BIOS calls. So how can a BIOS stop an operating system from overclocking? That just doesn't make sense.

All you have to do is write to the MSR, right? Where is this need to “hack the BIOS”?

Also, people seem to ignore the fact that the BIOS is just as much software as an operating system or a program being ran by the operating system is. The BIOS ain't hardware. It's still just 1's and 0's and gets executed by your CPU. There's not even a gray-area.

People tend to refer to overclocking from within the operating system as “software overclocking” as if overclocking from the BIOS isn't.

Furthermore, if you overclock from the BIOS or from the operating system, either way you're writing to the MSR, aren't you? So how is BIOS overclocking superior?

That's my rant/ search engine farming. Hopefully we can get/provide more answers because of it.

If anyone else has found software that can overclock a CPU in Linux, please post it!

Cheers,
Jake
Edited by SpawnHappyJake - 5/7/12 at 10:43pm
post #2 of 34
Quote:
Originally Posted by SpawnHappyJake View Post

tags: MSR kernel module, c2ctl, k10ctl, linux, overclock
c2ctl: a program for overclocking Intel processors in Linux
k10ctl: a program for overclocking AMD processors in Linux
MSR kernel module: the mean 'n' patatas
And go here: https://wiki.archlinux.org/index.php/Fan_Speed_Control
DISCLAIMER: I have never overclocked in my life. That probably will change, however. Well, maybe I overclocked my graphics card one time when I was going through settings. And there was a time I tried to overclock but did not succeed...anyways...
What I am doing and why am I posting, especially given I have never overclocked in my life? To improve the Internet. More specifically, search results when one tries to find a Linux program for overclocking the CPU.
Please excuse the lengthy post, put there's some things that really need to be said/asked. I joined this forum so that I could post this. There's some things I've been wondering for quite a while and haven't found answers to, that I think others would like to find answers to as well.
I am almost angered by the fact that it is essentially impossible (at time of writing) to find the actual names of programs necessary to overclock the CPU in Linux using search strings like "overclock linux", "overclock cpu in linux", "overclock Intel CPU in Linux", "FSB overclock AMD CPU linux", and the list goes on. You can go through pages of search results and not come across a single link that gets you closer to overclocking in Linux.
You do find a lot of pages on how to overclock an nVIDIA graphics card in Linux, which is great and all, but that's really irksome when someone wants to know how to overclock the CPU in Linux and all they get is how to overclock a GPU in Linux
You might even find people talking about PerlMon, a program that supposedly can overclock the CPU in Linux, but all download links to it have apparently been wiped off the face of the Internet.
And before someone says something about the BIOS, this is for the majority of consumers that have a "normal" motherboard that doesn't have an in-BIOS overclocking feature. Of my encounters, only very few ready-made computers (Dell, HP, etc.) have a BIOS that has its own overclocking feature. So for the rest of the world that has to run an overclocking program from the OS....
I have been doing some research on overclocking. What actually happens? People say they can overclock from the BIOS or use a program in an operating system to overclock. The general option seems to be that using the BIOS is vastly superior.
Well, I have discovered the magic password for good search results: MSR. Yep. Google "linux MSR" and you get all kinds of info on how to overclock a CPU in Linux. The MSR is the Machine/Model Specific Register. Registers are parts of the processor that are like the processor's workbench. It can directly work on stuff in registers. Often, stuff has to be copied from RAM into a register before the CPU can work with that data.
Anyways, modern processors look to the MSR to see how fast they should be going. The clockspeed is encoded into the MSR. By writing to the MSR, you can change the clockspeed of the processor.
Once you have the Linux MSR kernel module installed, programs like c2ctl and k10ctl can use the Linux MSR kernel model to read from and write to the MSR, allowing you to...oh my gosh...overclock your CPU form Linux!
But this leaves me with some massive, burning questions. I hear a lot of things like “It's impossible to overclock the CPU on a Dell”, or “That BIOS locks the system so that you can't overclock”, or “You're going to have to hack the BIOS in order to overclock.”
WHOA WHOA WHOA! A few things. First, you're booted into the operating system now, and the BIOS is gone. It is not running on the processor at all. Sure, you might be able to invoke BIOS runtimes via an interrupt, but you don't have to. Furthermore, in the case of Linux, it's my understanding that it doesn't use any BIOS calls. So how can a BIOS stop an operating system from overclocking? That just doesn't make sense.
All you have to do is write to the MSR, right? Where is this need to “hack the BIOS”?
Also, people seem to ignore the fact that the BIOS is just as much software as an operating system or a program being ran by the operating system is. The BIOS ain't hardware. It's still just 1's and 0's and gets executed by your CPU. There's not even a gray-area.
People tend to refer to overclocking from within the operating system as “software overclocking” as if overclocking from the BIOS isn't.
Furthermore, if you overclock from the BIOS or from the operating system, either way you're writing to the MSR, aren't you? So how is BIOS overclocking superior?
That's my rant/ search engine farming. Hopefully we can get/provide more answers because of it.
If anyone else has found software that can overclock a CPU in Linux, please post it!
Cheers,
Jake

Very very very interesting post, thanks for the input. Very interesting, there is an article on Arch Linux WIKI about k10ctl. Probably a simple modprobe msr should help. Will check this out. smile.gif

Link: https://wiki.archlinux.org/index.php/K10ctl
post #3 of 34
Thread Starter 
Cubanresourceful, I'm flattered.

And you know what? I searched "linux overclock cpu " and this thread was the _first_link_! BOO-YAH! I fixed the Internet! Mission accomplished!

I'm impressed someone responded already. This is working better than I had hoped for.

Happy learning,
Jake
post #4 of 34
thanks you so much.thumb.gif
the Big Rigg
(14 items)
 
  
CPUMotherboardGraphicsRAM
phenom X6 3.0Ghz AsRock GT 550 ti 1GB GDDR5 8GB 1600 Mhz 
Hard DriveOptical DriveOSMonitor
HDD 320GB 7200RPM DVD RW Ubuntu 11.04 X64 & windows 7 64bit 21.5" 1080p  
MonitorPowerCase
19" 1600x900 750Watt DF 85 
  hide details  
Reply
the Big Rigg
(14 items)
 
  
CPUMotherboardGraphicsRAM
phenom X6 3.0Ghz AsRock GT 550 ti 1GB GDDR5 8GB 1600 Mhz 
Hard DriveOptical DriveOSMonitor
HDD 320GB 7200RPM DVD RW Ubuntu 11.04 X64 & windows 7 64bit 21.5" 1080p  
MonitorPowerCase
19" 1600x900 750Watt DF 85 
  hide details  
Reply
post #5 of 34
Good stuff!
    
CPUMotherboardGraphicsRAM
AVC PENTIUM 4 DUAL CORE HSF Z9H741K011 EVGA 680i SLI 2x NVIDIA GEFORCE 8800GT 512MB PCI-E REV 1 (SLI) 4x WM552/XG691 HYNIX 1GB DDR2 PC2-6400 JEDEC STD 
Hard DriveOptical DriveOSMonitor
2x SEAGATE HDD 250GB SATA 7200RPM 16MB (Raid0) LG 20X DUAL-LAYER DVD RE-WRITER NON-LIG XP-MCE/Mint 11 KDE 50 inch Samsung DLP HDTV 
KeyboardPowerCaseMouse
MS Wireless BT 7000 1 KILOWATT OEM ATX PSU FULL-TOWER BLUE CASE 2.0B MS Wireless Laser BT 8000 
Mouse Pad
Alienware Big Head 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
AVC PENTIUM 4 DUAL CORE HSF Z9H741K011 EVGA 680i SLI 2x NVIDIA GEFORCE 8800GT 512MB PCI-E REV 1 (SLI) 4x WM552/XG691 HYNIX 1GB DDR2 PC2-6400 JEDEC STD 
Hard DriveOptical DriveOSMonitor
2x SEAGATE HDD 250GB SATA 7200RPM 16MB (Raid0) LG 20X DUAL-LAYER DVD RE-WRITER NON-LIG XP-MCE/Mint 11 KDE 50 inch Samsung DLP HDTV 
KeyboardPowerCaseMouse
MS Wireless BT 7000 1 KILOWATT OEM ATX PSU FULL-TOWER BLUE CASE 2.0B MS Wireless Laser BT 8000 
Mouse Pad
Alienware Big Head 
  hide details  
Reply
post #6 of 34
Hi, this is my first post/reply.

I've been slowly setting up my desktop running dual boot Linux/Win7 for a while now and I finally got around to *thinking about* overclocking my Linux box today.

I read this post and decided I had to join the forum, to leave a reply.

Looking at my google searches, If it wasn't for this post I think I would have felt the same frustration as you did -- so thank you very much SpawnHappyJake! You just made the internet that extra bit better for the Linux community biggrin.gif

I'll try out k10ctl and MSR and post back my views ... hopefully within the next couple of weeks! tongue.gif

Ta
post #7 of 34
Subbed!

Time to overclock my good old PIII running Debian biggrin.gif... and the pile of junk sitting in my closet

Will post results if I succeed. Hopefully soon smile.gif
    
CPUMotherboardGraphicsRAM
i7-2600K Maximus IV Gene-z eVGA GTX 580 G.SKILL 2x2GB DDR3-1600 CL9 
Hard DriveCoolingOSMonitor
Crucial M4 128GiB Intel Stock Windows 7 ASUS VG236HE 
KeyboardPowerCaseMouse
Logitech Illuminated Wired Corsair TX750 HAF 932 Logitech G500 
Mouse Pad
Neatly folded Microcenter monthly ad 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
i7-2600K Maximus IV Gene-z eVGA GTX 580 G.SKILL 2x2GB DDR3-1600 CL9 
Hard DriveCoolingOSMonitor
Crucial M4 128GiB Intel Stock Windows 7 ASUS VG236HE 
KeyboardPowerCaseMouse
Logitech Illuminated Wired Corsair TX750 HAF 932 Logitech G500 
Mouse Pad
Neatly folded Microcenter monthly ad 
  hide details  
Reply
post #8 of 34
Thread Starter 
I've been meaning to come back and paint a more complete picture for a while now, but have been busy with school, sorry.
Now that it's spring break, I have a brief moment to post some answers to questions I've been having, and I think you people might want in.

If all you have to do is write to the MSR to overclock a CPU, and leave it at that, that doesn't leave room in the picture for things like PLLs and pinmods.

So how are PLLs and pinmods related to the MSR and overclocking?

PLLs: The processor has no mechanism by which it can keep a beat. It can't just look at the MSR and say "Ohp, gotta go 3.0 GHz. Ok. Imma goin' 3.0 GHz." It has to receive a constant stream of rhythm-keeping from something: the PLL. There is a crystal and a chip that together form a PLL, which stands for "Phase Locked Loop". The processor sends whatever is written at a certain spot in the MSR to this chip. That message sent from the processor to the PLL chip tells the chip what frequency to produce. The processor is connected to this rhythm made by the PLL and goes however fast that rhythm is going, which forms the clock speed of the processor.
Of course that is overly simplified, because there is the multiplier, the front side bus (FSB) speed, and other clocks going on, but that shows the connection between MSR and PLL.
It's my guess that different PLL chips speak different "languages", meaning one chip abides by one set of codes and meanings thereof, and another chip abides by another set of codes and meanings thereof. So if you want to set the FSB to, say, 400 MHz, you have to know the code that means "400 MHz" for your particular PLL. So I'm guessing that the alphanumric code printed on the PLL chip tells you what language your PLL speaks, so you know how to communicate "go 400 MHz, please" to your PLL, which, in it's langauage, is what you write to the MSR for the processor to send to the PLL. So you can't know what to write to the MSR until you know the language of your PLL.

I'm also guessing that if, say, the FSB speed and the speed of your SATA controller are "locked" together, this is due to both being physically connected to the same PLL, to go along with the theme of debunking the myth that the BIOS has any power over such things once the OS is loaded. (The alternative I'm trying to negate would be to theorize that the BIOS isn't providing you the option to clock them separetly, and thus the limitation is a purely software one in the BIOS (the BIOS is software). I'm saying, no, I bet it's some physical limitation.)


Pinmods: You can connect certain pins of your processor to make it go faster. The way I've heard this explained is that the processor reports to the BIOS upon startup what its default speed is. By doing a pinmod, you alter what the processor reports as its default speed.
So that would mean that the BIOS simply writes to the MSR the PLL code equivalent for whatever speed was reported by the processor upon startup. This code is then sent to the PLL chip by the processor like normal, which of course then spits out a steady beat of the requested frequency at the CPU, making it go that fast. If you don't know your PLLs "language", you might have to take this route, because appearently the BIOS does know the language. However, it would still be up to your BIOS whether it wants to use the default speed reported by the processor, or use some other speed it's programmed to use, such as the speed you told it to set it to, residing in the CMOS or NVRAM.


Here's a little more info about PLLs. If you really what to learn about them, Google and Wikipedia search about PLLs.

The PLL governing you CPU is, of course, on the motherboard. Go ahead and take a peak, you people with clear-sided cases. If you're looking for a naked crystal stuck onto your motherboard, you'll probably be looking for quite a while. The naked crystal isn't showing. It has a shell over it, kind of like a turtle or limpet. The "shell" is shiny and metalic, and is shaped like a rectange with half a circle stuck on each end of the rectangle, like a running track you'd find around a football field (U.S football, not soccer). Supposedly there is a chip nearby the crystal, but on my motherboard, the crystal seems to be out all by itself, and I trust that somehow it's connected to a chip somewhere on the motherboard.

Some crystals have the ability to output regularly spaced pulses of electricity over time given an input voltage. This is how a quartz watch works (the quartz is the crystal). In a quartz watch, every so many pulses from the quartz is a second, every 60 seconds is a minute, and so on. A similar idea is at play with the PLL buisness, though not exactly. The PLLs I've read about split a given wave into equally sized pieces, rather than produce a steady rhthym all on their own. In other words, they multiply the input frequency by a whole number. That's how the multiplier works. The wave keeps going around and around the PLL system until it's near perfectly cut up into even peices. If it gets ahead of itself, it pulls back, and if it gets behind, it pushes forward. By going around enough times, it comes out pretty good. So "Phase" refering to what it does with waves, and "loop" refering to going around and around. It's a Phase Locked Loop, a PLL.

On the shiny housing of the crystal is an alphanumberic code. Usually this is almost impossible to read. I found out that you're actually supposed to read the alphanumeric code printed on the chip next to the crystal instead. It's a lot easier to read. But can you find the chip if its no where near the crystal?




Ok, some side ramblings about MSR stuff:

The MSR seems to be used for other things, too. I read about the MSR being used to turn hardware-assisted virtualization on and off. That is determined by one bit in the MSR. There is another bit in the MSR that determines whether you can flip the bit that turns hardware-assisted virtualization on and off. If that bit is flipped to not let you turn hardware-assisted virtualization on and off, that bit is stuck in the locked position until a power cycle clears everything. So if the firmware on startup flips this bit into the "locked" position whilst hardware-assisted virtualization is off, you'll never get to use hardware-assisted virtualization until you modify the firmware itself or whatever setting of the firmware that is telling it to do that, to not do that.

So again, the firmware is gone once the operating system is loaded (it's not being executed on the processor), but the firmware has left behind an effect. So it creates the illusion, often times, that the operating system is running on top of the firmware.
Also, since hardware is initialized by the firmware, hardware can "remember" things from the BIOS or EFI, potentially furthering the illusion.

And I have a hunch that the mode of the processor (real, protected, etc) is determined by bits in the MSR.

Which reminds me of another question I had: "If you're still in real mode, can you flip the hardware-assisted virtualization locking bit back?" Because if that's true, one could simply write a Grub module to do the trick, rather than having to "hack firmware/ settings". You're still in real mode when you're in Grub.

Oh - and I have to wonder about the people who have been saying (to my poll question) that they found it very easy find out how to overclock a cpu in Linux. What software are they using? Did they just have an easy time finding the software? What great searching skill and technique do they have that I don't? I would like to know these secrets.



Ok. Now time for sources/ nice links.

Support that the MSR is in fact what controls the voltage and clockspeed of the processor (see second paragraph of "Background"):
http://www.thinkwiki.org/wiki/Pentium_M_undervolting_and_underclocking
And 7th block of writing within the first post here: http://www.olpcnews.com/forum/index.php?topic=2389.0
And see the next couple links.


You can tell from this conversation that the MSR and clockspeed are related (Ctrl+F for "msr"):
http://forum.notebookreview.com/acer/480992-acer-laptop-phoenix-bios-bios-mod-request-112.html

Support that you write to the MSR, then the processor sends what you wrote to the MSR to the PLL, which creates the requested rhthym, which
directly controls (it is) the CPU clock speed:
Page 18 of this: ftp://download.intel.com/design/mobile/datashts/31407804.pdf
A quote from the above "Voltage and Frequency Selection is software controlled by writing to processor MSRs"
Another: "and the PLL then locks to the new frequency"

There are other Intel documents like the above on that talk about PLLs, MSRs, and clock speeds.

Also, I found some source code that suggests a connection between the MSR and PLL:
http://dev.laptop.org/~rsmith/LinuxBIOSv2/src/northbridge/amd/gx2/pll_reset.c


That cpu-overclocking pinmods work by the processor reporting its default speed to the BIOS upon startup:
Check second post here: http://forums.anandtech.com/showthread.php?t=2182822
Check 10th post here: http://www.techspot.com/vb/topic108719.html *Note: don't let the Google ad throw off your
counting. The ad doesn't count as a post.


Lists a bunch of overclocking-related acrynyms and their meanings. (don't forget the "next page" button at the bottom):
http://www.hardwaresecrets.com/article/Understanding-All-Voltage-Configurations-from-the-Motherboard/995/1

When I give an example of the FSB speed and SATA controller speed being locked together, that notion came from here:
http://www.hardwaresecrets.com/article/How-to-Overclock-a-Socket-775-Pentium-4/198

Here's some pictures of PLLs and getting info off them for overclocking:
http://www.zuneboards.com/forums/showthread.php?t=18125

MSR and hardware-assisted virtualization and those two bits:
One bit turns hardware-assisted virtualization on an off, while the other might keep you from flicking that bit:
http://www.linux-kvm.org/page/Enable_VT-X_on_Mac_Pro_%28Early_2008%29
Look under "The Problem" for "The way is works is that it has 2 flags..."

Hardware-assisted virtualization and firmware hacking:
http://marcansoft.com/blog/2009/06/enabling-intel-vt-on-the-aspire-8930g/




Also, I plan on seeing if I can test this overclocking software in Linux in QEMU whilst QEMU is emulating a processor. Haven't had time to do it yet,
but I did have time to try and test lm_sensors in QEMU (for checking core temp - an important tool whilst overclocking). Turns out that QEMU doesn't
emulate such sensors.

Cheers,
Jake

P.S. If you find out about anything concerning any of this, or another overclocking tool for Linux, post it!
P.P.S. If this works, it will blow your mind: http://www.opengl.org/news/comments/vrizer_linux_library_to_create_stereoscopic_output_for_any_opengl_based_gam/ .
Edited by SpawnHappyJake - 3/29/12 at 9:15pm
post #9 of 34
Thread Starter 
Hi folks, I found a second (counting the MSR kernel module and k10ctl as one, and thus both are "first") tool for overclocking AMD processors in Linux. It's called TurionPowerControl. See/download here: http://amdath800.dyndns.org/amd/

Enjoy!
Jake
Edited by SpawnHappyJake - 4/6/12 at 8:28pm
post #10 of 34
How can I install the MSR kernel module? Is it a package I can get with sudo apt-get install?
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Linux, Unix
Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › Overclock CPU in Linux - Necessary Program Names Given!