Having trouble running samples from CUDA toolkit 7.0

Hey !

I am a science computer student and a total beginner to CUDA
I am just trying to run some samples from the toolkit and i got some problems

depend on wich sample it is nvcc doesnt work, for exemple i tried /users/wcqk2511/cuda-7.0/bin/nvcc template.cu -o template.out

and i got this : template.cu:28:25: error: helper_cuda.h: No such file or directory
template.cu:29:67: error: helper_functions.h: No such file or directory

i also got warning using some make → >>> WARNING - libGL.so not found, refer to CUDA Getting Started Guide for how to find and install them. <<<

WARNING - libGLU.so not found, refer to CUDA Getting Started Guide for how to find and install them. <<<
WARNING - libX11.so not found, refer to CUDA Getting Started Guide for how to find and install them. <<<
WARNING - libXi.so not found, refer to CUDA Getting Started Guide for how to find and install them. <<<
WARNING - libXmu.so not found, refer to CUDA Getting Started Guide for how to find and install them. <<<

The samples have a great many dependencies that need to be satisfied. They cannot be compiled and built in a standalone fashion just by compiling a single file (most cannot, anyway).

If you have a proper cuda install, you should be able to go to the samples directory:

/usr/local/cuda/samples

and issue a make command. If you don’t have a proper X and OpenGL installation, the graphical samples will not build correctly, either. The CUDA linux getting started guide has a few hints, and there are many examples on the web about how to get what you need.

For now I would issue make -k and probably most of the samples will build correctly.

Thanks for your answer

Despite the fact i am getting on, i still got problems

some samples still doesnt compile

I used export PATH=/usr/local/cuda-7.0/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-7.0/lib64:$LD_LIBRARY_PATH

so now nvcc is recognized however i still got error message like: WARNING - No MPI compiler found.

I also tried to use: yum install mesa-libGL and yum install greeglut-devel but still error message like → >>> WARNING - libGL.so not found, refer to CUDA Getting Started Guide for how to find and install them. <<<

WARNING - libGLU.so not found, refer to CUDA Getting Started Guide for how to find and install them. <<<
WARNING - libX11.so not found, refer to CUDA Getting Started Guide for how to find and install them. <<<
WARNING - libXi.so not found, refer to CUDA Getting Started Guide for how to find and install them. <<<
WARNING - libXmu.so not found, refer to CUDA Getting Started Guide for how to find and install them. <<<

I dont understand how to install those items

To solve the first warning, you would need to install an MPI implementation on your machine. That sample depends on MPI. If you don’t know what MPI is, you can just skip that sample.

To solve the GL issues, you need to install the necessary GL libraries. The exact method will vary depending on your OS.

If you do a little bit of google searching, you’ll find plenty of explanations for both these issues.

Okay i will skip MPI problem for the moment

RHEL 6 is my os

i tryed to install openGL with 2 differents method but it doesnt seems to work because i still got error messages
→ yum install freeglut-devel
→ yum install mesa-libGL

One method to get all the needed libraries is to install your CentOS 6 selecting the graphical software development workstation option. Otherwise you need to install a number of libraries, something like:

yum install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev

but I have lifted this from an Ubuntu example so the library names are probably somewhat different on CentOS.

A quick google search turned this up:

[url]https://aspratyush.wordpress.com/2012/05/06/install-nvidia-cuda-on-centos-6/[/url]

so why don’t you try what is written there:

sudo yum groupinstall ‘Development Tools’ ‘Development Libraries’

sudo yum install kernel-devel gcc-c++ freeglut freeglut-devel libX11-devel mesa-libGLU-devel libXmu-devel libXi-devel gcc* compat-gcc* compat-glibc* compat-lib*

second command give me this for example

Package gcc-c+±4.4.7-11.el6.x86_64 already installed and latest version
Package freeglut-2.6.0-1.el6.x86_64 already installed and latest version
Package freeglut-2.6.0-1.el6.i686 already installed and latest version
Package freeglut-devel-2.6.0-1.el6.x86_64 already installed and latest version
Package freeglut-devel-2.6.0-1.el6.i686 already installed and latest version
Package libX11-devel-1.6.0-2.2.el6.x86_64 already installed and latest version
Package mesa-libGLU-devel-10.1.2-2.el6.x86_64 already installed and latest version
Package libXmu-devel-1.1.1-2.el6.x86_64 already installed and latest version
Package libXi-devel-1.7.2-2.2.el6.x86_64 already installed and latest version

Package gcc-4.4.7-11.el6.x86_64 already installed and latest version
Package gcc-gfortran-4.4.7-11.el6.x86_64 already installed and latest version
Package gcc-c+±4.4.7-11.el6.x86_64 already installed and latest version
Package compat-libtermcap-2.0.8-49.el6.x86_64 already installed and latest version
Package compat-libtermcap-2.0.8-49.el6.i686 already installed and latest version
Package compat-libstdc+±296-2.96-144.el6.i686 already installed and latest version
Package compat-libstdc+±33-3.2.3-69.el6.x86_64 already installed and latest version
Package compat-libstdc+±33-3.2.3-69.el6.i686 already installed and latest version

but i still got same problems:

WARNING - libGLU.so not found
WARNING - libX11.so not found
WARNING - libXi.so not found
WARNING - libXmu.so not found

You can compile ignoring this warnings, get compile line and paste in terminal