Tuesday, June 5, 2007

First working day at the office


I had my first working day at the office. This morning I rode in on my new bicycle, which I fitted with two locks, so let us hope the bicycle is still outside the office. I spent the first day with two meetings, and getting to know the development environment. Some colleagues here will be having a combat training tomorrow, with actual ex navy seal people. Wow, how cool is that?

Monday, June 4, 2007

On Canadian soil


I have left Holland for Canada. Yesterday, I arrived in Vancouver where I will be working with Slantsix games as a developer. I just arrived at the office for the first time (I had my interview via webcam) and met the people here. They are a very friendly bunch. The office atmosphere is nice, and it really feels like a game studio, although there are no segways parked here :-) This morning I bought a bicycle to get around town. Some bad news about my PS/3 console: it died. It survived the shipping, as I had played on it here in Canada yesterday evening. Today, it will not boot up. I hope I can get it fixed. About my new employer: they recently announced SOCOM: Confrontation. I need to hunt for permanent accomodations now (currently I'm on 1600 Beach Ave), and get myself a social security number. The trip from Holland started with engine trouble, and me almost missing the connecting flight from London to Vancouver, but the second leg went very well. The plane landed 30 mins ahead of schedule. The Canadian immigration officer was much better than the Berlin staff. I had my workpermit quickly. So far, jet-lag is mild.

Saturday, April 7, 2007

Kernel Upgrade


After I upgraded my Cell SDK to version 2.1, I decided it was time to upgrade the kernel as well. Stock releases of the linux kernel are not yet working properly on the PS/3. Also, the 2.6.20 PS/3 kernel that comes with Ubuntu/Feisty would not boot properly for me. The trick is to use GIT to get a development tree as described by Julipedia. I opted to build and install via a proper deb-package. The key here is to get the latest version of kernel-package from Debian's unstable repository, as kernel-package 10.068 has fixed the bug that would mess up make-kpkg commands in GIT source trees. I found that luckily, my ray tracer code would build without problems on the 2.1 SDK. Although I somewhat expected this, as it is standard policy to increase major version numbers when breaking APIs, and this was a minor version number upgrade only. What pleased me less, is that they did not bother to apply the fix I sent to the forums for the triangle intersection bug. The bug is still in there, which is somewhat sloppy I think.

Saturday, March 24, 2007

Folding Proteins


Is it not ironic? I work at a super computing center, yet it turns out that world first petaflop/s computer will be housed right here in my living room in Lelystad. Well, at least a part of that machine will be. Expect the first petaflop/s to be reached this weekend, thanks to the PS/3 implementation of the Folding at Home code. Something amazing has happened here... a handful of PS/3's (currently 20K of them) dwarfed the contribution of the 200K regular PCs. As a matter of fact, if all PCs running folding at home were switched off, computational capacity of the folding at home initiative would hardly be impacted. I have to keep an eye on my energy bill though, as the PS/3 consumes 200Watt. At roughly 20 eurocent per KWatt-hour, it is costing me approximately 1 euro per day. The image of this blog-entry shows the Villin protein, that my PS/3 is currently simulating. One last note: the special purpose computer MDGrape-3 claims to have already reached the petaflop/s milestone.

Friday, March 2, 2007

Ray Tracing Progress


I have made some progress with my ray tracing endeavor on the SPU. The renderer now renders coloured triangles as you can see in the image on the right. It is still un-shaded, but it renders using 6 SPUs at 19.5 fps at a 480x480 pixel resolution for a 304-triangle model. I use no spatial subdivision, so all triangles are tested if the bounding sphere is hit by the ray. The triangles are tested 8 at a time though. All operations are performed with two SIMD instructions, that each process 4 32-bit floats. I opted to test 8 at a time as opposed to the more natural 4 at a time, because this way I get more independent operations that can be pipelined properly. I have also implemented an algorithm that tests 8 spheres for intersection in a single go. Spatial subdivision will be a challenge, as I should somehow create batches of 8 to test. I really need to find some extra performance. The ray tracer of Jacco Bikker shows what is possible. Also, how on earth am I going to implement CSG in a SIMD-friendly manner without much branching? I need to study the algorithm of S D Roth. Unfortunately, this paper is not online.

Tuesday, February 13, 2007

First ray traced image from Cell's SPU


I just created my first ray traced image on a Cell processor (or more accurately: on a SPU of a Cell processor). I ray traced the model you see in the upper right corner of this blog entry. However, that image was created with ivview. My ray tracer output is very sober, because I have not implemented shading, and the output is in ASCII. I am pleased with the code, however, as it is properly vectorized code that shoots 8-rays in parallel on a single SPU. Anyway, here is the image, with the camera head-on with the model's z-axis.

************
************
*** ***
** ****** **
** * * **
** * * **
** * * **
** * * **
** ****** **
*** ***
************
************

Friday, February 9, 2007

SDK bug squashed


I must be getting up to steam: I just squashed my first bug in the official IBM SDK for the Cell Broadband Engine. In my quest to implement Photon Mapping on the SPU, I stumbled upon this nice little gem in the development kit: the intersect_ray1_triangle8_v() function. This function will do 8 intersection tests in a single go, using optimal SIMD stream lining. However, it did not work, where as the single triangle case did. After fixing the SIMD dot3 define, it ran fine. Also, I have put some assorted development info up on my stolk.org site. My first SPU application is getting nearer. I now have to find out how I can cram photons, pixels and triangles in that really tiny 256Kbyte memory of the SPU.

Sunday, January 14, 2007

PS/3 goes retro: PONG using the Wiimote



I have hacked together a Python Game, Wiipong/3 (source available), that lets you play pong on the PS/3 using Nintendo's Wiimote. You simply tilt the controller to move the paddle on the screen. The little game builds upon the wiimote driver for linux, called WMD.




This is all possible thanks to the brave new world, which is rapidly becoming an Open World. A few years ago, I could not have predicted that game console manufacturers would be using open standards, and providing Linux kernels. Maybe Indrema was just ahead of its time.

Some details: the action shot shows a Xubuntu desktop, projected at 1080p with a high end DLP projector (Optoma HD-81). The game uses WMD to interface with the wiimote, and PyGame for the 2D graphics. WMD uses the standard Linux bluetooth stack BlueZ. The Wiimote is sold for 40 euros, and makes a nice interface device for any GNU/Linux system.

My thanks go to Robert Belleman who researches Scientific Visualization and Virtual Reality. Robert suggested doing this hack.


Thursday, January 11, 2007

Jumping Platforms


Getting Yellow Dog Linux installed was a lot of fun. But when I wanted to do some serious development, I quickly became stuck with the yum tool, and managed to damage my dependency tree. At first, I tried Fedora Core 6, but when I had that on my hard disk, I decided that I really wanted apt, and not yum. Debian and Ubuntu have not yet provided PS/3 install disks, but there is this neat little thing called debootstrap.

Using this, I could create an Ubuntu edgy installation on a USB memory stick using Fedora. After booting with the memory stick, the same process installed Ubuntu back onto the hard disk again.

So that means that I'm now apt-getting my way towards a robust, powerful OS on the PS/3. Now it is time to start developing for the Cell Broadband Engine and its powerful SPUs.

Friday, January 5, 2007

The penguin unleashed


This blog entry is written using the Firefox browser that is running on Yellow Dog Linux for the PS/3. Sony has done a good job on making it easy for users to run another OS. Also, Yellow Dog Linux installs right out of the box. The install must be done in text-mode, because I can only run 480i. After the installation is done, the video signal can be configured to do 576i as well. This is one area where Linux does better than Sony's GameOS: the latter will not do 576i due to the fact that my PS/3 was a Japanese edition. The distribution comes with a GCC cross compiler for the SPU units. As I do some work for the OpenDE project, I tried building that. I'm happy to say that OpenDE builds out of the box.

First gaming experience


The first thing you will want to know with a new toy like this: is the gaming any good? Well, I must admit that my expectations were considerably lowered when reading the reviews on the net. Metacritic is always an excellent source for reviews. From this I learned that the real gems are not there yet. Also it turns out that Call of Duty III on the xbox360 is better than the PS/3 version.

So, where to get the games? As they are not available yet in Europe, I would need to get them from US or Japan. But fortunately, Sony has its own version of Microsoft's XBOX Live Marketplace. Here you can download demos for a lot of games, to get a taste. Downloading a demo is convenient and fast, so I had Motor Storm on my harddisk in no time. Wow!, what a game. It is instantly playable, no learning curve, and brutal action from the get-go. The physics engine makes this game really shine. The physics are accurate, yet adapted for Arcade play. So now I know: even if you get a PS/3 for gaming, instead of getting one for running GNU/Linux, you will still have a great time.

Thursday, January 4, 2007

Super Computing?


So, can you do Super Computing on a PS/3? Well, people have been evaluating the Cell processor for scientific computing. The results are impressive. So, 0.2 teraflop per second (single precision)... is that super computing?

My day job is Virtual Reality Engineer at the Dutch Super Computing centre SARA. Currently, we have two SGI super computers running at our centre. The older one is a MIPS based machine from the year 2000 (see photo) that fills up a large room. It is comprised of 1024 processors, and at the time of installation, peaked at 1 teraflop/s. Going by the standards of the year 2000, the PS3 is basically a super computer in a very small form factor. The SGI had a 1 Terabyte shared memory though, whereas the PS3 features a mere 256 Mbyte. But what is really impressive, is the fact that the Cell processor can deliver this 0.2 teraflop/s using merely 40 Watt electrical power.

The real challenge here, is to unlock all that power. With the Cell processor, the parallel programming is a very low-level and explicit affair. I'm really anxious to see if I can get some performance out of the processor, using GNU/Linux.

Stuck at 480i

Getting a decent video signal from my PS3 is proving to be quite a challenge. Out of the box, my Japanese console is generating an interlaced NTSC signal of 480 lines on its composite video connector. This is pretty bad. NTSC 480i is the ugliest video standard available. And to make matters worse, it is made available as composite video, the second worst possible connection after RF connectors. In the settings menu, I have been unable to force a PAL (576i) mode.

So, how to proceed? Rumor has it that PS2 video cables should work on the PS3. I managed to find a playstation SCART cable, but the price was a ridiculous 49 euros (US$ 65). This is way too steep for a very simple PS2 cable, for which I'm not 100% sure will work with PS3.

Other alternatives? Well, the proper way to hook up a PS3 to a screen is via HDMI. The PS3 has a really good HDMI port that supports version 1.3. The PS3 lacks a proper video scaler though, so if you want to go HDMI, you will want a native 1080p screen. Additionally, your HDTV screen needs to support HDCP. This means getting decent video signals from your PS3 is a very expensive undertaking. At least my XBOX360 has standard VGA output, available at all sorts of screen resolutions.

The adventure begins


It has begun. I just signed off the package that was delivered to me from Japan. I was relieved to find in it, the 0.2 TeraFlop/s supercomputer that they call PS/3. The 20Gbyte model shines in its majestic piano black. The ebay seller was really great. Getting the electrical juice into the beast is easier than I expected: I do not need a JAP/EUR converter, just a regular euro powercable from any old computer will do. The manuals are in Japanese only, so I have to do some googling now, and then I can switch it on. I will report back later.