Cuda on Ubuntu 9.04 installation guide

Hello,

I managed to get cuda on Ubuntu 9.04 (pre-release) working. Most of the sdk-tools work, but I’ve trouble with allocating memory e.g.

./MersenneTwister 

Initializing data for 24000000 samples...

cudaSafeCall() Runtime API error in file <MersenneTwister.cu>, line 134 : out of memory.

Here are the steps:

  1. Use the nvidia driver (180.37) proposed by ubuntu

  2. downgrade gcc and g++ to 4.2 (I simply changed the symlinks in /usr/bin)

  3. Download Cuda-toolkit 2.1 and SDK 2.1 for linux-32 Ubuntu 8.04

  4. install Cuda-toolkit to default device (/usr/local/cuda) using sudo. add to PATH:

echo "# CUDA stuff

PATH=\$PATH:/usr/local/cuda/bin

LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:/usr/local/cuda/lib

export PATH

export LD_LIBRARY_PATH" >> ~/.bashrc

(from: Life of a Programmer Geek)

  1. install Cuda-SDK to default device (~/NVI…)

  2. I type make in the SDK directory I got the error that -lGL isn’t found. I found that I’ve to add the symlink libGL.so to /usr/lib. It seems that the nvidia driver deletes this symlink.

sudo ln -s /usr/lib/libGL.so.180.37 /usr/lib/libGL.so

but be careful with deleting any symlinks or creating them.

After these steps I can type make and it compiles, but there are some warnings and error messages.

I hope this guide will work on other systems and will be working on the real release of 9.04

best regards,

paw

Hello Paw,

First, thanks a lot for posting this infos :)

But I still have problems, I followed the instructions (here and I tried other sets), but I still have problems.

I tried to compile many of the examples, even the simplest one I think, “alignedTypes” for example and I get:

/usr/bin/ld: cannot find -lcutil
collect2: ld returned 1 exit status

And I verified that the library “cutil” is installed. Also installing the driver from Nvidia site makes problem, I think that the restricted drivers proposed the Ubuntu (version 180) is more adapted; I have a Nvidia GeForce 8600 GS.

I made trials for two days of interned proposal, I tried to downgrade to Ubuntu 8.10, but nothing works.

Thanks a lot if any one can help.

Bye

Hello AhmedQ,

if you downgrade, you should downgrade to 8.04, since - as far as i know - cuda supports ubuntu 8.04.

I think i remember this error but cannot remember where Ive seen it.

Maybe downgrading to 8.04 or someone else can help. Again I would consequently search this forum, again.

Hi all,

I was able to install CUDA 2.1 on my Kubuntu 9.04 64 bit (kernel 2.6.28-11) using 180.51 nvidia drivers and downgrading gcc and g++ to 4.2.4 version.

If I try to compile non-GUI SDK examples (e.g. MonteCarlo, deviceQuery, ecc.) I have no problems and all works well, but when I compile programs that require GL, I receive this error:

In file included from particles.cpp:43:

../../common/inc/GL/glew.h:1123:20: error: GL/glu.h: No such file or directory

particles.cpp: In function ‘void reshape(int, int)’:

particles.cpp:257: error: ‘gluPerspective’ was not declared in this scope

make: *** [obj/release/particles.cpp.o] Error 1

Indeed, in folder NVIDIA_CUDA_SDK/common/inc/GL the header file glu.h is not present. What I need to do?

Thanks in advance to anyone can help me.

Davide

You didn’t install the glu dev files. Try this (what I always do after a new os install):

sudo apt-get install libglu1-mesa-dev freeglut3 freeglut3-dev libxmu-dev libc6-dev-i386 kernel-package

I think you should be able to compile all of them after that…(only tested on ubuntu 8.04/8.10)

Thank you Mu-Chi.

I only needed libglu1-mesa-dev package. I also installed libxi-dev to solve this error:

/usr/bin/ld: cannot find -lXi

Great!

We recently upgraded to 9.04 and (for reasons unrelated to CUDA development) installed kernel 2.6.28-11-server. As a result, the driver is not loading properly any longer. I’ve tried both 180 and the newer 185 version.

Has anyone tried the server kernel and made it work? Is there a known reason why this is not a good idea?

DonM

is it throwing any particular errors (and you did reinstall the driver with the new kernel, I’m assuming)?

Yes, I should have mentioned that… The errors were during install:

WARNING: You appear to be using a modular X.Org release, but the X

library installation path, 'X: warning; process set to priority -2

instead of

           requested priority

0                                                                                                                    

/usr/lib’, reported by /usr/bin/X -showDefaultLibPath

does not exist.  Please check your X.Org installation.

And one similar one. Of course /usr/lib exists.

The other errors were in /var/log/Xorg.0.log:

....

(II) Loading extension DRI2

(II) LoadModule: "nvidia"

(WW) Warning, couldn't open module nvidia

(II) UnloadModule: "nvidia"

(EE) Failed to load module "nvidia" (module does not exist, 0)

(EE) No drivers available.

Fatal server error:

no screens found

Yet when I do I modprobe nvidia it does in fact load the driver, yet there are no /dev/nv* devices present.

Using above steps in the 1st post, I was able to install Cuda 2.2 on Ubuntu 9.04 (only SDK & toolkit, no Nvidia driver installed as don’t have CUDA h/w, gcc 4.3, glibc 2.9) and able to build all the samples in the SDK with emu=1. Tried running some with emulator and they ran fine (no more cudaSafeCall or cudaMemCpy error).

Thanks,
Nikhail

Hi,

i finally managed to install the cuda toolkit and SDK (2.2) on Linux 9.04, but when i try to run any sample i built it says:

In fact i can’t find the file in the whole system… how should i install it?

EDIT: i found it in usr/local/cuda/lib and i made a link into usr/lib… now most of the demo work, but it says “cudaSafeCall not yet implemented” and “cudaGLRegisterResource not yet implemented” on some demos.

And how i can add NVCC into the terminal commands? When i try to call it, it is not found.

add “bin” subdirectory of CUDA toolkit installation to the $PATH variable (default: /usr/local/cuda/bin)

for example: export PATH=$PATH:/usr/local/cuda/bin

i try doing this but get the following errors:

Reading package lists… Done

Building dependency tree

Reading state information… Done

You might want to run `apt-get -f install’ to correct these:

The following packages have unmet dependencies:

freeglut3-dev: Depends: libxt-dev but it is not going to be installed

             Depends: libxext-dev but it is not going to be installed

libx11-dev: Depends: libx11-6 (= 2:1.1.5-2) but 2:1.1.99.2-1ubuntu2 is to be installed

          Depends: libxau-dev (>= 1:1.0.0-1) but it is not going to be installed

          Depends: libxdmcp-dev (>= 1:1.0.0-1) but it is not going to be installed

          Depends: x11proto-core-dev (>= 6.8.99.8-1) but it is not going to be installed

          Depends: x11proto-input-dev but it is not going to be installed

          Depends: x11proto-kb-dev but it is not going to be installed

          Depends: xtrans-dev but it is not going to be installed

          Depends: libxcb-xlib0-dev but it is not installable

libxmu-dev: Depends: libxext-dev but it is not going to be installed

          Depends: libxmu-headers (= 2:1.0.4-1) but it is not going to be installed

          Depends: libxt-dev but it is not going to be installed

i have downloaded the following dependencies but im not able to install them via the GUI or console in kubuntu 9.04…how to install them??

do i need to copy them somewhere and run “sudo apt-get install libglut3-dev”…

thanks in advance…

i try doing this but get the following errors:

Reading package lists… Done

Building dependency tree

Reading state information… Done

You might want to run `apt-get -f install’ to correct these:

The following packages have unmet dependencies:

freeglut3-dev: Depends: libxt-dev but it is not going to be installed

             Depends: libxext-dev but it is not going to be installed

libx11-dev: Depends: libx11-6 (= 2:1.1.5-2) but 2:1.1.99.2-1ubuntu2 is to be installed

          Depends: libxau-dev (>= 1:1.0.0-1) but it is not going to be installed

          Depends: libxdmcp-dev (>= 1:1.0.0-1) but it is not going to be installed

          Depends: x11proto-core-dev (>= 6.8.99.8-1) but it is not going to be installed

          Depends: x11proto-input-dev but it is not going to be installed

          Depends: x11proto-kb-dev but it is not going to be installed

          Depends: xtrans-dev but it is not going to be installed

          Depends: libxcb-xlib0-dev but it is not installable

libxmu-dev: Depends: libxext-dev but it is not going to be installed

          Depends: libxmu-headers (= 2:1.0.4-1) but it is not going to be installed

          Depends: libxt-dev but it is not going to be installed

i have downloaded the following dependencies but im not able to install them via the GUI or console in kubuntu 9.04…how to install them??

do i need to copy them somewhere and run “sudo apt-get install libglut3-dev”…

thanks in advance…

run “sudo apt-get install libglut3-dev” from console login, it would install that package automatically