CUDA and Ray tracing; are they really a good…
Previous week I mailed to people who worked on ray tracing with CUDA architecture and I received some disheartening mails. I would like to share these mails since you may need to understand reasons for the conflict between NVidia’s CUDA 1.1 architecture and ray tracing.
I sent this mail to “the secret matador” whom I found in NVidia’s CUDA forums;
> umut has sent you this email from
> http://forums.nvidia.com/index.php.
>
>
> Hello
> I am studying my master degree on computer games
> tech and I’m planning to choose ray tracing on cuda
> processors in dynamic scenes for my master thesis,
> however, as i read from your post itz really not a
> good idea. Is it? I am also concerned about the
> number of replies to your post (no reply as i see).
> I would like to ask you if it is a good idea to do
> my master thesis on this topic or would you like to
> suggest some different topics about CUDA?
> I would really appreciate your answer.
> Thanks
>
> UMUT
> umuter { @t } gm@il.com
>
Well, I was trying to perform raytracing with CUDA
also some time ago. My scenes contained triangles. If
you want to use CUDA for just spheres I think can be
as fast as Cell ( see
http://eric_rollins.home.mindspring.com/ray/cuda.html
)
Well, for xNormal I tryed CUDA with triangle
scenes(1-10M triangles) and I wasn’t able to get it
working at decent speed. Perhaps if you use smaller
scenes could be ok… but was terrible slow for me…
I think my scenes were too big to fit well in the
shared/const memory. I used BVHs, grids and stackless
kdtrees without any good result. A dual-core was
always faster. Btw, the CUDA stackless approach sux a
lot! CUDA is very good processing linear data(like an
image kernel) but terrible processing random and
recursive structures like the ones that requires
raytracing.
Another problem I found was that there is no CUDA x64
version, neither is Vista compatible and the VRAM on
desktop G80 cards was too small for me(256-512Mb is
the typical and my scenes were occuping almost 1Gb).
The CUDA 1.1 does not support 3D textures so is a pain
to get the uniform grids working…
Well, I hope you could improve my results… CUDA was
not very good for me. I hope they add a function
stack, better syncronization mechanism and improved
registers/instruction count for CUDA 2.
After getting this mail I asked a similar question to Eric Rollins who is most probably one of the first people trying to implement ray tracing algorithm on CUDA. And I also asked if PS3 or CUDA? which one should I choose and the answer is pretty clear; PS3. Eric Rollin’s complete answer:
Umut;
I think you are correct about the difficulties with ray tracing on CUDA. It is easier on the Cell/PS3, though still challenging. See papers linked on my PS3 ray tracing page, and MIT blue steel: http://cag.csail.mit.edu/ps3/blue-steel.shtml
In my code for CUDA and Cell/PS3 the only primitive I have implemented is the sphere.
I assume you have already seen this paper on alternative approaches: http://graphics.stanford.edu/papers/i3dkdtree/gpu-kd-i3d.pdf . Also some of the latency avoidance techniques discussed for Cell/PS3 might apply to CUDA. I do recommend reading the papers for Cell/PS3 even if you want to try CUDA.
If you have a big insight on how to do CUDA, go with it. Otherwise I recommend Cell/PS3.
Good luck.