Jacques Mattheij

Technology, Coding and Business

cuda for the absolute beginner

My brand spanking new graphic card is ‘CUDA’ compatible so I figured I’d give it another try.

The steps to get it working are:

  • install a cuda compatible driver

  • install the cude tools

  • install the sdk (this contains the example code)

  • compile the examples

Meanwhile I’ve upgraded to kubuntu 9.10, and at the last step this lead to some headscratching. It seems that the cuda code will only work when you use gcc 4.3, not the latest 4.4 (it will throw a weird error about not being able to declare ‘memcpy’ weak).

After installing g++-4.3 and gcc-4.3 (and changing the symlinks in /usr/bin/ to point to the right files you still have to install the following packages:

apt-get install libglut3-dev apt-get install libxi-dev apt-get install libxmu-dev

After that run ‘make’ in the ‘C’ directory where you installed the sdk and all the examples should compile without further issues.

Then go to bin/linux/release and enjoy the examples, some of them are simply numerical verifications, some of them have stunning graphics for instance, fluidsGL , particles, nbody, oceanFFT, particles, smokeParticles)

Now, with this solution in hand, let’s go find an interesting problem to solve with it :)