Cannot build CUDA 4.0 SDK samples on Ubuntu 10.10

make -C src/smokeParticles/ 

make[2]: Entering directory `/home/nils/NVIDIA_GPU_Computing_SDK/C/src/smokeParticles'

"/usr/local/cuda/include/thrust/detail/device/cuda/detail/launch_closure.inl(84): error: kernel launches from templates are not allowed in system files

"/usr/local/cuda/include/thrust/detail/device/cuda/detail/launch_closure.inl(118): error: kernel launches from templates are not allowed in system files

"/usr/local/cuda/include/thrust/detail/device/cuda/detail/fast_scan.inl(410): error: kernel launches from templates are not allowed in system files

"/usr/local/cuda/include/thrust/detail/device/cuda/detail/fast_scan.inl(420): error: kernel launches from templates are not allowed in system files

"/usr/local/cuda/include/thrust/detail/device/cuda/detail/fast_scan.inl(430): error: kernel launches from templates are not allowed in system files

"/usr/local/cuda/include/thrust/detail/device/cuda/detail/fast_scan.inl(480): error: kernel launches from templates are not allowed in system files

"/usr/local/cuda/include/thrust/detail/device/cuda/detail/fast_scan.inl(490): error: kernel launches from templates are not allowed in system files

"/usr/local/cuda/include/thrust/detail/device/cuda/detail/fast_scan.inl(500): error: kernel launches from templates are not allowed in system files

"/usr/local/cuda/include/thrust/detail/device/cuda/detail/safe_scan.inl(331): error: kernel launches from templates are not allowed in system files

"/usr/local/cuda/include/thrust/detail/device/cuda/detail/safe_scan.inl(346): error: kernel launches from templates are not allowed in system files

"/usr/local/cuda/include/thrust/detail/device/cuda/detail/safe_scan.inl(360): error: kernel launches from templates are not allowed in system files

"/usr/local/cuda/include/thrust/detail/device/cuda/detail/safe_scan.inl(414): error: kernel launches from templates are not allowed in system files

"/usr/local/cuda/include/thrust/detail/device/cuda/detail/safe_scan.inl(430): error: kernel launches from templates are not allowed in system files

"/usr/local/cuda/include/thrust/detail/device/cuda/detail/safe_scan.inl(448): error: kernel launches from templates are not allowed in system files

"/usr/local/cuda/include/thrust/detail/device/cuda/copy_if.inl(241): error: kernel launches from templates are not allowed in system files

"/usr/local/cuda/include/thrust/detail/device/cuda/copy_if.inl(251): error: kernel launches from templates are not allowed in system files

"/usr/local/cuda/include/thrust/detail/device/cuda/detail/stable_merge_sort.inl(928): error: kernel launches from templates are not allowed in system files

"/usr/local/cuda/include/thrust/detail/device/cuda/detail/stable_merge_sort.inl(943): error: kernel launches from templates are not allowed in system files

"/usr/local/cuda/include/thrust/detail/device/cuda/detail/stable_merge_sort.inl(1006): error: kernel launches from templates are not allowed in system files

"/usr/local/cuda/include/thrust/detail/device/cuda/detail/stable_merge_sort.inl(1041): error: kernel launches from templates are not allowed in system files

"/usr/local/cuda/include/thrust/detail/device/cuda/detail/stable_merge_sort.inl(1081): error: kernel launches from templates are not allowed in system files

"/usr/local/cuda/include/thrust/detail/device/cuda/detail/stable_merge_sort.inl(1193): error: kernel launches from templates are not allowed in system files

"/usr/local/cuda/include/thrust/detail/device/cuda/detail/b40c/radixsort_api.h(481): error: kernel launches from templates are not allowed in system files

"/usr/local/cuda/include/thrust/detail/device/cuda/detail/b40c/radixsort_api.h(488): error: kernel launches from templates are not allowed in system files

"/usr/local/cuda/include/thrust/detail/device/cuda/detail/b40c/radixsort_api.h(504): error: kernel launches from templates are not allowed in system files

"/usr/local/cuda/include/thrust/detail/device/cuda/detail/b40c/radixsort_api.h(517): error: kernel launches from templates are not allowed in system files

"/usr/local/cuda/include/thrust/detail/device/cuda/detail/b40c/radixsort_api.h(521): error: kernel launches from templates are not allowed in system files

27 errors detected in the compilation of "/tmp/tmpxft_00004cb9_00000000-15_ParticleSystem.cpp4.ii".

make[2]: *** [obj/x86_64/release/ParticleSystem.cu.o] Error 2

make[2]: Leaving directory `/home/nils/NVIDIA_GPU_Computing_SDK/C/src/smokeParticles'

make[1]: *** [src/smokeParticles/Makefile.ph_build] Error 2

make[1]: Leaving directory `/home/nils/NVIDIA_GPU_Computing_SDK/C'

make: *** [all] Error 2

NVIDIA_GPU_Computing_SDK >

No idea what the error actually means… :argh:

Are you sure you are really compiling with the correct nvcc version?

~ > nvcc --version

nvcc: NVIDIA (R) Cuda compiler driver

Copyright (c) 2005-2011 NVIDIA Corporation

Built on Fri_Feb_18_18:07:32_PST_2011

Cuda compilation tools, release 4.0, V0.2.1221

Well I had CUDA 3.2 installed before, but I think the installer removed that before installing the new version.

How can I invoke make so that it shows me the exact commands executed?

for the sdk you can run make verbose=1. I had no problems building the complete 4.0rc sdk on a 64 bit Ubuntu 9.04 box.

thx just figured that out too ;)

Here is the command which fails:

/usr/local/cuda/bin/nvcc  -gencode=arch=compute_10,code=\"sm_10,compute_10\"  -gencode=arch=compute_20,code=\"sm_20,compute_20\"  -m64 --compiler-options -fno-strict-aliasing  -I. -I/usr/local/cuda/include -I../../common/inc -I../../../shared//inc -DUNIX -O2   -o obj/x86_64/release/ParticleSystem.cu.o -c ParticleSystem.cu

"/usr/local/cuda/include/thrust/detail/device/cuda/detail/launch_closure.inl(84): error: kernel launches from templates are not allowed in system files

That’s strange… they only thing which differs is probably the gcc/g++ version. Can you post yours?

avidday@cuda:~$ gcc --version

gcc (Ubuntu 4.3.3-5ubuntu4) 4.3.3

Copyright (C) 2008 Free Software Foundation, Inc.

This is free software; see the source for copying conditions.  There is NO

warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

have the same problem on ubuntu 10.04:

/usr/local/cuda/bin/nvcc  -gencode=arch=compute_10,code=\"sm_10,compute_10\"  -gencode=arch=compute_20,code=\"sm_20,compute_20\"  -m64 --compiler-options -fno-strict-aliasing  -I. -I/usr/local/cuda/include -I../../common/inc -I../../../shared//inc -DUNIX -O2   -o obj/x86_64/release/particleSystem.cu.o -c particleSystem.cu

"/usr/local/cuda/include/thrust/detail/device/cuda/detail/launch_closure.inl(84): error: kernel launches from templates are not allowed in system files
:~$ nvcc --version

nvcc: NVIDIA (R) Cuda compiler driver

Copyright (c) 2005-2011 NVIDIA Corporation

Built on Fri_Feb_18_18:07:32_PST_2011

Cuda compilation tools, release 4.0, V0.2.1221

seems to be linked to the thrust lib. found this link:

http://code.google.com/p/thrust/issues/detail?id=184

maybe installing cuda on our home directory will solve this issue. i don’t like it though.

Any update on this? This is really annoying…

Since I replied on this thread a month ago, I updated my main development box to Ubuntu 10.04 LTS, so the gcc version is now:

gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3

Copyright (C) 2009 Free Software Foundation, Inc.

This is free software; see the source for copying conditions.  There is NO

warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

and the 4.0rc1 SDK still builds without errors…

Well it just seems to be the smoke particle example which does not work… What about the computeprof? Does it run stable?

CUDA 4.0 RC2

i. e. how to get a nice installation of above mentioned CUDA 4.0 (RC2) to work under a fresh install of a 64 bit Ubuntu 11.04 (codename Natty Narwhal).

After installing a few tidbits I need for everyday life, I decided to give CUDA a try (after it messed up my previous installation)

[list=1]

I didn’t change the graphics driver after installation.

Added the ppa from here here:

sudo add-apt-repository ppa:aaron-haviland/cuda-4.0

sudo apt-get install nvidia-cuda-toolkit

Updated my graphics driver with Ubuntu’s nice “Additional drivers” GUI. I think it’s the same as

sudo apt-get install nvidia-current

(I’m not sure about this. This is where my previous installation got screwed up. I had driver version 173.* and needed 170.*. 170 is what I have now. It compiles and runs.)

Downloaded the SDK from Nvidia, and install:

sh gpucomputingsdk_4.0.13_linux.run

Tried to compile with - failed.

Installed some of the missing lib’s and g+±4.4

sudo apt-get install libxi-dev libxmu-dev libglut3-dev g++-4.4

Modified the $SDK/C/common/common.mk. Changed

g++

to

g++-4.4

(twice); changed

gcc

to

gcc-4.4

(once); and added

--compiler-bindir=/usr/bin/g++-4.4

to the NVCCFLAGS variable so the entire line is:

NVCCFLAGS       := --compiler-bindir=/usr/bin/g++-4.4

Tried to compile and got the mentioned error about system files not being allowed to launch kernels

sudo mkdir /usr/local/cuda

sudo mkdir /usr/local/cuda/include

sudo mv /usr/include/thrust /usr/local/cuda/include

Modified $SDK/C/common/common.mk again. Changed the line

INCLUDES  += -I. -I$(CUDA_INSTALL_PATH)/include -I$(COMMONDIR)/inc -I$(SHAREDDIR

)/inc

to

INCLUDES  += -I. -I$(CUDA_INSTALL_PATH)/include -I$(COMMONDIR)/inc -I$(SHAREDDIR

)/inc -I/usr/local/cuda/include

(just “-I/usr/local/cuda/include” added)

Compiled, and ran.

It’s late, so I hope I didn’t leave out anything.

Cheers!

Emil Vatai, I’m grateful for your step-by-step, but it doesn’t seem to be working for me–I still get the kernel launches from system files error. The only thing I can think that could be different is the nvidia-current driver, but that shouldn’t affect it, should it?

maybe you can try like this :

Solution:the include path for the corresponding headers must be specified by a -I

flag to the compiler

https://amcg.ese.ic.ac.uk/~fr710/wiki/dev/cuda/start

nvcc errors

kernel launches from templates are not allowed in system files

occurs whenever a kernel is launched from a template class or function that is

declared in a header residing in a standard include path of the compiler

Note: this applies also to include path expansion e.g. through the

CPLUS_INCLUDE_PATH environment variable

I had to add a soft link in order to let ld find the cuda library:

ln -s /usr/lib/nvidia-current/libcuda.so.280.13 /usr/lib/libcuda.so

but now it works. Finally!

Reference: http://timelordz.com/wiki/Nvidia_CUDA

(Ubuntu 11.10, 32bit)

Try removing the variable CPLUS_INCLUDE_PATH from your environment. This may be why nvcc is confusing the contents of /usr/local/cuda/include for system files. A quick check would be to do

$ export CPLUS_INCLUDE_PATH=

after this, the error: “error: kernel launches from templates are not allowed in system files” will no longer appear.