[Botan-devel] using GPUs as accelerators

Jack Lloyd lloyd at randombit.net
Thu Mar 29 11:04:18 EDT 2007


On Thu, Mar 29, 2007 at 07:21:40PM +0500, Muzaffar Mahkamov wrote:
> The implementation mentioned in the paper used OpenGL as an API to the
> GPU. OpenGL, afaik, provides limited support for general purpose
> programming. nVidia CUDA, on the other hand, provides "native" API to
> G80 series and later. The developer decides which functions are
> executed on GPU and uses nVidia compiler to generate the code.

True, but I would expect that OpenGL's interface more or less reflects
the primitives available on the hardware (or at least on hardware of
3-5 years ago). One real killer on OpenGL and stream processors is
random memory access (eg, an sbox).

> I believe this would yield more performance than OpenGL
> implementation. The floating point operation performance is
> impressive, however they do not publish integer arithmetic
> performance. Time will tell, since only high end G80 GPUs are
> available so far, with budget models going mainstream later this
> year.

There are some instruction timings in section 6.1.1 of the CUDA manual
that suggests integer performance is pretty good as well (integer
mul/div/mod are slow, which is no surprise, but add/sub/bit ops are 2
cycles/op, same as the floating point). There is some fast on-chip
memory available but it's not much compared to modern CPU data caches,
and main memory access is obviously very slow.

> I also came across a commercial solution by PeakStream that allows
> running your code both on CPU and GPU, independent of the hardware.
> It's supported on Linux and Windows: http://www.peakstreaminc.com/

There is another company called Rapidmind (http://www.rapidmind.net/)
that looks to have a somewhat similar product for GPUs and the Cell
SPU.

-J


More information about the botan-devel mailing list