Hi folks,
currently I need cuda functionality in my application. Because cuda is just
another type of shader (how I like to say, not seriously :) ), I would like to
include it into osgPPU. So that we could use cuda and normal shaders inside of
osgPPU and hence inside of osg.
My question is: Does somebody ever tried to use cuda with osg? I am interested
in the way how to initialize/release the stuff and to build successfull
cuda-osg-compiler pipeline, because cuda kernels has to be compiled externally,
I think.
My thoughts were:
1) Some kind of singleton class describing one cuda device. Whenever there is a
first access to cuda the singleton class and hence the real cuda device are
initialized. Here the question, if cuda device can be initialized after the
OpenGL context is already created or does it have to be before it? If second is
valid, then some intervention into the osg code is required, to be able to init
the device before opengl.
2) On every init or assignment of a texture to a osgPPU's cuda unit, there will
be a mapping of the texture to the cuda environment. This shouldnt' be a big
deal, I hope.
3) The output of a unit is also assigned to the cuda environment. as in step 2.
Hence we could achieve a smooth run of cuda kernels on unit's textures and
hence on osg's rtt cameras. My colleague working at nVidia means that this
shouldn't be a big deal, since mapping and unmapping of textures to cuda arrays
is just like a copy of a texture inside the video memory. This approach is fast
enough to be included into realtime applications and even the games. But, of
corse the hope, that cuda developers enables direct access to OpenGl textures
through cuda, is there ;)
Any comments or suggestions?!
Best regards,
art
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org