GPGPU

From NA-Wiki

Revision as of 00:16, 5 June 2008 by Holst (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

GPGPU @ NADA

To be able to utilize our Nvidia 8800 GTX you must be member of the na-calc group. After you have obtained membership you can login to na46.nada.kth.se where the card is installed.

The CUDA toolkit is installed under

/opt/cuda

where you can find the binaries in the bin subdirectory and corresponding documentation in the doc subdirectory.

It is recommended that you add /opt/cuda/bin to your PATH after login.

The CUDA SDK is installed at

/opt/NVIDIA_CUDA_SDK

Setting up your CUDA environment

If you are a tcsh user you can put this in your .tcshrc

if ( ${HOST} == na46.nada.kth.se ) then
	setenv CUDA_INSTALL_PATH /opt/cuda
	setenv C_INCLUDE_PATH "${CUDA_INSTALL_PATH}/include"
	setenv LD_LIBRARY_PATH "${CUDA_INSTALL_PATH}/lib"
	setenv PATH "${CUDA_INSTALL_PATH}/bin:${PATH}"
endif

or if you are a Bash user you can use this in your .bashrc

if [ ${HOST} == na46.nada.kth.se ]; then
	export CUDA_INSTALL_PATH=/opt/cuda
	export C_INCLUDE_PATH="${CUDA_INSTALL_PATH}/include"
	export LD_LIBRARY_PATH="${CUDA_INSTALL_PATH}/lib"
	export PATH="${CUDA_INSTALL_PATH}/bin:${PATH}"
fi

Running the examples

mkdir cuda
cd cuda
cp -rv /opt/NVIDIA_CUDA_SDK/{projects,common,Makefile} .
make

The binaries will be stored in bin/linux/release

You can cleanup everything with make clean. Note that it will remove the exectuable files under bin/linux/release as well.

Important remark!

If you are using Ubuntu 8.04 and a GCC compiler >= 4.2, then you need to add two symlinks inside your cuda/bin directory

ln -s /usr/bin/gcc-4.1 gcc
ln -s /usr/bin/g++-4.1 g++

Of course you also need to install the compilers,

sudo apt-get install gcc-4.1 g++-4.1

Ubuntu 8.04 without proper CUDA card?

As you know by now there are problems using Cuda 1.1 on a Ubuntu 8.04 system.

But, it can be fixed.

1. Download NVIDIA-Linux-x86-169.12-pkg1.run from nvidia.com

2. Do this,

chmod +x NVIDIA-Linux-x86_64-169.12-pkg2.run
./NVIDIA-Linux-x86_64-169.12-pkg2.run -x 
mkdir ~/cuda-drivers
cp -rv NVIDIA-Linux-x86-169.12-pkg1/usr/lib ~/cuda-drivers
ln -s /cuda-drivers/libcuda.so.169.09 ~/cuda-drivers/libcuda.so

FIXME: complete the howto

External Links

CUDA Zone

Personal tools