Get off my lawn.

Saturday, September 29, 2007

Fanboy Swag


After waiting 3 weeks for my Ubuntu coffee cup to show up, it arrived today. Here's a picture of it, filled with hot coffee.

I also got a propeller hat and some stickers for my car. Kidding...

Sunday, September 23, 2007

Windows XP on Ubuntu Linux

I was recently sort of inspired by something I saw on the interweb: An image of Dale Cooper's Mac running a copy of Ubuntu Linux in a Parallels session. What was it that inspired me? The fact that a Mac is so powerful it can run a whole other OS inside it? No. It was the sight of Ubuntu Linux of course. I was so inspired that I had to virtualize Windows XP on my Ubuntu box, as seen here.

I used VirtualBox to virtualize XP, and it was pretty easy. I think I'll try installing a copy of VirtualBox on a virtualized copy of Windows XP, and running a copy of Ubuntu inside it. Then, from within that doubly-virtualized copy, I'll SSH into the host machine and run sudo reboot and see how long before it disconnects my session.

Wednesday, September 19, 2007

New Machine

I've been wanting a new machine for awhile. I didn't want to buy a machine off the shelf. Any fully-configured PC you buy these days has Windows Vista on it, which I have no use for. Somehow, the mental image of Steve Ballmer buying something nice for himself with the money I spent on his crap OS just makes me want to kick something. I didn't want to buy a pre-built Linux box, since I hadn't seen any that appealed to me. And as much as I like my wife's Mac, I
didn't want one of those either. I wanted more horsepower and expandability than is available in an iMac, and a Power Mac is too expensive.

That left the "build-my-own" option. I've built a machine before, but that was back when I had the time and inclination to research every available option: Chipsets, video cards, memory type, clock speed, FSB speed, etc. I don't find that stuff interesting anymore, and I can't really keep up with it.

So I went to MicroCenter, and found the nearest teenage mutant ninja geek. Those guys are really into all of the hardware minutiae, and they "research" this stuff all the time. Let me tell you, that's the way to shop for computer parts. I told the guy what I wanted the machine for, and asked him what the price/performance sweet spot is for CPUs. He showed me a 2.66Ghz Core2 Duo. Then he picked out a motherboard, a video card, a sound card, RAM, a hard drive, and an optical drive. I picked out the case. The whole process took about 30 minutes, and I ended up with a machine made out of parts known to work great out of the box with Linux. The sound card is an M-Audio Audiophile, known to have 1ms latency on Linux. That's about as good as it gets! Here are the parts:

  • Core2 Duo E6750
  • 2GB Corsair DDR2 RAM
  • 500GB Seagate SATA II hard drive
  • Sony DVD+RW
  • GigaByte GA-P35-DS3
  • Antec Sonata III case (500W power supply)
  • EVGA 7600GT video card
  • M-Audio Audiophile sound card

Anyway, I put the machine together Friday night, and had it up and running in about 1 hour.

The first thing I did was install Ubuntu Feisty. That went without a hitch, right up until the point where I tried to intall a video driver. I was installing stuff like mad at the time, and I remembered a command I had typed once to install the video driver. I installed it, restarted the UI, and my X server refused to start. I had no UI. I went online, found an article about installing NVidia drivers. It said that the "normal" way of installing drivers isn't as good as installing the driver straight from the NVidia site. I tried that. It worked great, until I rebooted the machine. Then, nothing. I was getting all kinds of errors about the kernel version being different than the driver version, ABI mismatches, GLX modules failing to load, and other annoying crap that no one with kids and a mortgage should ever have to think about.

I was starting to kind of hate Linux. Saturday morning, I decided to start the installation over, from scratch. This time, I followed the "normal" way of installing a video driver: Look at the "restricted driver manager" panel, enable the "restricted driver" you want, and reboot. That process amounted to 1 mouse click, and a reboot. I could have saved myself 10 hours of grief doing that the first time. Duh!

The next thing to fix was the sound card issue. Modules are loaded by the OS in the order they're found, which is basically at random. My machine was loading the sound card drivers that way. So about every other time I would boot, I had sound, and the other times, I had none (The M-Audio card wasn't hooked to anything resembling a speaker). So I started researching that problem, digging through config files, and googling everywhere. I found a lot of information
about module loading, ALSA and other low-level stuff until I found a package that lets you select your default sound card by clicking a button. I chose that approach, having come to prefer it over the others.

That left the final problem, thermal management. The Core2 Duo CPU is about the size of a half-dollar coin. It's clamped onto the motherboard under a big aluminum heatsink with an 80mm fan on top. The motherboard controls the fan speed and also features alarms you can set to alert you if a fan fails. So I set it to alert me if the CPU temp gets too high, and also if the CPU fan fails. Problem is, the fan is controlled by the motherboard. In idle state, the motherboard stops the fan automatically. Then it sounds an alarm to tell you that the fan is stopped. Stupid.

That part was easy enough to fix, but the fan itself had a problem. It seemed to run reliably at startup, right up until the point where the machine goes idle. It would keep the CPU at about 40C, the idle temp of the CPU without a fan, only running when necesssary. But if I let the machine sit for an hour or so in idle state, the fan would refuse to start, no matter what. If I started some process which heats the CPU to the point where it requires cooling, the fan would just sit there. Several times, I watched the temperature climb and climb, and the fan would just sit there, fiddling while Rome burned. Finally, at about 180 degrees F, I flicked the fan blades and the fan started.

I took the CPU/fan back and exchanged them for another one.

I noticed the same problem with the new one. As it turns out, the problem seems to lie with the motherboard's notion of "automatic" fan management. If you let the motherboard figure out when and how to run the fan, it doesn't do anything. So I set it to control fan speed based on temperature. Now the fan never stops. It just idles at around 700 rpm at idle, keeping the CPU at right around room temperature or about 20C cooler than before.

I also installed an extra fan to suck air past the hard drive and blow it past the video card. That dropped the temperature of the HD about 20C.

During this process, I found a cool package of sensors that allow me to have a set of temp guages and fan tachometers on my desktop. It's like running some kind of hi-tech steam engine, including the built-in tendency to burn up/blow up if left alone.

I've never run Linux on a machine with up-to-date components on it. This machine is almost comically fast. Things that took 2-3 minutes on my old machine take a few seconds on this one, and the CPUs don't even scale up to max speed in the process. To test video performance with the video driver, I used glxgears. It displays a set of turning GL gears in a window, and the current framerate. On my old machine, I was able to get 1500 FPS in a small window, and 12 FPS full-screen. On this machine, the numbers are 10,500 FPS in a small window, 4850 full screen. I downloaded and compiled some audio software and the process went so fast I had to verify that it actually happened. I started 4 processes converting 500MB avi files into 50GB dv files to test the cooling, and was still able to write some code in Eclipse while the machine was grinding away on 4 other tasks, any one of which would have kept my old P4 totally busy.

So, what I've learned: Modern Linux distributions are getting pretty easy to install and configure, as long as you know which buttons to click. The process is probably as simple as it's possible for it to be, outside of buying an OS pre-installed on a machine made to work with it.

Also, building a machine from the ground up is a big pain in the butt.