Possible to use CUDA with Ubuntu 8.04? with geforce 7600GT?

I’m new to this CUDA thing but I am learning it for school.

My desktop is a dual boot XP and Ubuntu 8.04
with geforce 7600GT

Got some questions:

  1. I don’t NEED a geforce 8 or higher card to do use CUDA do I?
    Will it work fine with geforce 7600GT? If I use the make emu=1 command instead of just make?

  2. I am having trouble running the example CUDA programs. After I do
    make emu=1 I get:

“/usr/include/c++/4.2/i486-linux-gnu/bits/c++config.h”, line 149: error:
expected a “{”
namespace std attribute ((visibility (“default”))) {
^

“/usr/include/c++/4.2/bits/cpp_type_traits.h”, line 74: error: expected a “{”
namespace __gnu_cxx attribute ((visibility (“default”))) {

Is this because I am using gcc 4.2? Is this why Ubuntu 8.04 is not supported or is that because of another reason?

If that is the problem how do I go about using a different version of gcc?

  1. Would it just be easier to use another Linux version like Ubuntu 7.04 ?
    or Windows XP?

You can use Ubuntu 8.04, you just have to install and use an older GCC version. You can either hack the Makefiles, or symlink /usr/bin/gcc-4.1 to /usr/bin/gcc.

If you need more info / howto type stuff, just ask.

OK, cool. Well first I did:

sudo apt-get install gcc-4.1

and

sudo apt-get install g+±4.1

So I’m looking in the makefile in matrixmul and it links back to common.mk correct?:

"

include …/…/common/common.mk

"

Then in common.mk I changed these parts:

Compilers

NVCC := nvcc

CXX := g+±4.1

CC := gcc-4.1

LINK := g+±4.1 -fPIC

I then did:

make clean

and then:

make emu=1

I still get the same errors, stuff like:

“/usr/include/c++/4.2/cstdlib”, line 219: error: name followed by “::” must be

      a class or namespace name

using ::__gnu_cxx::strtold;

"

I must be doing something wrong but I’m not sure what.

Should I try the symlink thing?

Whats the command that I do to do that? (sorry I don’t use Linux that much)

Thanks.

Just install 2.0beta would simply fix the problem and you dont need to install gcc-4.1 anymore. The simplist way to switch gcc is to re-link /usr/bin/gcc to /usr/bin/gcc-4.1 and usr/bin/g++ to /usr/bin/g+±4.1
(Maybe there’s some eaiser or better way, but I did this when I am using CUDA 1.1 with new Ubuntu 8.04…)

Only 8-series is capable of running CUDA, but you can always run your code on device emulation mode if you just want to take a look. Read the programming guide first will give you a better idea to understand the whole thing.

I’ve also been dealing with these issues. I successfully built in emulation mode in ubuntu 8.04 after changing the gcc symlinks from version 4.2 to version 4.1 with the following commands:

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

cd /usr/bin

sudo rm gcc g++

sudo ln -s g+±4.1 g++

sudo ln -s gcc-4.1 gcc

if you ever need to change it back,

sudo rm gcc g++

sudo ln -s g+±4.2 g++

sudo ln -s gcc-4.2 gcc

Check out CUDA Development in Ubuntu for detailed instructions on developing CUDA in Ubuntu 8.04. Good luck!

Thanks you very much.
I changed my gcc version and everything seems to work now. Awesome!

I have followed the guide (Life of a Programmer Geek: CUDA Development in Ubuntu) except the part with installing video card drivers. I’ve already had 169.12 installed through synaptic packet manager.

I can compile the sample projects but can’t run Release versions. It says “There is no device supporting CUDA.”.

Do I have to install the older (169.09) drivers for CUDA?

Also, does Ubuntu have those drivers somewhere in the repositories? I’ve had problems installing nvidia drivers by hand in the past.

169.12 has CUDA support in it. The package manager version may not install libcuda.so, which is causing your error messages. When I was fiddling with ubuntu, I used a Envy (http://albertomilone.com/nvidia_scripts1.html) to install the drivers which correctly installed libcuda.so.

Has anyone got CUDA examples compiling and running (not in emulation mode) in Ubuntu 8.04?

With a fresh installation of Ubuntu, I successfully installed the drivers using Envy, with the following commands:

sudo apt-get install envyng-gtk -y

sudo envyng -t

1 (option to install NVidia Driver, I think it’s version 169.12, but I’m not sure how to check which version is installed)

Then I followed exactly these steps to install and compile everything. When I compile in non-emulation mode and run an example, I always get “There is no device supporting CUDA.”

Any ideas? Thanks in advance!

I have.

Remove any NVIDIA drivers that you may have installed from official repositories and manually install driver 169.12 from NVIDIA.com.

An extremely timely post! Following the guidelines of going back to GCC-4.1 and linking to the OpenGL libs as described in the release notes, I too have also had some measure of success today :)

So far make runs until MonteCarloMulti where it dies :( Anyone having trouble here?

What is the formal method of identifying the missing pieces?

It is unfortunate that during this period of thrashing about I’ve managed to kill my once working Nvidia 169.12 device driver.

Judgeing from the number of views of this thread there must be an army of guys using Ubuntu!!

Manually installing the 169.12 driver from NVidia breaks by display every time I try it (on reboot I get kicked to “low-graphics mode”). The current EnvyNG works - it installs a working 169.12 driver. When I make the NVidia examples directory after following this guide, I get the compiler error “cannot find -lcuda”.

If my understanding is correct, this error is caused by the fact that libcuda.so is not present in /usr/lib. I checked, and indeed it is not there, or anywhere on my system. (I am slightly confused, because MisterAnderson42 said that Envy correctly installed libcuda.so…)

In any case, I have working drivers, and compiling/running in emulation mode works. It seems the only thing in my way is this lack of libcuda.so. I don’t want to run the NVidia driver installer, because so far it has broken my system every time. If this is the only way, I am willing to bang my head against the wall even more and find out what is going wrong, but I hope there is another way to get libcuda.so set up.

Does anyone know of a way?

The posts in this thread have helped me a lot so far, thanks everyone!

Envy installed libcuda.so for me on Ubuntu 7.04, sorry I forgot to mention the version earlier. Perhaps EnvyNG for 8.04 doesn’t? It seems so: https://bugs.launchpad.net/ubuntu/hardy/+so…ore/+bug/221304

Holy crap! It works!! It really works!!!
I found libcuda.so.169.12 from some random RPM I found on Google, renamed it to libcuda.so, moved it into /usr/lib, ran make, turned off Compiz, and it worked!!!

I’ve updated my guide with detailed instructions from beginning to end.

Thanks again everyone for your support!