OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Problems compiling osgCuda


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> osgCompute [osgCompute]
View previous topic :: View next topic  
Author Message
rehmanrulz (Arun Yoganandan)
Newbie


Joined: 05 Oct 2009
Posts: 10

PostPosted: Tue Oct 13, 2009 7:13 pm    Post subject:
Problems compiling osgCuda
Reply with quote

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
Back to top
View user's profile Send private message
Mick
User


Joined: 11 Mar 2009
Posts: 31

PostPosted: Wed Oct 14, 2009 8:29 am    Post subject:
Re: Problems compiling osgCuda
Reply with quote

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
Back to top
View user's profile Send private message
rehmanrulz (Arun Yoganandan)
Newbie


Joined: 05 Oct 2009
Posts: 10

PostPosted: Wed Oct 14, 2009 6:09 pm    Post subject:
Reply with quote

Hi Mick,

Thank you very much for your reply. I did check the settings for CUDA and they seem to be set correct.
http://rehmanrulz.googlepages.com/environmentvariables.jpg

Here are some screenshots of the cmake
http://rehmanrulz.googlepages.com/screenshot1.jpg
CUDA_RUNTIME_LIBRARY seems to be the set path.

http://rehmanrulz.googlepages.com/screenshot2.jpg
I get a couple of warnings as well during cmake.

I'm working on a 64bit Vista machine. Any possibilities that this is causing issues?

Please do let me know and thanks again!

Arun Yoganandan
Back to top
View user's profile Send private message
Mick
User


Joined: 11 Mar 2009
Posts: 31

PostPosted: Thu Oct 15, 2009 8:34 am    Post subject:
Reply with quote

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
Back to top
View user's profile Send private message
rehmanrulz (Arun Yoganandan)
Newbie


Joined: 05 Oct 2009
Posts: 10

PostPosted: Fri Oct 16, 2009 5:57 pm    Post subject:
Reply with quote

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
Back to top
View user's profile Send private message
Mick
User


Joined: 11 Mar 2009
Posts: 31

PostPosted: Mon Oct 19, 2009 12:18 pm    Post subject:
Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> osgCompute [osgCompute] All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts Forum problems SMesserschmidt General 2 Wed Apr 12, 2017 7:24 am View latest post
No new posts problems getting shadow demo to work Lee Butler General 1 Mon Feb 20, 2017 4:02 am View latest post
No new posts Having problems running the osgViewer... retrotrap General 2 Thu Nov 24, 2016 12:43 pm View latest post
No new posts [osgEarth] several problems and quest... hulrien General [forum] 3 Thu Nov 24, 2016 10:42 am View latest post
No new posts Timeout problems with OSX TravisCL build robertosfield General 0 Tue Nov 15, 2016 5:45 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP