Sunday, January 15, 2012

Overclocking in Linux

All of the tools needed for overclocking are freely available for Linux. This post describes how I overclocked my Athlon II X4 635 (2.9Ghz) to 3.5Ghz (250 FSB, 14x) in Ubuntu 10.04-64 (LTS). If you want to skip ahead to an overclock recipe for the Athlon II X4 635 and performance outcomes, scroll down to the bottom.

Prerequisites

In my opinion, the Athlon II X4 series is the best bargain out there in the AMD family. The CPU's are highly overclockable, and frankly, neither the Phenom II nor the Bulldozer series offer a significant increase in performance. Also, the Phenom II requires substantially higher wattage than the Athlon II. The bad news is that the Athlon II's run very hot with the stock cooler. My system would get into the 60's (Celsius) even without any overclocking. So a better heatsink/fan combo is a must. I picked up the CoolerMaster Hyper 212+ for $25 at Fry's. The system runs about 40 degrees cooler (Celsius), and the fan is silent.

Linux Tools for Overclocking

Temperature Monitoring - sensors is a tool that can be run from the command line and will output your current CPU temperature (and whatever other temperature sensors it detects). It is installed by default in Ubuntu. For more details on how to use it, click here. Even handier is the Gnome applet that constantly displays your system temperature on your panel. Simply enter "sudo apt-get install sensors-applet" in Terminal to install the program, and then right-click on your panel to add it to your panel.

Torture Testing - prime95 is probably the standard for stress-testing your overclocked system. I found that with certain overclock settings, my system would run for days without a hitch, but running prime95 for a few minutes would cause it to crash, thus exposing the system's instability at that speed. prime95 will cause all of your cores to run at 100%, non-stop. If your system can survive prime95 all night long, you've probably found some stable settings.

Benchmarking - System Profiler and Benchmark is available in the Ubuntu Software Center. It provides information about your system and also offers about 8 different benchmarks so you can compare how your overclock settings are affecting your system performance. (One thing I learned is that the "CPU CryptoHash" test is useless; the results vary widely, even with the identical setup.) phoronix is also available in the Ubuntu Software Center. It's much more sophisticated, but also much more difficult to learn and use. For a real world test, I also created a large, 30-minute sound file in Audacity that I export as an MP3. Audacity has a time counter that shows how long the export takes. Audacity is also available in the Ubuntu Software Center. I'm not a gamer, but there are many games available that have benchmarking capabilities as well. I've tried running some of the Windows PCMark benchmark utilities under wine or in a VirtualBox, but they never work.

Boot Disk - Ubuntu Live CD 10.04-64 (LTS) I'm probably overly cautious, but I don't think it's a good idea to boot from your hard drive when testing an overclock setup. My hard drive has all of my work and personal information on it, and I don't want to risk corruption due to an unstable overclock. So I disable my hard drive and boot from a Linux CD for testing purposes. I load the utilities I will need on a thumb drive to save time downloading them from the Internet.

The Process

Had I known just how time-consuming it is to overclock a modern computer system at the beginning, I probably wouldn't have bothered to try. Back in the old days, overclocking was a simple matter of playing with bus speeds and CPU multipliers. Nowadays, just about everything is configurable, which means it takes forever to find the optimal combination of settings, or "recipe." Here is the the hardware I had to play with, and what I did to find my optimal settings.

System Specs

CPU: Athlon II X4 635 (2.9Ghz, locked multiplier)

Mainboard: Biostar TA880GB+
RAM: 16gb DDR3-1600 RAM, Patriot PGV316G1600ELQK
CPU Fan: CoolerMaster Hyper 212+
Default (stock) Settings: 200Mhz FSB, 14.5 CPU muliplier, RAM running at 1066, 2.0Ghz HyperTransport link, CPU VCore 1.4V

Overclocking

Before starting, I disabled Cool'NQuiet in BIOS, which will mess with your CPU speeds and interfere with testing. You can always turn it back on later for power savings if desired.

There are two basic approaches that I tried. First, I just tried increasing the FSB (Front Side Bus) speed. I could only get to 220 Mhz without crashing, so I realized I needed a different approach. My mainboard allows the HyperTransport link speed and RAM speed to be set independent of the bus speed, which makes things a little easier. So I tried decreasing the CPU multiplier, HyperLink transport speed, and RAM speed, while increasing the bus speed. I found I could get to a 250FSB speed without any problems. I then gradually increased the RAM speed, HyperLink transport speed, and CPU multiplier until I found problems. I found that my limiting factors were my RAM speed (stable at 1066) and CPU multiplier (stable at 14x). Unfortunately, my mainboard does not allow increasing the HyperLink transport speed beyond 2.0 Ghz, so it is stuck there. (It can only be decreased below that speed.) I did have to give the CPU some extra juice; I increased it up to 1.524 Vcore. I found that the RAM speed could be increased if the timings were loosened, but the performance didn't really improve.

Results

So here are my final overclock settings:
250 FSB, 14x CPU multiplier (3.5Ghz), 2.0 Ghz HyperTransport link, DDR3-1066 (7-7-7-20 timings), VCore 1.524

The system ran stable overnight, with a max temperature (running the prime95 torture test all night long) of 53 degrees Celsius. In my daily use, the system usually runs in the low 20's.

As far as benchmark comparisons, a detailed comparison can be viewed on Phoronix here. The results include a number of different systems, but you will note that it includes two entries for my Athlon II X4 635, one at the stock speed, and the other overclocked.

As far as basic comparisons with the System Profiler and Benchmark, as well as my custom MP3 test with Audacity, here are the results. All measurements are in seconds--the lower, the better.

Default (Stock) Settings:
Blowfish: 3.35
Fibonachi: 2.61
N-Queens: 10.04
Export large MP3 : 78

Final Overclock Settings:
Blowfish: 2.77
Fibonachi: 1.7
N-Queens: 7.86
Export large MP3: 62

So I achieved roughly a 20-25% increase in performance, depending on the benchmark.

2 comments:

  1. what frequency is reporting /proc/cpuinfo? is it the new one or the stock one?

    Thanks,

    Dan

    ReplyDelete
  2. /bin/cat /proc/cpuinfo reports the OC'd speed of 3500.193.

    ReplyDelete