Archive for June, 2008

Yay! CUDA SDK is running properly!

Although my work is not closely related to high performance computing, I just had this inherent obsession of optimizing programs to make them run faster (which I consider to be another expression of speed obsession). Last night I finally couldn’t stand waiting endlessly for NVIDIA to deliver the VS 2008-compatible CUDA toolkit and wanted to see for myself the cool examples CUDA SDK provides. Another key factor is that I still have my XP partition, which is something I can afford to screw up.

I then installed VS 2005 on it, but before I can run the examples I also need to install CUDA-enabled driver ( I tried without the driver, it didn’t work). Anyway, the driver version is 177.35 as the time of writing and when I ran setup.exe it prompted that my hardware is not supported in this driver. Hey, what’s up with that? I thought all 8-series graphic cards are CUDA-enabled (mine is 8800 GT by the way), this statement does not stand if I cannot install the CUDA-enabled driver which is required to run CUDA programs.

Googled a little bit, I soon learned that 177.35 was designed for the newest GTX 200 series (280 and 260) and I also found a workaround. Basically by replacing the original nv4_disp.inf (nv_disp.inf in Vista) with a modified one, I tell the installer that my graphic card should also be entitled to use this driver.

After a restart all the examples in the SDK are running properly. Then I plan to move a little further – install the toolkit and SDK on my MacBook Pro (with a 8600M GT). The process was painless except I need to add CUDA to my $PATH. Also worth noting is that only CUDA 1.1 is compatible with OS X (CUDA 2.0 beta2 for most of other platforms), hence there are less examples in the SDK.

One more thing, I still need a CMake module in order to generate my CUDA project files. Luckily some guru has already worked on it (even better, there is also FindCg.cmake). But since I have not tested it yet, I cannot guarantee it will function properly.

One other book that I actually finished

I set out to write this post right after I finished the book (approximately a month ago), but it seemed that I had a little problem keeping up with a good habit of blogging consistently. Anyway the book I am talking about is The Cg Tutorial: The Definitive Guide to Programmable Real-Time Graphics from NVIDIA.

The Cg Tutorial

I became obsessed with hardware-accelerated real-time rendering when GT showed me the beauty and the power of Cg language while I was taking the computer graphics course. As I decided to implement the rendering of some fogged terrain using Cg for my term project, I got this Cg tutorial and had it with me wherever I went for some time. To be honest, the project did not benefit much from this book since the techniques adopted were quite simple and fundamental – barely enough for me to have a taste of its awesomeness. However, what I like about the book is its readability. For beginners like me, the adequate introduction and well explained examples are very easy to comprehend (although an advanced user might find it naive and too verbose on obvious stuff). I finished Chapter 2 through Chapter 9 half a year ago and did not pick up the rest chapters (1 and 10) until recently (I have my reasons).

At first I did have some complaints about the fact that book did not include a basic yet important tutorial on how to connect the Cg programs with the C/C++ programs. They were gone by the time I reached Appendix B, which was exactly what I was looking for. Thus in my opinion, if you are into harnessing the power of the GPU for real-time rendering and are looking for a place to start, this book is definitely worth your attention. Plus, NVIDIA just made it available online and it is free!

Because I was so into graphics by then, I also got myself a brand new GPU Gems 3. Unfortunately, it was for more advanced CG (computer graphics) practitioners and I don’t have any clue about some code snippets (as in what kind of language is this or what is this file format). If somebody has got experience with this book, I would really appreciate it if he/she can share the knowledge.