rehmanrulz (Arun Yoganandan) Newbie
Joined: 05 Oct 2009 Posts: 10
|
Posted: Tue Oct 13, 2009 7:13 pm Post subject: Problems compiling osgCuda |
|
|
Hi There,
I have been trying to compile osgCompute and osgCuda and have been facing linking problems. I have provided links to all directories as far as I know. Please find the log below. Any help would be greatly appreciated.
1> Creating library C:\Users\Tatric\Desktop\osgCompute-0.4\build\lib\Debug\osgCudad.lib and object C:\Users\Tatric\Desktop\osgCompute-0.4\build\lib\Debug\osgCudad.exp
1>Context.obj : error LNK2019: unresolved external symbol _cudaGetDeviceProperties@8 referenced in function "public: virtual bool __thiscall osgCuda::Context::init(void)" (?init@Context@osgCuda@@UAE_NXZ)
1>Context.obj : error LNK2019: unresolved external symbol _cudaGetDeviceCount@4 referenced in function "public: virtual bool __thiscall osgCuda::Context::init(void)" (?init@Context@osgCuda@@UAE_NXZ)
1>Context.obj : error LNK2019: unresolved external symbol _cudaGLSetGLDevice@4 referenced in function "bool __cdecl osgCuda::setupSharedDevice(int)" (?setupSharedDevice@osgCuda@@YA_NH@Z)
1>Texture1D.obj : error LNK2001: unresolved external symbol _cudaGetErrorString@4
1>Texture2D.obj : error LNK2001: unresolved external symbol _cudaGetErrorString@4
1>Texture3D.obj : error LNK2001: unresolved external symbol _cudaGetErrorString@4
1>Texture.obj : error LNK2001: unresolved external symbol _cudaGetErrorString@4
1>Context.obj : error LNK2019: unresolved external symbol _cudaGetErrorString@4 referenced in function "public: void * __thiscall osgCuda::Context::mallocDeviceMemory(unsigned int)const " (?mallocDeviceMemory@Context@osgCuda@@QBEPAXI@Z)
1>Array.obj : error LNK2001: unresolved external symbol _cudaGetErrorString@4
1>Buffer.obj : error LNK2001: unresolved external symbol _cudaGetErrorString@4
1>Geometry.obj : error LNK2001: unresolved external symbol _cudaGetErrorString@4
1>Context.obj : error LNK2019: unresolved external symbol _cudaMalloc@8 referenced in function "public: void * __thiscall osgCuda::Context::mallocDeviceMemory(unsigned int)const " (?mallocDeviceMemory@Context@osgCuda@@QBEPAXI@Z)
1>Context.obj : error LNK2019: unresolved external symbol _cudaMallocHost@8 referenced in function "public: void * __thiscall osgCuda::Context::mallocDeviceHostMemory(unsigned int)const " (?mallocDeviceHostMemory@Context@osgCuda@@QBEPAXI@Z)
1>Context.obj : error LNK2019: unresolved external symbol _cudaMallocPitch@16 referenced in function "public: void * __thiscall osgCuda::Context::mallocDevice2DMemory(unsigned int,unsigned int)const " (?mallocDevice2DMemory@Context@osgCuda@@QBEPAXII@Z)
1>Context.obj : error LNK2019: unresolved external symbol _cudaMalloc3D@16 referenced in function "public: void * __thiscall osgCuda::Context::mallocDevice3DMemory(unsigned int,unsigned int,unsigned int)const " (?mallocDevice3DMemory@Context@osgCuda@@QBEPAXIII@Z)
1>Context.obj : error LNK2019: unresolved external symbol _cudaMallocArray@16 referenced in function "public: struct cudaArray * __thiscall osgCuda::Context::mallocDeviceArray(unsigned int,struct cudaChannelFormatDesc const &)const " (?mallocDeviceArray@Context@osgCuda@@QBEPAUcudaArray@@IABUcudaChannelFormatDesc@@@Z)
1>Context.obj : error LNK2019: unresolved external symbol _cudaMalloc3DArray@20 referenced in function "public: struct cudaArray * __thiscall osgCuda::Context::mallocDevice3DArray(unsigned int,unsigned int,unsigned int,struct cudaChannelFormatDesc const &)const " (?mallocDevice3DArray@Context@osgCuda@@QBEPAUcudaArray@@IIIABUcudaChannelFormatDesc@@@Z)
1>TextureRectangle.obj : error LNK2001: unresolved external symbol _cudaGLRegisterBufferObject@4
1>Context.obj : error LNK2019: unresolved external symbol _cudaGLRegisterBufferObject@4 referenced in function "public: unsigned int __thiscall osgCuda::Context::mallocBufferObject(unsigned int)const " (?mallocBufferObject@Context@osgCuda@@QBEII@Z)
1>Texture1D.obj : error LNK2001: unresolved external symbol _cudaGLRegisterBufferObject@4
1>Texture2D.obj : error LNK2001: unresolved external symbol _cudaGLRegisterBufferObject@4
1>Texture3D.obj : error LNK2001: unresolved external symbol _cudaGLRegisterBufferObject@4
1>Context.obj : error LNK2019: unresolved external symbol _cudaFreeHost@4 referenced in function "public: void __thiscall osgCuda::Context::freeMemory(void *)const " (?freeMemory@Context@osgCuda@@QBEXPAX@Z)
1>Context.obj : error LNK2019: unresolved external symbol _cudaFree@4 referenced in function "public: void __thiscall osgCuda::Context::freeMemory(void *)const " (?freeMemory@Context@osgCuda@@QBEXPAX@Z)
1>Context.obj : error LNK2019: unresolved external symbol _cudaFreeArray@4 referenced in function "public: void __thiscall osgCuda::Context::freeMemory(struct cudaArray *)const " (?freeMemory@Context@osgCuda@@QBEXPAUcudaArray@@@Z)
1>TextureRectangle.obj : error LNK2001: unresolved external symbol _cudaGLUnregisterBufferObject@4
1>Context.obj : error LNK2019: unresolved external symbol _cudaGLUnregisterBufferObject@4 referenced in function "public: void __thiscall osgCuda::Context::freeBufferObject(unsigned int)const " (?freeBufferObject@Context@osgCuda@@QBEXI@Z)
1>Texture1D.obj : error LNK2001: unresolved external symbol _cudaGLUnregisterBufferObject@4
1>Texture2D.obj : error LNK2001: unresolved external symbol _cudaGLUnregisterBufferObject@4
1>Texture3D.obj : error LNK2001: unresolved external symbol _cudaGLUnregisterBufferObject@4
1>Array.obj : error LNK2019: unresolved external symbol _cudaMemcpy@16 referenced in function "protected: bool __thiscall osgCuda::Array::setupStream(unsigned int,class osgCuda::ArrayStream &)const " (?setupStream@Array@osgCuda@@IBE_NIAAVArrayStream@2@@Z)
1>Buffer.obj : error LNK2001: unresolved external symbol _cudaMemcpy@16
1>Geometry.obj : error LNK2001: unresolved external symbol _cudaMemcpy@16
1>Texture.obj : error LNK2001: unresolved external symbol _cudaMemcpy@16
1>Array.obj : error LNK2019: unresolved external symbol _cudaMemcpy3D@4 referenced in function "protected: bool __thiscall osgCuda::Array::setupStream(unsigned int,class osgCuda::ArrayStream &)const " (?setupStream@Array@osgCuda@@IBE_NIAAVArrayStream@2@@Z)
1>Array.obj : error LNK2019: unresolved external symbol _cudaMemcpyToArray@24 referenced in function "protected: bool __thiscall osgCuda::Array::setupStream(unsigned int,class osgCuda::ArrayStream &)const " (?setupStream@Array@osgCuda@@IBE_NIAAVArrayStream@2@@Z)
1>Array.obj : error LNK2019: unresolved external symbol _cudaMemcpy2DFromArray@32 referenced in function "protected: bool __thiscall osgCuda::Array::syncStream(unsigned int,class osgCuda::ArrayStream &)const " (?syncStream@Array@osgCuda@@IBE_NIAAVArrayStream@2@@Z)
1>Array.obj : error LNK2019: unresolved external symbol _cudaMemcpyFromArray@24 referenced in function "protected: bool __thiscall osgCuda::Array::syncStream(unsigned int,class osgCuda::ArrayStream &)const " (?syncStream@Array@osgCuda@@IBE_NIAAVArrayStream@2@@Z)
1>Array.obj : error LNK2019: unresolved external symbol _cudaMemcpy2DToArray@32 referenced in function "protected: bool __thiscall osgCuda::Array::syncStream(unsigned int,class osgCuda::ArrayStream &)const " (?syncStream@Array@osgCuda@@IBE_NIAAVArrayStream@2@@Z)
1>Buffer.obj : error LNK2019: unresolved external symbol _cudaMemset@12 referenced in function "public: virtual bool __thiscall osgCuda::Buffer::setMemory(class osgCompute::Context const &,int,unsigned int,unsigned int,unsigned int)const " (?setMemory@Buffer@osgCuda@@UBE_NABVContext@osgCompute@@HIII@Z)
1>Geometry.obj : error LNK2001: unresolved external symbol _cudaMemset@12
1>Texture.obj : error LNK2001: unresolved external symbol _cudaMemset@12
1>Geometry.obj : error LNK2019: unresolved external symbol _cudaGLMapBufferObject@8 referenced in function "protected: virtual void * __thiscall osgCuda::Geometry::mapStream(class osgCuda::GeometryStream &,unsigned int)const " (?mapStream@Geometry@osgCuda@@MBEPAXAAVGeometryStream@2@I@Z)
1>Texture.obj : error LNK2001: unresolved external symbol _cudaGLMapBufferObject@8
1>Geometry.obj : error LNK2019: unresolved external symbol _cudaGLUnmapBufferObject@4 referenced in function "protected: virtual void __thiscall osgCuda::Geometry::unmapStream(class osgCuda::GeometryStream &)const " (?unmapStream@Geometry@osgCuda@@MBEXAAVGeometryStream@2@@Z)
1>Texture.obj : error LNK2001: unresolved external symbol _cudaGLUnmapBufferObject@4
1>C:\Users\Tatric\Desktop\osgCompute-0.4\build\bin\Debug\..\osgCudad.dll : fatal error LNK1120: 24 unresolved externals
Thanks,
Arun Yoganandan |
|
Mick User
Joined: 11 Mar 2009 Posts: 31
|
Posted: Wed Oct 14, 2009 8:29 am Post subject: Re: Problems compiling osgCuda |
|
|
Hi Arun,
rehmanrulz wrote:
|
I have been trying to compile osgCompute and osgCuda and have been facing linking problems. I have provided links to all directories as far as I know. Please find the log below. Any help would be greatly appreciated.
|
your project (osgCuda) does not link to cudart.lib. This causes your problems. Actually the cmake script FindCuda.cmake (located in CMakeModules/cuda) should ensure that your nvcc is found. Once it is found the script sets libs and includes automatically. (I'm wondering that cmake has generated you a project while not finding the proper lib). You can also set the environment variables CUDA_BIN_PATH, CUDA_INC_PATH and CUDA_LIB_PATH to the correct folders of your system (this is actually done automatically during the cuda installation).
Please check the setting of your CUDA_RUNTIME_LIBRARY variable (in advanced view of cmake). This should fix your problem.
Best regards,
Mick _________________ SVT Group |
|
rehmanrulz (Arun Yoganandan) Newbie
Joined: 05 Oct 2009 Posts: 10
|
Posted: Wed Oct 14, 2009 6:09 pm Post subject: |
|
|
|
|
Mick User
Joined: 11 Mar 2009 Posts: 31
|
Posted: Thu Oct 15, 2009 8:34 am Post subject: |
|
|
Hi Arun!
rehmanrulz wrote:
|
I'm working on a 64bit Vista machine. Any possibilities that this is causing issues?
|
I have to admit that we didn't test our scripts on Vista 64 Bit.
Unfortunately we don't have a Vista 64 Bit machine ready for testing that's why it is a bit tricky for us to analyze the error at the moment.
Could you please help us to fix this problem? Did you try to compile OSG and osgCompute/osgCuda in 32 Bit mode? Does this work for you?
The cmake warnings sound very strange...
Thanks and best regards,
Mick _________________ SVT Group |
|
rehmanrulz (Arun Yoganandan) Newbie
Joined: 05 Oct 2009 Posts: 10
|
Posted: Fri Oct 16, 2009 5:57 pm Post subject: |
|
|
Hi Mick,
I can gladly help testing on a 64bit machine from my end.
OsgCuda seems to compile when I linked to the 32bit cudart.lib library. But I get a lot of errors when compiling the examples provided.
List of errors for osgTexDemo.
1>------ Build started: Project: Examples osgTexDemo, Configuration: Debug Win32 ------
1>Compiling...
1>TexStreamer.gen.cpp
1>C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include\crtdefs.h(480) : error C2371: 'size_t' : redefinition; different basic types
1> predefined C++ types (compiler internal)(19) : see declaration of 'size_t'
1>C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include\stdlib.h(395) : error C4235: nonstandard extension used : '__unaligned' keyword not supported on this architecture
1>c:\cuda\include\texture_fetch_functions.h(1913) : error C2719: 'index': formal parameter with __declspec(align('16')) won't be aligned
1>c:\cuda\include\texture_fetch_functions.h(1922) : error C2719: 'index': formal parameter with __declspec(align('16')) won't be aligned
1>c:\cuda\include\texture_fetch_functions.h(1931) : error C2719: 'index': formal parameter with __declspec(align('16')) won't be aligned
1>c:\cuda\include\texture_fetch_functions.h(1940) : error C2719: 'index': formal parameter with __declspec(align('16')) won't be aligned
1>c:\cuda\include\texture_fetch_functions.h(1949) : error C2719: 'index': formal parameter with __declspec(align('16')) won't be aligned
1>c:\cuda\include\texture_fetch_functions.h(1958) : error C2719: 'index': formal parameter with __declspec(align('16')) won't be aligned
1>c:\cuda\include\math_functions.h(1613) : error C2719: 'x': formal parameter with __declspec(align('8')) won't be aligned
1>c:\cuda\include\math_functions.h(1613) : error C2719: 'y': formal parameter with __declspec(align('8')) won't be aligned
1>Build log was saved at "file://c:\Users\Tatric\Desktop\osgCompute-0.4\build\examples\osgTexDemo\src\example_osgTexDemo.dir\Debug\BuildLog.htm"
1>Examples osgTexDemo - 10 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 3 up-to-date, 0 skipped ==========
Thank you!
Cheers,
Arun |
|
Mick User
Joined: 11 Mar 2009 Posts: 31
|
Posted: Mon Oct 19, 2009 12:18 pm Post subject: |
|
|
Hi Arun.
rehmanrulz wrote:
|
...I can gladly help testing on a 64bit machine from my end.
OsgCuda seems to compile when I linked to the 32bit cudart.lib library. But I get a lot of errors when compiling the examples provided.
List of errors for osgTexDemo.
...
|
We are testing osgCompute/osgCuda on a 64Bit Windows 7 machine at the moment. We will update the scripts as soon as we have found a solution.
Thanks and best regards,
Mick _________________ SVT Group |
|