Re: GPU support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 8, 2009 at 4:21 PM, Richard H. <forums@xxxxxxxxxxxxx> wrote:
> Hello,
>
> Not being a GEGL or OpenGL developer, I would nevertheless being interested
> in how acceleration of filters etc. can basically work with OpenGL (with
> matrix operations on buffers? Can you do other operations, too?) because I
> always thought OpenGL was an API for accelerated (3D but also 2D, considering
> it as a plane in 3D space) rendering, but not for calculating (like it is
> required with many filters). Wouldn't it, from a technical view, be more
> useful to implement CUDA (http://www.nvidia.com/cuda/) support? I heard that
> there is a similar API for ATI. I also know that there is a GIMP plugin using
> CUDA (it has won the first place of a CUDA challenge:
> http://www.nvidia.co.uk/object/io_1222782056939.html).

As far as I am concerned, CUDA and ATI's Stream SDK aren't an option
because they are video card specific.  I haven't really looked into
them but I'm sure they are easy to use for computations, but the same
computations can be accomplished through OpenGL through multiple
rendering/computation passes.  Moreover, we decided to go with OpenGL
instead of a cross-platform API like OpenCL because implementations
for the latter are still either very young or non-existent for most
major platforms[1].

> As far as I have seen taking a quick look at the GEGL source code, the
> hardest task seems to be changing the single-threaded algorithm
>  while (more_work) render();
> to
>  for (i = 0; i < work_packets; i++)
>    create_thread(render_packets);
> where the packets are rectangles.
>
> This would introduce a parallelism which would allow to
> 1) use all CPUs (would be very useful too, especially if you don't have 3D
> graphics acceleration available, but more than 1 CPU)
> 2) use CUDA to process the threads directly using GPU shaders (in parallel).

Sorry, but I'm not really familiar with CUDA's threading model.
Furthermore, GEGL doesn't really take care of thread creation and
management.  As far as I can see, your code's intent is to divide the
tasks into smaller packets of rectangle.  GEGL already has GEGL
processors that can be used to accomplish this[2].  In fact,
internally, GEGL uses tiles to divide the image into smaller packets
for on demand rendering and caching.

[1] Mac OS X is slated to include OpenCL in Snow Leopard.  I suspect
OpenCL in Windows will be there as soon as drivers support the
standard.  For GNU/Linux, on the other hand, support will come in the
form of a Gallium3D state tracker.  See this article on Phoronix for
more info: http://www.phoronix.com/scan.php?page=news_item&px=NzAzMw.

[2] See http://gegl.org/api.html#GeglProcessor for more info.
_______________________________________________
Gegl-developer mailing list
Gegl-developer@xxxxxxxxxxxxxxxxxxxxxx
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gegl-developer


[Index of Archives]     [Yosemite News]     [Yosemite Photos]     [gtk]     [GIMP Users]     [KDE]     [Gimp's Home]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux