Installing NVIDIA CUDA on Ubuntu 8.10

December 18th, 2008 | Categories: Linux | Tags:

After realising that my shiny new Dell XPS M1330 could make use of CUDA I had a bash at installing it on Intrepid.  The notes at the following link were very useful but I did not follow them to the letter.  I can’t remember what changes I made but it was all minor stuff.

lifeofaprogrammergeek.blogspot.com/2008/05/cuda-development-in-ubuntu.html

When I tried to compile the examples that are included in the SDK I got many many errors – some of which included

In file included from src/cmd_arg_reader.cpp:33:
./../common/inc/cmd_arg_reader.h: In member function ‘const T* CmdArgReader::getArgHelper(const std::string&)’:
./../common/inc/cmd_arg_reader.h:416: error: must #include before using typeid
./../common/inc/cmd_arg_reader.h:432: error: must #include before using typeid
src/cmd_arg_reader.cpp: In destructor ‘CmdArgReader::~CmdArgReader()’:
src/cmd_arg_reader.cpp:101: error: must #include before using typeid

A bit of googling helped me determine that these errors were caused by the fact that 8.10 of Ubuntu uses a version of gcc that is currently unsupported by CUDA. The following commands fixed that by changing the default compiler to gcc-4.1

sudo apt-get install build-essential libglut3-dev gcc-4.1 g++-4.1
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.1 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.1

Some other things I did may have helped but it was the two lines above that fixed the problem for me

  1. Madu
    January 25th, 2009 at 04:21
    Reply | Quote | #1

    Hey,

    Thanks a lot for this.
    I have a similar problem. I followed the guide you have posted.
    But I was wondering whether I did something wrong because my ~/NVIDIA_CUDA_SDK/bin/ directory does not have anything inside. IT’s empty.
    The examples seem to be in ~/NVIDIA_CUDA_SDK/projects directory.
    Anyway I am having some problem running hem. Probably because I am a noob at this. Could you kindly exmplain the steps/commands you did to run, for example the fluidGl program. Which one should I ‘make’?

    Thanks a lot.