CUDA 4.0 does not work with gcc 4.5

Tomasz Rybak bogomips at post.pl
Fri May 27 08:30:16 UTC 2011


Hello.
Yesterday NVIDIA released CUDA toolkit 4.0.
Unfortunately 4.0 does not work with default Debian
installation. It requires gcc not to be 4.5 or newer.
For example during compilation of CUDA examples I got:

In file included
from /usr/lib/nvidia-cuda-toolkit/include/cuda_runtime.h:59:0,
                 from <command-line>:0:
/usr/include/host_config.h:82:2: error: #error -- unsupported GNU
version! gcc 4.5 and up are not supported!
make[1]: *** [obj/x86_64/release/simpleTexture.cu.o] Error 1
make: *** [src/simpleTexture/Makefile.ph_build] Error 2


When I have removed line 82 from host_config.h, I got following
error:
In file included from /usr/include/c
++/4.6/x86_64-linux-gnu/bits/gthr.h:162:0,
                 from /usr/include/c++/4.6/ext/atomicity.h:34,
                 from /usr/include/c++/4.6/bits/basic_string.h:41,
                 from /usr/include/c++/4.6/string:54,
                 from src/piestimator.cu:14:
/usr/include/c++/4.6/x86_64-linux-gnu/bits/gthr-default.h:251:1: error:
pasting "__gthrw_" and "/* Android's C library does not provide
pthread_cancel, check for
   `pthread_create' instead.  */" does not give a valid preprocessing
token
make[1]: *** [obj/x86_64/release/piestimator.cu.o] Error 1
make: *** [src/MonteCarloCURAND/EstimatePiInlineP/Makefile.ph_build]
Error 2

It looks like nvcc does not like comments inside macros (?).

I have tried to solve the problem by changing /etc/nvcc.conf.
I have created soft links to gcc-4.4 and g++-4.4
in /usr/lib/nvidia-cuda-toolkit/bin.
When I set "compiler-bindir" to this directory, nvcc complained
about missing cc1plus which would mean that it still used gcc-4.6
(cc1plus does not exists in gcc-4.4, only in gcc-4.5 and gcc-4.6).
I have also tried to set PATH in /etc/nvcc.conf - without
much success.

On the other hand I was able to force nvcc 4.0 to work on my laptop
(using non-packaged CUDA toolkit) by setting PATH and LD_LIBRARY_PATH
in the shell - so it should work.

BTW - the same problem exists in Fedora 15:
http://lists.tiker.net/pipermail/pycuda/2011-May/003149.html

Best regards, and thanks for working on NVIDIA packages

-- 
Tomasz Rybak <bogomips at post.pl> GPG/PGP key ID: 2AD5 9860
Fingerprint A481 824E 7DD3 9C0E C40A  488E C654 FB33 2AD5 9860
http://member.acm.org/~tomaszrybak
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.alioth.debian.org/pipermail/pkg-nvidia-devel/attachments/20110527/b41ead02/attachment.pgp>


More information about the pkg-nvidia-devel mailing list