Second meeting

I presented a presentation containing introduction and motivation of GPU computing and a simple CUDA  code walk-though. The presentation file is available here.

We planned the weekend project for this coming weekend: a multi touch interface for our sand box. Please stay tuned!

First meeting

On Friday, Jan. 29 we had the first meeting of the club, and the turnout was quite surprising. I did not count but there were over 20 students present. First, I gave an overview of the club's goals and talked about the VGC sandbox. Then, Darin gave a brief overview of CUDA, both a little about hardware architecture and software interfaces. We will continue next week with Meng showing some demos and a discussion of parallel programming in C/C++ and Matlab.

A Short Tutorial of Using Multi Core CPU in Matlab and C

For grads like me, who are running simulations everyday,  one CPU is far from enough. How can we make the best of  multiple cores in our machine?

For those who are more familiar with Matlab, parallel computing toolbox provides an extremely simple solution. Here is a simple way to use multiple cores in Matlab:

matlabpool(4) % creating 4 threads, which is the maximum cores on my machine.

% your code

matlabpool close

In this case, Matlab will launch 4 threads to run your code; if your code has parfor, it will allocate each thread a certain (toughly equal) amount of effort in that loop.

For those who really want to get something done in real-time,  here I provide the simplest way to use the cores that are idle for most of the time:

//make sure that your programming environment support openMP

#include “omp.h”

...

omp_set_num_threads(4); // again, creating 4 threads

#pragma omp parallel

{

unsigned int cpu_thread_id = omp_get_thread_num();

unsigned int num_cpu_threads = omp_get_num_threads();

// your code

}

In this case, you have to use the thread id to distinguish which specific code or data that thread will run. Well, if you meet any problem, feel free to contact me.  See you on Friday.

The party is ON

IMG_0108

We launched the VGC club today @ ECE departmental Christmas Party.

Professors and students showed up and played with our interactive demos. We had a great fun.

A good start of VGC!

Interactive fluid dynamics demo

FLUIDIn preparation for the launch of the Video Geeks Club, I prepared a demo to demonstrate the power and flexibility of GPU programming using CUDA. I hacked a fluid simulation demo in CUDA SDK. It solves PDEs that model fluid dynamics in real time on a GPU (image on right). Then, I computed sparse optical flow using SIFT (scale-invariant feature transform), a robust feature extractor, and inter-frame SIFT-feature matching. The SIFT operator is a perfect tool for single-object matching, and other applications.

SIFT FLOWI used the flow vectors to animate the fluid. Since the complexity is high, all this was programmed in CUDA and executed on a CUDA-enabled GPU. On left is a screen shot from CUDA/GPU  SIFT calculation. The impact of optical-flow 'force' on the fluid is clearly visible in the fluid shot above. Once connected to a video camera, this is an impressive live demonstration. A hand motion in front of the camera permits fascinating interaction with fluid particles on the screen.

I would like to thank Changchang Wu from UNC for  SIFT library used in this project.

Video Geeks Club Formation

A club for video geeks, grad and undergrad students  interested in fun and cool applications of image and video processing, computer graphics and computer vision, is being formed. Prof. Janusz Konrad is club's mentor and Meng Wang, a PhD candidate in the ECE Department, is the club's first member and adviser.  A series of visual demos are being prepared by Meng for club's launching at 2009 ECE and Photonics Christmas Party on Dec. 11, from 4pm to 6pm in the West Library on the 9-th floor of the Photonics Building. Please join us at the demo station.