Cant install PCL(point cloud) with CUDA? help

ok to start off my system
GTX970m
Ubuntu 16.04
Nvidia toolkit 8.0
And PCL 1.8.0

So my problem is that when i am trying to build PCL with cuda this error is coming

Building NVCC (Device) object gpu/people/CMakeFiles/cuda_compile.dir/src/cuda/nvidia/cuda_compile_generated_NPP_staging.cu.o
/home/tinku/Programing libs/Point cloud /pcl-pcl-1.8.0/gpu/people/src/cuda/nvidia/NPP_staging.cu(2082): error: identifier "__iAtomicCAS" is undefined

1 error detected in the compilation of "/tmp/tmpxft_000047d1_00000000-5_NPP_staging.cpp4.ii".
CMake Error at cuda_compile_generated_NPP_staging.cu.o.cmake:268 (message):
  Error generating file /home/tinku/Programing libs/Point cloud
  /pcl-pcl-1.8.0/build/gpu/people/CMakeFiles/cuda_compile.dir/src/cuda/nvidia/./cuda_compile_generated_NPP_staging.cu.o


gpu/people/CMakeFiles/pcl_gpu_people.dir/build.make:1959: recipe for target 'gpu/people/CMakeFiles/cuda_compile.dir/src/cuda/nvidia/cuda_compile_generated_NPP_staging.cu.o' failed
make[2]: *** [gpu/people/CMakeFiles/cuda_compile.dir/src/cuda/nvidia/cuda_compile_generated_NPP_staging.cu.o] Error 1
CMakeFiles/Makefile2:1973: recipe for target 'gpu/people/CMakeFiles/pcl_gpu_people.dir/all' failed
make[1]: *** [gpu/people/CMakeFiles/pcl_gpu_people.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2

i used to get another error saying that Nvidia dosent suppoert GCC version 5.3 or above but i changed a file and commented out the error and now i am getting this error

what i tried is to change CUDA_ARCH_BIN to only 5.2(gtx 970m) and only 2.0 and all the architectures
and also setting CUDA_NVCC_FLAG to -arch=sm_20 but i get stuck at same error

I’m getting the same error so I can’t help there but I wouldn’t change the CMAKE file like you did. The reason being it’s only a temporary fix and if you try to compile other things you’ll have the same issues. Instead install gcc-4.9 and g+±4.9 then

sudo ln -s /usr/bin/gcc-4.9 /usr/local/cuda-8.0/bin/gcc
sudo ln -s /usr/bin/g++-4.9 /usr/local/cuda-8.0/bin/g++

You may still have to set the CMAKE flag -DCUDA_HOST_COMPILER=/usr/bin/gcc-4.9.

I’ll comment back here if I get PCL sorted out

So I set CUDA_ARCH_BIN to 5.2 and didn’t set any of the CUDA_NVCC_FLAGS or CUDA_ARCH_PTX and it built fine. Perhaps try that.

As you found out, the error message you commented out (I assume it is the one about unsupported host compiler versions) is there for a reason! The tight integration of CUDA with the host compiler usually requires additional tweaking for every new host compiler version to keep CUDA in perfect sync.

This didn’t use to be much of a problem until host compiler vendors started adopting a new development model some years ago where they crank out new, partially incompatible (at the low level at which CUDA interfaces) versions every few months. In retrospect, the tight integration of CUDA with host compilers might have been a mistake, but this particular problem was not foreseen when work on CUDA started eleven years ago. The tight integration does have obvious benefits to CUDA users in terms of the consistency of host and device code, increasing CUDA’s attractiveness from the very start.

I would suggest checking the CUDA documentation for supported host compiler versions and using that.

i have changed the Host_Config file back to original and linked older version of gcc and g++ and now it seems that it is not a problem anymore but

now i did as rghamoltion3 said and set only the CUDA_ARCH_BIN to 5.2 but it dosent compile even after that
@rghamoltion3 can you specify all the other flags you set or changed?

i have tried everything and i stil failed, maybe its a weird combination of nvidia drivers and Linux kernel and cuda 8.0 or idk anyway i went to 15.04 and now i can compile both opencv and PCL with CUDA

And for some wiered reason 14.04 dosent work either, i tried xubuntu , gnome and default versions and all failed with nvidia servers

But according to rghamilton i should be able to install in 16.04.
anyway thanks for the quick reply

tinted:

I’ve got exactly the same issue as you proposed here.

Ubuntu 16.04
GCC: 5.3.0
Cuda: 8.0.27
PCL: 1.8.0
CUDA_ARCH: 5.2 (GTX 980M)

Any progress? Please let me know…

According to
http://stackoverflow.com/questions/9056183/compiling-for-compute-capability-2-x-in-cuda-c-for-vs2010
http://stackoverflow.com/questions/16313434/check-whether-the-code-is-running-on-the-gpu-or-cpu
https://devblogs.nvidia.com/parallelforall/developing-portable-cuda-cc-code-hemi/
The line 2073 in pcl/gpu/people/src/cuda/nvidia/NPP_staging.cu should be #if ((defined CUDA_ARCH) && (CUDA_ARCH < 200))