Luigi Auriemma

aluigi.org (ARCHIVE-ONLY FORUM!)
It is currently 19 Jul 2012 14:54

All times are UTC [ DST ]





Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: CUDA with Mingw
PostPosted: 16 Jan 2010 00:54 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
oh yeah, it's possible to compile CUDA code with Mingw although Nvidia says that it's not supported.
indeed it's only a matter of linking libraries so why should exist limitations?

I premise that probably is possible to do this stuff easier so maybe I could update the post in future.

the first problem is that gcc/g++ doesn't like the CU extension of the files so it's enough to rename them as C or CPP and so on.

now open the file c:\cuda\include\host_defines.h and add a __stdcall at the line 59 like the following:
Code:
#define CUDARTAPI __stdcall
and now compile your code normally, example:
Code:
g++ -o file.exe file.c -IC:\CUDA\include -I"C:\Documents and Settings\All Users\Application Data\NVIDIA Corporation\NVIDIA GPU Computing SDK\C\common\inc" -L"C:\Documents and Settings\All Users\Application Data\NVIDIA Corporation\NVIDIA GPU Computing SDK\C\common\lib" -LC:\CUDA\lib -lcuda -lcutil32 -lcudart
the paths are those of default so they are valid anywhere.

I have tested bandwidthTest and works so in the next days I can start to burn my 8600gt :)


Top
 Profile  
 
 
 Post subject: Re: CUDA with Mingw
PostPosted: 16 Jan 2010 23:49 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
little (negative) update.
more info will be probably added in the next days.
for the moment there are only problems in compiling the files that really use CUDA (I talk about the threads launched on the graphic cards):
- the <<< and >>> instructions for launching the threads are not recognized by gcc/mingw
- the global variables blockDim, blockIdx and threadIdx are not visible


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC [ DST ]


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 post attachments in this forum

Search for: