CUDA wrapper

Seth Shelnutt shelnutt2 at
Sun Jul 6 21:37:53 CDT 2008

Ok, please forgive my naivety but this is my first attempt and all,

I am lost and need come guidance, the guide is of some help and so is
looking at the opengl files. I am not sure exactly what I am trying to
write. What is the difference between a dll form Wine and a I know
the end up in your linux /lib folder right? How does a dll
communicate to this How am I to write this dll file so that when the
fah gpu app calls for a function the cudart.dll file acts as a link to the I don't want to attempt to rewrite the entire dll if I
don't have to. To me it just seems like I am not getting the picture. I know
we can't simply link the two files because they are in two different formats
ELF vs PE. Is there a good example on how this is done? I'm sure this has
been done before. Again looking to the opengl_norm.c file all it appears is
that every functions has been rewritten but with "wine_" in front of the
function name. Is that all I need to do with the cudart? That just seem

I probably should even be messing with this stuff, but the beautify of open
source applications is that with a little help from the community I can add
in support for things I need (CUDA). If this was a closed source app, I
would have to just put in a request for it and maybe in a few months or so
they might think about adding support.

Thanks for your patience and help

On Sun, Jul 6, 2008 at 10:13 PM, Stefan Dösinger <stefan at>

>  Yes, this guide is reasonable, except probably the building part. You
> *may* want to write this DLL as part of Wine, although I am afraid that we
> don't have a policy how to deal with non-Windows DLLs(since cuda is an
> Nvidia thing, not from MS). Of course the 5.5 part doesn't apply then as
> well.
> *From:* wine-devel-bounces at [mailto:
> wine-devel-bounces at] *On Behalf Of *Seth Shelnutt
> *Sent:* Sunday, July 06, 2008 6:29 PM
> *To:* Michael Karcher
> *Cc:* wine-devel at
> *Subject:* Re: CUDA wrapper
> I writing a wrapper, would it be correct to more or less follow this guide,
> on winelib dll's?
> I've never coded anything for Wine before so I want to make sure I do it
> right from the beginning instead of having to go back and make drastic
> changes.
> I'll be looking at that opengl32 perl script because there is 102 pages of
> functions that cudart.dll and both contain.
>  On Sun, Jul 6, 2008 at 6:53 PM, Michael Karcher <
> wine at> wrote:
> This is not going to work. PE style dynamic linking works quite
> different from ELF style dynamic linking. Wine can not link native ELF
> libraries to windows applications. The files from wine are
> special in being ELF files but containing extra information that allows
> the Wine dynamic linker to link it into PE processes.
> This is right. You need at least a correct .spec file to make a wine
> dll. You still have to implement a wrapper for each function, as Windows
> usually uses the stdcall calling convention, whereas linux uses cdecl by
> default. There might be some way to automate writing the wrapper
> functions.
> Regards,
>  Michael Karcher
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the wine-devel mailing list