POV-Ray : Newsgroups : povray.unofficial.patches : Thoughts about using CUDA for rendering? : Re: Thoughts about using CUDA for rendering? Server Time
21 Sep 2021 07:25:53 EDT (-0400)
  Re: Thoughts about using CUDA for rendering?  
From: clipka
Date: 19 Jul 2009 19:20:01
Message: <web.4a63a94d770437d069d21dbe0@news.povray.org>
"Random_Kevin" <nomail@nomail> wrote:
> I was wondering, while waiting for a render of course, how hard it would be to
> get povray to use the 128 processors in my Nvidia card? My quad-core AMD
> processor does a good job but there's always something bigger and more complex
> to render.

The answer to this type of question - which can be generalized as "can (or: why
can't, or: how hard would it be to make) POV-Ray use my graphics card?" -
hasn't changed since it was last asked a few months ago (no need to feel bad
about asking it though: it was about time again ;)):

GPUs are still (and can be expected to continue to be) unsuited to the general
task of ray tracing, and modifying POV-Ray to be able to dispatch part of its
computations to them would be cumbersome and probably ineffective.

The following quote from Wikipedia about the limitations of CUDA in particular
(but which also applies to GPUs in general) gives an insight why this is so:

"Threads should be running in groups of at least 32 for best performance, with
total number of threads numbering in the thousands. Branches in the program
code do not impact performance significantly, provided that each of 32 threads
takes the same execution path; the SIMD execution model becomes a significant
limitation for any inherently divergent task (e.g., traversing a ray tracing
acceleration data structure)."

GPUs are specialized on crunching a lot of numbers, all in exactly the very same
way. Raytracing does not provide many tasks that fit this bill; for each ray
there's a lot of decisions to make: Does this ray intersect object X? Is the
intersection point inside or outside of all the other objects in the same CSG
group? Has radiosity data been gathered in the vicinity? Is the object
reflective? Is it transparent? Does refraction occur? Does total reflection
occur? Does dispersion occur? And so forth.

There *may* be ways to implement raytracing in a manner that is suitable for GPU
operation, or at least "outsorcing" some tasks; but the POV-Ray code is
definitely not.


Post a reply to this message

Copyright 2003-2021 Persistence of Vision Raytracer Pty. Ltd.