The Soul of a New Machine

I first heard about the Soul of a New Machine book in a talk the CTO of Joyent, Bryan Cantrill, gave where he said that in the book this fresh graduate goes to work in this company and is told to build something impossible, an AI computer, and after a few months without anybody telling him that was impossible he comes back with the machine built.

From the get go I thought that was the premise of the book and that it was a fictional story. However, to my surprise, the story was not fictional and it was not about building an AI computer but instead bringing a 32 bit computer to life in the late 70s.

Building the impossible

The part the CTO of Joyent was talking about was probably the one where the lead of the Micro Software team, Alsing, kept asking West (the manager) to build a 32 Eagle simulator so that his team could test their software without waiting for the real machine to be built. West said the work would take to long but gives the green light to Alsing to go ahead. Alsing asked the fastest programmer he knew at the company, David Peck, employee number 257 to build the simulator. He also asked Neal Firth to work with Peck, Firth was a programming phenomenon and only 22 years old. Alsing put Firth to work under Peck, so Peck would help Firth along the way with his experience. Then Alsing brought Firth to the side and asked him how long would it take him to finish building the simulator, naively , Firth said 2 months, nobody told him that it would take much longer to build a simulator, Alsing estimated at least two years. Then to generate some healthy competition between Peck and Firth, Alsing took Peck to the side and told him that while Firth was building his full blown simulator he needed a quick and dirty one so that his team could start testing.
After 2 months Peck had his quick and dirty simulator and a couple of months after that Firth finished his full blown one.

That story is so true, when you are a fresh graduate from college since you only worked on small projects and all of them were easy to complete you think real problems in the world will have the same level of complexity. Only after some field battles you realize the real complexity of certain projects. Nobody told Firth that the simulator couldn’t be built in 4 months, that’s why he built it.

Even when I think back on certain projects I worked after graduating from college, initially I would have a naive blueprint of the whole thing on my mind which I would only discover that it had lots of details missing while I was working on it. But just like Firth’s simulator case, I would figure it out and finish.
Indeed, ignorance is bliss.

The motivation behind the computer

Overall the book was well divided into chapters where Kidder elaborated on the bios and responsibilities of the people working on the new computer. He made a really good job getting inside the minds of all the workers, ranging from the secretary, to the big manager, the interns and pretty much everybody that had a part in building the computer. He also connected all the dots and made the story very fluid with a beginning middle and end which makes you think that his writing is Fiction instead of a true story.

One common theme of the book that kept reappearing on every bio Kidder would write was that the engineers were not working for money. They had this internal code which they called “signing up” which they would commit their full energy into building the machine, that meant working long hours, weekends, literally focusing their whole life into building the machine. The engineers would say that the best reward was the fact that they were building something new, letting their creativity flow without boundaries. Being part of something bigger than themselves.
That is the key. Being able to combine passion with work. However, there are so many stars that need to be aligned to foster that kind of environment, and that was the role of West, which Kidder depicts very well in the book.

Then it is very funny in the end, the day after the computer was introduced to the market the sales manager for Data General goes to the stage to rally his troops and say:

What motivates people?  

He answers his own question:

Ego and the money to buy things that they and their families want.  

That shows a very different mind set between engineers and sales people.
The beauty is that without engineers sales people wouldn’t be able to sell anything and without sales people engineers wouldn’t be able to build anything since nobody would know what they built it.

VMware Fusion MacBook Pro 2012 3D Acceleration Bug

After a couple of hours trying to figure it out why every time I tried to log in to my Ubuntu VM using VMware Fusion on a mac the vm would crash and restart itself, I came up with a thread in the VMware Communities forum explaining the reason + possible solution for the problem.

Basically what happened was that the Ubuntu would start just as expected, but after logging in it would popup this message:
Screen Shot 2013-01-20 at 9.31.51 PM

Quoting their explanation:

…If you are running a mid-2012 MacBook Pro with the latest Apple updates, you’ll likely encounter crashes unless you disable 3D graphics: With your VM powered off, go into Virtual Machine > Settings, then choose Display, and turn off the Accelerate 3D Graphics option.
For others encountering the same problem: if you only run Windows VMs, you would also have the option of reverting to Fusion 5.0.1 to avoid this issue.

Indeed, after disabling 3D acceleration support everything came back to normal.

Getting started with CUDA on OSX 10.8 - Driver Problems

To install all the dev dependencies for CUDA enabled GPUs is not that bad, I faced a few issues but overall the documentation is pretty good.

You can find more information about how to get started here, it has all the links for the download of the driver + toolkit + SDK for windows, linux and mac

They also posted a PDF giving detail instructions about how to install everything.

Road Blocks

I’m running a MacBook Pro 2012 that comes with a GeForce GTM 650M.
On their website, they have the driver version 4.2 for download. However, I can update the CUDA driver to version 5.0.24 through the CUDA Preferences window under the System Preferences tab.

So after following the instructions they have posted on the Get Started pdf, I would get the message “Driver not supported” when running the deviceQuery test script.
I looked up online and found that this problem usually happened when the driver had a lower version than the SDK, I thought it was weird since I had downloaded all files they had instructed on the website.

I started browsing on the System Preferences when I saw the CUDA preferences tab.
On the tab it had the option to update the driver.
After the update, my driver was on version 5.0.24, and the deviceQuery test would work.

After running the deviceQuery test, they suggested to run the bandwithTest to make sure the communication with the GPU was working properly.
To my surprise, when I ran the bandwithTest the computer crashed, some weird noises came from the case and a kernel panic messaged appeared.

Interval Since Last Panic Report: 75 sec
Panics Since Last Report: 2
Anonymous UUID: CD3F065C-4392-433E-8B7B-9D466743EE14 Tue Sep 11 23:16:23 2012
panic(cpu 4 caller 0xffffff802e8b7b95): Kernel trap at 0xffffff7faef9d18e, type 14=page fault, registers:
CR0: 0x0000000080010033, CR2: 0xffffff8191902000, CR3: 0x000000006b34b06c, CR4: 0x00000000001606e0
RAX: 0xffffff815123d000, RBX: 0x00000000406c5000, RCX: 0x00000000101b1400, RDX: 0xffffff8043302374
RSP: 0xffffff815117b650, RBP: 0xffffff815117b650, RSI: 0xffffff8043302004, RDI: 0xffffff80432ff804
R8: 0x00000000003f6a01, R9: 0xffffff815117b664, R10: 0x0000000000ffffff, R11: 0xffffff8100d10004
R12: 0xffffff80432ff804, R13: 0xffffff8043302374, R14: 0x0000000000000000, R15: 0xffffff8043302004
RFL: 0x0000000000010206, RIP: 0xffffff7faef9d18e, CS: 0x0000000000000008, SS: 0x0000000000000010
Fault CR2: 0xffffff8191902000, Error code: 0x0000000000000002, Fault CPU: 0x4

I wasn’t sure if the kernel panic was connected with the driver update, so I went back and ran some other scripts that come with the CUDA SDK, I ran the particles, simpleGL, volumeRender and a few others, then to my surprise again, when I ran the mergeSort another kernel panic was generated.
By now I was starting to get worried, I went back to the scripts dir and run a few others to make sure my GPU was still functioning properly, I ran the particles, simpleGL, volumeRender and the clock script, and again, after starting the clock script another kernel panic.

Now I knew for sure something was wrong, that shouldn’t be happening.

It was almost 12pm and I was getting tired and frustrated.
I did the only logical thing left to do… googled it.

I entered the search: “mac 2012 crash with cuda driver 5″


To my relief it appeared that the kernel panics were in fact a known problem with the CUDA driver version 5 for the MacBook pro 2012.
I found this post on Adobe’s blog explaining the issue.
Apparently having the “Automatic Graphics Switching” option enable causes some CUDA applications to crash.
Turning the option off solved the problem.

Without the automatic graphics switching ON I ran the bandwithTest, mergeSort and clock apps and they worked just fine.

That Adobe’s blog post was created on August 29, so I believe that a fix for this problem should be coming out very soon.
Only Mountain Lion (Mac OSX v10.8) and Lion (Mac OSX v10.7) are affected by this bug.