Monday, March 15, 2010

Linux Presentation

Prepared presentation of Linux History, Introduction and Overview for the beginners.

Can be found here. Linux-Introduction.pdf

Monday, March 8, 2010

Integral computation using nVidia CUDA technology

Recently I wrote an integral computation program on GPU using nVidia CUDA technology. The acceleration is astonishing for the big accuracy in comparison with the analogue program running on CPU which by the way is provided by Henry Golding and can be found in his personal blog.

However to understand the code you should have some knowledge of nVidia CUDA supporting GPU, which can be founded in nVidia's official webpage. But for the usage imho it is quiet friendly.

source code:

Wednesday, March 3, 2010

Compiling CUDA with C/C++

Platform: ubuntu 9.10
gcc version: 4.4.1
cuda toolkit: 2.3

While compiling .cu (cuda) file with c/c++ code developer usually will get following error.

/usr/include/c++/4.4/ext/atomicity.h(46): error: identifier "__sync_fetch_and_add" is undefined

/usr/include/c++/4.4/ext/atomicity.h(50): error: identifier "__sync_fetch_and_add" is undefined
It seems still there are problems while compiling cuda with gcc 4.4 and above.
I found only this way to workaround this problem.
nvcc --device-emulation --compiler-bindir=/usr/bin/gcc-4.3 -arch sm_13 -o run
  • --device-emulation: for cuda supporting device emulation in case if real hardware is not available.
  • --compiler-bindir=/usr/bin/gcc-4.3: to use gcc version 4.3 this will solve the problem.
  • -arch sm_13: in case if atomic function are used in implementation, compiles with 1.3 cuda supporting hardware