CUDA link problem under VS2012 x64

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

CUDA link problem under VS2012 x64

kwaegel
Administrator
I'm having some link issues with the PCL GPU projects, using Visual Studio 2012 x64, CUDA toolkit 5.5 RC, CMake 2.8.11.1, and trunk revision 40bf9957dc from the git repo. Some of the projects (pcl_cuda_*, pcl_gpu_containers) will link correctly, but most will not.

The simplest error case I can find was pcl_gpu_utils, which gives a single representative link error:
Error error LNK2019: unresolved external symbol "void __cdecl pcl::gpu::copyFieldsImpl(int,int,int * const,int,void const *,void *)" (?copyFieldsImpl@gpu@pcl@@YAXHHQEAHHPEBXPEAX@Z) referenced in function "void __cdecl pcl::gpu::copyFieldsEx(class pcl::gpu::DeviceArray const &,class pcl::gpu::DeviceArray &,int,int,int,int)" (??$copyFieldsEx@UNormal@pcl@@UPointNormal@2@@gpu@pcl@@YAXAEBV?$DeviceArray@UNormal@pcl@@@01@AEAV?$DeviceArray@UPointNormal@pcl@@@01@HHHH@Z) C:\[working dir]\pcl\trunk_build\gpu\utils\repacks.obj

If I turn on CUDA_SEPARABLE_COMPILATION, I get a slightly different error:
Building NVCC intermediate link file gpu/utils/CMakeFiles/pcl_gpu_utils.dir/Debug/pcl_gpu_utils_intermediate_link.obj (TaskId:33)
1>nvcc : fatal error : nvcc supports '--relocatable-device-code=true (-rdc=true)', '--device-c (-dc)', and '--device-link (-dlink)' only when targeting sm_20 or higher

The rest of PCL appears to build correctly and passes all the tests, with some minor changes for C++11 compatibility.

Any suggestions on what might be going wrong?

_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: CUDA link problem under VS2012 x64

mrtm3050
I 2nd this error. Did you figure this one out?
Reply | Threaded
Open this post in threaded view
|

Re: CUDA link problem under VS2012 x64

mrtm3050
It looks like it's an entirely a VS2010 and VS2012 issue with Cuda 5.5 Works fine in 2010.
RB
Reply | Threaded
Open this post in threaded view
|

Re: CUDA link problem under VS2012 x64

RB
Set CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE CMake variable to OFF

same as here

http://answers.opencv.org/question/18110/building-opencv-246-with-cuda-55rc-in-vs2012/

Reply | Threaded
Open this post in threaded view
|

Re: CUDA link problem under VS2012 x64

mrtm3050
Thanks for the reply:

I get the following errors now when compiling gpu_octree but the earlier error has disappeared:

Error 2 error : identifier "device_ptr" is undefined E:\PCL\trunk\gpu\octree\src\cuda\octree_builder.cu 338
Error 3 error : type name is not allowed E:\PCL\trunk\gpu\octree\src\cuda\octree_builder.cu 338
Error 4 error : identifier "beg" is undefined E:\PCL\trunk\gpu\octree\src\cuda\octree_builder.cu 338
Error 5 error : type name is not allowed E:\PCL\trunk\gpu\octree\src\cuda\octree_builder.cu 339
Error 6 error : identifier "end" is undefined E:\PCL\trunk\gpu\octree\src\cuda\octree_builder.cu 339
Error 7 error : type name is not allowed E:\PCL\trunk\gpu\octree\src\cuda\octree_builder.cu 355
Error 8 error : identifier "codes_beg" is undefined E:\PCL\trunk\gpu\octree\src\cuda\octree_builder.cu 355
Error 9 error : type name is not allowed E:\PCL\trunk\gpu\octree\src\cuda\octree_builder.cu 356
Error 10 error : identifier "codes_end" is undefined E:\PCL\trunk\gpu\octree\src\cuda\octree_builder.cu 356
Error 11 error : type name is not allowed E:\PCL\trunk\gpu\octree\src\cuda\octree_builder.cu 362
Error 12 error : identifier "indices_beg" is undefined E:\PCL\trunk\gpu\octree\src\cuda\octree_builder.cu 362
Error 13 error : type name is not allowed E:\PCL\trunk\gpu\octree\src\cuda\octree_builder.cu 363
Error 14 error : identifier "indices_end" is undefined E:\PCL\trunk\gpu\octree\src\cuda\octree_builder.cu 363
Error 15 error : type name is not allowed E:\PCL\trunk\gpu\octree\src\cuda\octree_builder.cu 378
Error 16 error : identifier "xs" is undefined E:\PCL\trunk\gpu\octree\src\cuda\octree_builder.cu 378
Error 17 error : type name is not allowed E:\PCL\trunk\gpu\octree\src\cuda\octree_builder.cu 379
Error 18 error : identifier "ys" is undefined E:\PCL\trunk\gpu\octree\src\cuda\octree_builder.cu 379
Error 19 error : type name is not allowed E:\PCL\trunk\gpu\octree\src\cuda\octree_builder.cu 380
Error 20 error : identifier "zs" is undefined E:\PCL\trunk\gpu\octree\src\cuda\octree_builder.cu 380

Any ideas? Am I not compiling something else I need to?
Reply | Threaded
Open this post in threaded view
|

Re: CUDA link problem under VS2012 x64

mrtm3050
Okay, got this working. I don't think I had the up to date trunk, had to include thrust/device-ptr.h.

Now I'm getting a:

Xiron Platform Abstraction Layer - Win32 visual studio 2012

error. I believe it's because I need to compile Openi 1.5.4 in VS2012. Where do I actually find the src for this that would work? It looks like the Github version on Openi is 1.5.2 and then jumps to OpenNI 2.0.

Is there another place I can get the src?

Thanks for the help!
Reply | Threaded
Open this post in threaded view
|

Re: CUDA link problem under VS2012 x64

kwaegel
Administrator
Okay, I got to the same point now. Progress, I suppose.

It sounds like this may be a limitation of the OpenNI 1.x branch, and a switch to OpenNI 2.x might be required. There has already been at least some discussion about doing just that (http://www.pcl-users.org/Using-pcl-with-openni-2-td4028428.html).

The GitHub repo (https://github.com/OpenNI/OpenNI/releases) is the only 1.x branch I could find. I'll try compiling it later without the MSC_VER check, but I don't have much confidence that it will work.
RB
Reply | Threaded
Open this post in threaded view
|

Re: CUDA link problem under VS2012 x64

RB
In reply to this post by mrtm3050
Why do you have to compile OpenNI? I'm using the installs from below and the compile is fine.

http://www.openni.org/openni-sdk/openni-sdk-history-2/

OpenNI-Win64-1.5.4.0-Dev
Sensor-Win64-5.1.2.1-Redist
Reply | Threaded
Open this post in threaded view
|

Re: CUDA link problem under VS2012 x64

kwaegel
Administrator
RB wrote
Why do you have to compile OpenNI? I'm using the installs from below and the compile is fine.
I want/need to use Visual Studio 2012, which is incompatible with OpenNI 1.5.

Does anyone know if there is an actual need for CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE to be true on other systems? I'm wondering if it might be safer to preemptively disable it in the PCL CMake scripts.