CUDA in 64-bit Linux


I have just installed 64-bit Ubuntu Hardy Heron, and I can’t compile my programs.

magne@clinton:~/src/aes$ m
nvcc -c -o rijndael.o -I/usr/local/cuda/include -I/home/magne/nvidia-sdk/common/inc -UCUDA_NO_SM_11_ATOMIC_INTRINSICS -g
“/usr/include/c++/4.2/x86_64-linux-gnu/bits/c++config.h”, line 149: error:
expected a “{”
namespace std attribute ((visibility (“default”))) {

“/usr/include/c++/4.2/bits/cpp_type_traits.h”, line 74: error: expected a “{”
namespace __gnu_cxx attribute ((visibility (“default”))) {

“/usr/include/c++/4.2/bits/cpp_type_traits.h”, line 81: error: expected a “{”
namespace std attribute ((visibility (“default”))) {


86 errors detected in the compilation of “/tmp/tmpxft_0000151e_00000000-2.ii”.
make: *** [rijndael.o] Error 255

Anyone seen anything like this? Any more information I can supply?

CUDA 1.1 is not supported in Ubuntu 8.04, due to it using gcc 4.2. You either have to downgrade to Ubuntu 7.04, find an older version of gcc (might be in the repository), or use the header hack described in this thread:…ndpost&p=358898

… Or wait for CUDA 2.0.

Partially solved, worked with GCC 4.1. But is there a good way to specify what version of gcc to use, i updated the symlink gcc to point to 4.1, but is there a option to nvcc or an enviromental variable I can use?

I do the symlink thing, and I’ve also copied the common makefile from common/ and hacked it.

The makefile hack is probably the cleanest.

Ubuntu 7.10 will be officially supported in the next CUDA release. However, Ubuntu-8.xx will not be supported in the next CUDA release, as Ubuntu-8.xx won’t be released until too late in the current CUDA development cycle.

Unfortunately, just hacking doesn’t cut it, as calls to gcc are hardwired into nvcc. But the symbolic link did the trick.