CUDA 5.0 is not compatible with gcc 4.8.0.
For better understanding of compatible distros and gcc versions, refer to the release notes.
You may have better luck with cuda 5.5 RC, but that particular distro as well as the gcc version you mention are still not listed in the release notes under linux support.
The best experience will most likely be found by switching to a supported distro.
Normally, nvcc
in CUDA 5 will automatically include the file /usr/local/cuda/include/host_config.h
which has various macros to check for correct/acceptable compiler versions, and one of those macros should have thrown an error in your case, but it seems it did not:
#if defined(__GNUC__)
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 6)
#error -- unsupported GNU version! gcc 4.7 and up are not supported!
#endif /* __GNUC__> 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 6) */
#endif /* __GNUC__ */