Problems with include paths

Hi All,

I’m new to CUDA. I’m trying to compile one of the sample projects of NVIDIA.
But I get “error: cutil.h: No such file or directory” although I have copied NVIDIA_CUDA_SDK/common/inc on my PATH. Am I missing anything else here?

Thanks Much.

You need to specify include paths with the flag -I

nvcc -O3 -I/usr/local/NVIDIA_CUDA_SDK/common/inc -L/usr/local/NVIDIA_CUDA_SDK/lib -lcutil -lglut

Thanks for the reply. I think the lib path is NVIDIA_CUDA_SDK/common/lib because my NVIDIA_CUDA_SDK/lib is empty. But, now my problem is I get the following error:

“/usr/bin/ld: cannot find -lcutil”.

Thanks Much.

You need to build the cutil library.
Type make from inside NVIDIA_CUDA_SDK.

Seems it is looking for GL/l.h and GL/glu.h but can’t find it.
Everything is set on my PATH and I also included the GL path on the -I option of make.

Thanks Much.

Do you have libGLU installed per the release notes? If so, what is the exact error you’re getting?

  1. Reinstall the SDK.
  2. Type make in the directory you used for the installation.

The only thing you need to add to PATH is /usr/local/cuda/bin (to locate nvcc) and /usr/local/cuda/lib to you LD_LIBRARY_PATH (to locate the runtime and blas, fft libraries).

I did reinstall the SDK, still getting errors. This is the exact error I’m getting:

make[1]: Entering directory /root/NVIDIA_CUDA_SDK/common' src/error_checker.cpp:50:19: error: GL/gl.h: No such file or directory src/error_checker.cpp:51:20: error: GL/glu.h: No such file or directory src/error_checker.cpp: In static member function 'static void ErrorChecker::checkErrorGL(const char*, int)': src/error_checker.cpp:63: error: 'GLenum' was not declared in this scope src/error_checker.cpp:63: error: expected ;’ before ‘gl_error’
src/error_checker.cpp:64: error: ‘gl_error’ was not declared in this scope
src/error_checker.cpp:64: error: ‘GL_NO_ERROR’ was not declared in this scope
src/error_checker.cpp:68: error: ‘gluErrorString’ was not declared in this scope
make[1]: *** [obj/release/error_checker.cpp_o] Error 1
make[1]: Leaving directory `/root/NVIDIA_CUDA_SDK/common’
make: *** [lib/] Error 2

Thanks Much.

GL/gl.h ships as part of the NVIDIA display driver package. Did you install 100.14.11 ?

GL/glu.h is part of libGLU which normally ships as part of Mesa, which is part of most Linux distributions (definitely all the distributions which are supported in the CUDA-1.0 release).

Seems I don’t have an NVIDIA GPU supported by the 100.14.11. So I can’t install 100.14.11.
I was told that if I want to use the emulation environment I don’t need to have a GPU installed. Is that correct?

Any suggestions how can I proceed without installing the display driver?

I could resolve the problem with “gl.h” and “glu.h” by installing MesaLib and libGLU.

But, now when it starts to make the projects, I get the following error:

make[1]: Entering directory `/root/NVIDIA_CUDA_SDK/common’

a - obj/release/bank_checker.cpp_o

a - obj/release/cmd_arg_reader.cpp_o

a - obj/release/cutil.cpp_o

a - obj/release/error_checker.cpp_o

a - obj/release/stopwatch.cpp_o

a - obj/release/stopwatch_linux.cpp_o

a - obj/release/cutil_interop.cpp_o

make[1]: Leaving directory `/root/NVIDIA_CUDA_SDK/common’

make -C projects/fluidsGL/

make[1]: Entering directory `/root/NVIDIA_CUDA_SDK/projects/fluidsGL’

/usr/bin/ld: cannot find -lGL

collect2: ld returned 1 exit status

make[1]: *** […/…/bin/linux/release/fluidsGL] Error 1

make[1]: Leaving directory `/root/NVIDIA_CUDA_SDK/projects/fluidsGL’

make: *** [projects/fluidsGL/Makefile.ph_build] Error 2

Any Suggestions?

The NVIDIA display driver is required if you want to use CUDA with the GPU. Are you attempting to do GPU or HOSTEMU based work?

Before setting up the GPU on my machine, I prefer to start with the emulation. But eventually I will be doing GPU based work. So now I’m trying to setup the emulation environment.

Thanks Much.

Any suggestions?

I’m not clear why you’d want to be running the OpenGL dependent SDK apps in software. They would be unbearably slow (likely 1 or 2FPS).

If you want to run them in emulation, then you’ll need to set the correct linker paths for your assorted OpenGL libraries, or just not build the OpenGL dependent apps. Only you would know where they are on your system.