Overclocking A Lynnfield Intel i7 860 on an Asus P7P55D-M

December 30th, 2009

So after all the guff I had to go through getting the Gigabyte board to post with my memory I ended up going to my tried and true brand – Asus. After dealing with the awfulness that is VIA way back in 1998 I have been using Asus boards almost exclusively. Frankly an extra two percent performance or a headache by going elsewhere is not worth it for me. Maybe I have just been lucky or maybe there is a reason Asus is the largest mainboard distributor in the world. Setting all that aside, let’s get to the point of this article. Once I had my shiny new board and processor I wanted to jump straight into overclocking… but oh how things have changed!

As features are brought directly onto the CPU (PCI-Express, memory controller, graphics in some cases) a whole new world of settings must be handled. Of course I don’t give a whit about any of that. I want to find a max cpu speed pronto. Please don’t make me read ten pages of techno jargon just to figure out if I can hit 4ghz. Before we get started make sure you install CPU-Z, Prime95 and ASUS PC Probe so that you can monitor everything. Let’s get to the meat of it.

Finding your max CPU speed w/o HT

  1. Enter BIOS and disable Full Screen Logo from “Boot -> Boot Settings Configuration -> Full Screen Logo” so that you can see what is going on when you boot
  2. Under the AI Tweaker tab set “AI Overclock Tuner” to manual
  3. Extreme Phase Full Power Mode to “Enable”
  4. Your BCLK defaults to 133. Raise this to raise your processor speed. Start out at something moderate like 166 for a 25% overclock. Stability deteriorates around 205 on most boards.
  5. DRAM Frequency – set this to the lowest non auto setting. Now you don’t have to worry about the memory introducing stability issues. For the record you should already be running high end memory for O’Cing. I would recommend DDR3-1600 at a minimum. You want this to prevent your memory from bottle necking your system stability.
  6. QPI frequency you don’t have much control over, but set it to the lower of the two values. You do not want this value over 7500 or so.
  7. VCORE over voltage to .2. This is the max safe voltage for Lynnfield – the default 1.2V + .2V = 1.4V
  8. DRAM voltage to 1.6
  9. Disable HyperThreading from “Advanced -> CPU Configuration -> Intel HT Technology”
  10. These manual adjustments should automatically disable Intel Turboboost, but if you see the options available then turn off SpeedStep and TurboBoost.
  11. Boot into Windows and open up PC Probe and CPU-Z to verify your settings. Run Prime95 and check your voltages and temps for safety.

For the records sake I was able to hit a stable 4ghz using this method. I could probably have gone further, but I was interested in a Hyperthreading O’C because I do a lot of work with digital video. Those extra four threads should make quite the media encoding difference!

Finding your HT CPU speed

  1. Downclock yourself to something reasonable like 165 BCLK again and reenable HT.  The computer does a kind of full shut down and restart when you toggle HT which was at first scary, but no worries.
  2. Go back to AI Tweaker and set your voltage offset to .1 (will have been at .2 from previous test). I found that with my processor HyperThreading did not like the extra voltage used for non-HT oc’ing at all. By doing this I was able to stably overclock to 3.8ghz instead of 3.5ghz.

Finding your max memory speed

  1. Set your BCLK back down to 133 and choose the fastest memory speed you would like to test. You can inch the speed up or down by raising/lowering the BLCK. I was able to find a stable value of DDR3-1700mhz for my DDR3-1600 memory. I kept all other memory settings at their defaults. There is a lot you can do here, but a little bit of memory bandwidth just doesn’t make that much of a difference for the majority of apps.

So now that you have all your information you can combine your max memory O’C with your max CPU O’C and scream along. I hope somebody finds this article useful!

Gigabyte P55M-UD2 and Rapid Beeping

December 29th, 2009

While setting up my new rig I ran into an unfortunate problem with the Gigabyte P55M-UD2 motherboard. All my attempts to boot were greeted by a rapid fire beeping sound from the motherboard (short beeps). There were four motherboard lights that lit up green green orange red. After some googling I found that the lights have nothing to do with boot error codes and everything to do with reporting how much power the mobo is currently drawing. I know for a fact that Dell uses a four light system and some other motherboard manufacturers also use it to report boot errors. Gigabyte gets some demerits for implementing a “nice thought” feature that is a red herring.

So how do you fix the rapid fire beeping problem? I tried the usual stuff first. No case, one stick of memory in first slot, video card and processor. Next up came the manual and continuous short beeps indicate a video card error. Three video cards later I determined that was not the case. So I start systematically eliminating problems. Swap memory sticks, swap psu’s, swap cpu coolers, swap video cards…. ack. Back to my friend Google and I finally determine that memory errors cause the problem. That’s funny because there is a beep code for memory errors and it sure isn’t rapid fire beeping! I was using certified memory and it was erroring. No problem, swap sticks. No dice. It turns out you have to boot with the single stick of memory in the second slot. Ai yai yai. Seriously? This motherboard wasted a good two hours of my time as I systematically pulled every component of my system apart trying to identify the error.

For those interested I was running the 1.0 version of the board and it had the F3 BIOS installed.

Update 02/15/10 – It appears that people are hitting this article fairly frequently while searching for beep codes. So hear is the full list.

1 short: System boots successfully
2 short: CMOS setting error
1 long, 1 short: Memory or motherboard error
1 long, 2 short: Monitor or graphics card error
1 long, 3 short: Keyboard error
1 long, 9 short: BIOS ROM error
Continuous long beeps: Graphics card not inserted properly
Continuous short beeps 1: Power error
Continuous short beeps 2: I found that this is a memory error. Try running a single stick in each of the slots. For me the second slot did the trick. After the first successful boot I stopped running into this error.

Chrome OS for the Masses… or is it?

December 10th, 2009

So Chrome OS is cool and everything, but what is going to make people switch to it? Like most new user environments Chrome OS  needs a killer app. As my cousin and his wife so adeptly pointed out – Google Docs suck and my regular computer can do everything that Chrome OS does anyway. Why do we care? And the truth is getting regular people to care is going to be a problem. Fortunately for Google there is a market that will be far more receptive to the Chrome OS business model and I was surprised it wasn’t touched upon during their press conference.

Small businesses. My wife’s Uncle Mike and I were just discussing a unique problem in small to medium sized business at my wedding this summer. They have all the technology requirements of a large organization with none of the budget to manage technology problems. Outside consulting is expensive and because those consultants are not involved in the day to day operations they can’t pop over to fix Jane’s laptop over lunch. Enter Chrome OS and the perfect target market for their product.

Imagine you are a small business owner and you have a number of field agents that are reliant on a laptop for field work. They don’t need anything complicated. Email, web, and SAAS (software as a service – think gmail for business) to get their job done. You don’t want them installing World of Warcraft or Bejeweled on company property. You don’t want them downloading the virus of the week and exposing proprietary client and company data. Enter a product that does all those things. Now make it cost $300 or less. Now make it so that if a field agent’s computer goes down they can be back up again in minutes. All their data is secure. Don’t want to fix the computer? No problem, throw it out. Let’s face it, hardware is cheap and fixing and maintaining hardware is expensive. Really expensive. This is where Chrome OS can kick some proverbial butt.

This is only half the equation though. If ChromeOS is successful it creates a lucrative secondary market for SAAS and provides an incentive for third party developers to write custom applications for businesses. This economic opportunity will have a reinforcing effect on Chrome OS in much the same way the iPhone and the Apple App store have a symbiotic relationship. Each is better because of the other. On a brief aside – can you believe that iPhone apps can only be developed on a Mac? I mean seriously? Apple controls less than 5% of the OS market and yet has the most successful app store? See what happens when you create a hardware environment that people want and don’t limit your users from software applications they want and need!

I boldly predict that Chrome OS will be successful because it is inexpensive, easy to understand, solves both consumer and business needs and provides new revenue models for software developers. I think that this will happen within thirty months. So set your bookmarks, mark your calendar and come back later to see how perfect my prognostications are. Now if you will excuse me I have to get back to overclocking my divining rod.

You sure this thing works?

You sure this thing works?

Chrome OS Targets the Masses

November 20th, 2009

For those not in the know Google has announced an operating system developed in house called Chrome OS. I watched the hour long live launch over the web with interest because Google has its hands all over the web. You can see for yourself by signing into Google Dashboard and perusing all the minutiae of information that you may or may not know you share with them. You can even peruse your old Google queries if you drink the kool aid sign up for it.

So what is Chrome OS and why do you care? To start, Chrome OS is not Chrome. Chrome is a web browser developed by Google which is fast. Really fast. It is my browser of choice despite the fact that it had flaky mainstream support for awhile. You should try it. Chrome OS is an operating system like Windows 7 or Apple OS X. Except that it is so much more (or less?) than those things. You can think of Chrome OS like a browser on steroids. The idea is that we all spend most of our time on the web anyways – so what’s the point of having to manage a computer, install virus software, make backups (you do do that right?) , install updates, or crying when you spill juice on your laptop and wonder if you just washed away three years of memories.

Chrome OS introduces a “stateless” system. Everything you do is on the internet. There is no more local computer. All your information is stored in the cloud and somebody else’s problem for managing. Say you go to Aunt Sally’s but you left your computer at home. No problem. Log into Chrome OS and the computer looks exactly like your computer at home with everything just the way you like it. Do some work, leave and go home and everything is waiting for you there. Great concept, but are the masses ready for this? Are you ready to give up all your desktop games, Outlook, Paint and migrate to web only applications?

I guess that depends on how frustrated the masses currently are with maintaining a full featured OS at home. My personal feeling is – very unsatisfied. Even I, computer geek extraordinaire is frustrated by the number of trivial and annoying things I must do to maintain a working computer. Chrome OS solves lots of these problems. No more having to worry about antivirus software because the core of the OS is locked down. Just yesterday I spent two hours trying to migrate my wife’s Outlook settings after I upgraded her to Windows 7. Goodness, how do regular people put up with this crap?

On top of saving all this time and frustration, what if I told you Chrome OS boots in seven seconds? And I am not talking seven seconds like you are used to. Where you have a desktop and you click and click and nothing happens. You wait two more minutes and then all of a sudden twelve windows open. Gee thanks. I mean seven seconds until you have a fully functional computer with a browser already opened and you are checking your mail. Now we’re cooking with fire!

Google seems to think that the emergence of low cost, low power netbooks and ubiquitous internet will drive sales of this new device, but I am prophesying that this is going to be much bigger than Google or even Microsoft/Apple think it will be. Dual boot systems on small, inexpensive solid state disks (think 16gb) will make this technologically accessible to mainstream users on existing hardware.

For those nerding out there you can download the open source Chrome OS here and start drinking the kool aid.

Multithreading Revisited

November 19th, 2009

So I was reading an article by John Siracusa on arstechnica.com about  Snow Leopard recently and he had a great segment about Apple’s new Grand Central Dispatch technology. The idea of GCD is to allow developer’s to easily multithread code without having to do all the work that I had to go through. Before I get into that though let’s cover the basis of what GCD is. First of all GCD is a low level means of handling threads automatically. When developing for a multiprocesser system developers don’t have much knowledge of what the current system state is. Sure I have four cores, but how many are available? Once you let GCD know you want something threaded it can farm out the work for you. No checking for number of processor cores or if hyperthreading is available. Sweet.

Grand Central Dispatch also allows you to multithread in just a few lines of code. John does a great job of explaining it so hit the link above and read up if you want more in depth information on the technology. The short version is that blocks + GCD = multithreading bliss.

So all of this got me thinking about my previous article on multithreading a workload and how I could improve it. One thing that would make sense would be to use a stack instead of splitting my list up into equal parts. A stack is like a pile of paper. You can pull things off the top of the stack and expose the page underneath. So if I passed the same stack to each thread then the threads would peel off the work bit by bit until the stack was gone.

  • Once the stack is empty then the threads will terminate themselves.
  • I could add work to the stack as it is being processed (of course being careful that the threads don’t terminate before I am done collecting work)
  • I don’t have to worry about one subset of work finishing faster than another.

So let’s run a little pseudo code for this framework:

private void Multithread()
{
  Stack<int> stack = new Stack<int>(100); //stack of 100 something
  for (int i = 0; i < 100; i++) { stack.Push(i); } //fill the stack
  Thread[] threads = new Thread[System.Environment.ProcessorCount];

  //Create the threads and pass the same stack to each one
  for (int i = 0; i < threads.Length; i++)
  {
       threads[i] = new Thread(delegate() {
                      DoSomething(stack);
                    });
       threads[i].Start();
  }
<pre style="font: normal normal normal 12px/18px Consolas, Monaco, 'Courier New', Courier, monospace;">   //wait for execution to finish
  foreach (Thread thread in threads) { thread.Join(); }</pre>
}

And our worker function which will terminate once the stack has emptied

private void DoSomething(Stack<int> stack)
{
 while (stack.Count > 0)
 {
    int j = stack.Pop();
    Debug.Print(j.ToString());
 }
 return;
}

Marathon Training Begins

November 17th, 2009

Dan Corbera of Urbanathlon fame, Joel Desjardins and myself have all set a goal to tackle the Hyannis full marathon come February 28th, 2010. I am following the Runner’s World sixteen week training program and I am off to an ignominious start.  I visited the track on Tuesday for my first day of training. The training schedule called upon me to run two miles at race pace, 1 mile at 105% of race pace and finish up with two miles at race pace again. It had been three weeks since my last run which was the Urbanathlon, but I felt good and hoped things would go well.

Read the rest of this entry »

Urbanathlon 2009 Finished!

October 21st, 2009

So I am finally back from Chicago where I finished my first ever Urbanathlon. I beat my personal goal of an 8:30 mile with an 8:22 and I am super stoked about the result. The best part was that I felt great at the end of the race and I know I could have run it even faster! The obstacles were great motivators. I could feel as I closed in on them the urge to run faster and pound through them. As I tackled an obstacle a surge of endorphins rushed in and catapulted me onto the next one. I can see these types of races becoming significantly more popular in the future.

Dan and I Strutting Our Stuff Post Finish
Dan and I Strutting Our Stuff Post Finish

Dan and I woke up at 6am to start getting ready for the race. It was cloudy and cool out, but the weather forecast promised no rain and temps in the high forties. Perfect running weather for me. As we jogged the mile and a half down to the starting line the clouds darkened up and half pea sized hail started falling from the sky. This was not going to be a fun race I thought. At least the hail doesn’t soak your clothes, it just bounces off and stays on the ground. We checked our bags and walked around the tent city. Free beer, a climbing wall and free swag awaited us post finish.  By the time the race started the clouds had parted and bits of sun were poking through. The perfect race weather was here! Thank goodness since I decided to take my chances and run in just shorts and a t-shirt.

Dan and I ready to get our run on
Dan and I ready to get our run on

Dan and I started together and he was kind to keep me company for the first mile and then off he went while I trotted at my own pace. I was petrified of the 500+ stairs near the end of the race and how much they would exhaust me. Would I be able to make it over the final wall?

Man can Gretchen take a good picture!
Man can Gretchen take a good picture!

Read the rest of this entry »

The New Efficiency Windows 7 Launch Event

October 15th, 2009

I attended Microsoft’s The New Efficiency launch event for their new Windows 7 operating system. The presentations were targeted to Developers and IT Professionals, although I got the distinct impression that these people were few and far between, but I will get to that in a minute. The event was held off the Boston Common at the Loews theater. The event staff were friendly and helpful. The presentations went off pretty much without a hitch and the giant movie screens were great for displaying demonstrations. My main problem with the event was that the presentations consisted of talking about what features Windows 7 offers (many of which I was aware of from reading internet articles) and very little about how to actually code them.

Hey Windows 7 can do this! Download the demonstration code when you get home!

My response was:

Hey, why don’t you mail me my copy of Windows 7 and not waste my time!

I know I am being harsh, but I expected a lot more depth to the demonstrations, but perhaps the reason for lack of depth is because of what I alluded to earlier at the start of this article. It seemed that there weren’t many developers there. The guy next to me got up and left after the first break, maybe to take a nap in the bathroom stall until he could get his free copy of Windows, and was replaced by a guy that had to ask me what managed code was. The other guy I was sitting next to was nice enough, but admitted he wasn’t a developer. Somebody else decided to shout out to the presenter whether you can use a laptop touchpad to control the multitouch functionality of Windows 7. So perhaps they already knew that this wasn’t a true developer demonstration and were just doing a feature overview for all the computer nerds drooling to get their hands on a free copy of Windows 7 Ultimate.

Anyways, let me get to a quick overview of the features covered.

Read the rest of this entry »

My First Watercooled System

October 8th, 2009

For the uninitiated a water cooled computer is one that substitutes a radiator, water pump and a cooling block to replace the fans in your computer. This allows you to run your computer faster than spec. My first water cooled system was a Frankenstein of parts. For a radiator I used the heater core from a car at the junkyard, I bought a pump at the aquarium store, ordered a copper cpu block online and hooked everything together with tubes and fittings from the Home Depot plumbing aisle. To power the affair I dismantled an old PSU and stuffed it into my case.

I was no expert and combining water, electricity and knowing just enough to get yourself into trouble… I got myself into trouble. The thing about PSU’s is that they contain high energy capacitors that can discharge very quickly. So you need to be careful to not touch them and kill yourself – which has happened before. In hindsight having a hacked up PSU in my case was not the greatest of ideas. One night while trying to force something or another into the case I was greeted with a flash of light, a billow of smoke and the lights going out through the entire house. From downstairs I could hear my roommate Mike calling up… “Tom?!”

Needless to say I lived and after dealing with leaks, cutting my case up with a dremel, and tweaking my computer to the fastest speed possible I finally had a working system. It was a lot of effort and I loved that computer. I ran blacklight sensitive automotive radiator fluid through it and would use it to host music at parties. I enjoyed people walking into my room and exclaiming – “What is that?!” Most of all I enjoyed the process of building something unique and seeing it work. These days you can just order up a water cooling kit and hook it up in fifteen minutes, but in those days it took blood and sweat.

Simple Multi-threading of a Workload

September 28th, 2009

Recently I was faced with a prescreening programming question that involved a straightforward problem with one caveat that made it significantly more difficult. I had to compute some 800 trillion+ solutions in as close to 20ms as possible. It only took me a couple days to write an algorithm that could theoretically solve the answer… but it would have taken weeks to run. Eventually I figured out the shortcut to get my run time to less than a second, but carving away each tenth of a second thereafter took some creativity. One obvious way of making up some time would be to make use of the near ubiquity of multicore processors these days. Fortunately the workload was simple enough to split up. I had a large list of objects and I had to do “something” to each element. By splitting the list and farming out the workload to the number of processors in the system I carved off a nice 40% time savings on a segment of my project. Again we will be working in C#.

Jump to final code

Generally the code flows like this:

  1. Add references
  2. Find the number of processors on the current system
  3. Split your workload into pieces
  4. Create a thread for each piece
  5. Wait for the threads to complete before continuing main program execution.

First off add a reference to the System.Threading namespace

using System.Threading;

Next find the number of processors

int numProcs = System.Environment.ProcessorCount;

For my workload I am splitting a list into equal parts. I have to ensure that when I split the list I don’t repeat any of the elements, nor do I leave any elements behind if the list isn’t evenly divisible by the number of processors in the system. It would also be more efficient to check the length of the list and see if it is worthwhile to multithread it. If you only have one list item then multiple threads aren’t going to do you much good.

List<N> myList = new List<N>();
int iRange = list.Count / numProcs;       //# of elements in the list to get
int iStart, iEnd;                        //portion of list that we will get

//for each processor get a piece of the workload
for (int i = 0; i < iProcs; i++) {
     //set start and end values to get
     iStart = iRange * i;
     if (i == iProcs - 1)  //for last processor use the rest of the list
          iEnd = buildRows.Count - iStart;
     else
          iEnd = iRange;

     //Get the subset of list items
     List<N> listSubset = myList.GetRange(iStart, iEnd);
}

Now for the multithreaded part. You create a new thread by creating a new Thread object and specifying a ThreadStart. A ThreadStart represents a method in your program and acts as a delegate. A delegate is an object that refers to a method and can call a method. In this example I want to execute a method on each item in my list. So I create a delegate that points to this method. There are multiple ways to set this up, but the most straightforward way I found is in this example code.

Thread myThread = new Thread(
     delegate() {
          foreach (N item in listSubset) { item.DoSomething();  }
     }
);

You call thread.Start() to begin executing the delegate. However, your main application thread will continue running simultaneously. If you want to wait for all your worker threads to finish before continuing with the main thread you must call thread.Join();. This tells the current thread to wait for the specified thread to finish. Let’s tie everything together now.

private void MultiThreadWorkLoad(List<N> myList) {
    int numProcs = System.Environment.ProcessorCount; //number of processors
    int iRange = buildRows.Count / iProcs;   //# of elements in the list to get
    int iStart, iEnd;       //portion of list that we will get
    Thread[] threads = new Thread[iProcs];      //array of threads

     //for each processor get a piece of the workload
     for (int i = 0; i < numProcs; i++) {
          //range of values to get
          iStart = iRange * i;
          if (i == numProcs - 1)  //for last processor use the rest of the list
               iEnd = buildRows.Count - iStart;
          else
               iEnd = iRange;

          List<N> listSubset = buildRows.GetRange(iStart, iEnd);
          Thread myThread = new Thread(
              delegate() {
                      foreach (N item in listSubset) { item.DoSomething();  }
              }
          );
          myThread.Start();
          threads[i] = myThread;
    }

    //all threads should complete before we continue with main program execution
    foreach (Thread thread in threads) { thread.Join(); }
}