Cuda and Gcc

Hi all,

I am a beginner with Cuda, so I am trying to run an example.
But when I try to compile the cuda file, I have this error:

nvcc -c *.cu -I. -I/Developer/NVIDIA/CUDA-5.0/include/

In file included from /Developer/NVIDIA/CUDA-5.0/include/cuda_runtime.h:59:0,
                 from <command-line>:0:
/Developer/NVIDIA/CUDA-5.0/include/host_config.h:82:2: error: #error -- unsupported GNU version! gcc 4.7 and up are not supported!
kernel_code.cu:9:26: fatal error: cutil_inline.h: No such file or directory
compilation terminated.

It seems that gcc 4.7 and upper are not supported.
Is that normal?
If yes, what is the most recent version supported?

Regards,

The CUDA toolkit usually is designed to work with whatever the standard compiler is for each supported Linux distribution. What Linux distribution are you using?

The problem could also be the use of CUDA 5.0 instead of CUDA 5.5. The release notes for CUDA 5.5 show support for gcc 4.7 on several common Linux platforms:

[url]Release Notes :: CUDA Toolkit Documentation

Hi,
thank you both for your answers.

  • I work on Mac OS X 10.9, not linux :s

  • I don’t understand why I still work on Cuda 5.0, because yesterday I downloaded and installed the last version, but I don’t see any trace of Cuda 5.5 in my laptop :s

I dont know why, but the Cuda 5.5 version was completely hidden and not found by the command line “locate”.
So now it compiles correctly.
Thank you.

On Mac OS X 10.9, NVCC needs Clang that comes with Xcode. Only the latest CUDA Toolkit 5.5 works with Mac OS X 10.9.