GPU accelerated math in the browser

micho picture micho · May 17, 2011 · Viewed 7.5k times · Source

I'm starting a project for browsers which requires some complex data processing. The algorithm I'm using is 50-100x faster when accelerated with GPU.

I could use JavaScript, Flash or other technologies with the browser. Is there any way I can access the GPU to accelerate the processing of my math?

Answer

Bart picture Bart · May 17, 2011

You could start experimenting with Khronos' WebCL, although that's still in its infancy. The big players like Internet Explorer, Chrome and Opera show no clear plans for support just yet, with Microsoft not even showing any plans for WebGL support.

That being said, apart from a WebGL shader based GPGPU approach, WebCL might be your best bet for computation. WebCL is in essence a set of JavaScript bindings to OpenCL. As such, developments are most likely to be closely linked to those of OpenCL.

While, as said, support for WebCL is as of this moment not yet standard nor widespread, there are currently the following resources available:

  • The Khronos group has the official website here.
  • Nokia Research reports its experiments on their dedicated site, including a WebCL extension for FireFox (Version 18 only at the moment). The developer working on this extension also has a Twitter at https://twitter.com/NokiaWebCL.
  • Samsung's experiments for WebKit tested with the Safari browser are available here.
  • Motorola has a NodeJS-based implementation of OpenCL available here.
  • Mozilla itself seems to have become active was well with their own WebCL developments, though it's exact current status is unknown to me.

I have only started to play with it myself recently, but can't yet make any recommendations beyond "quite fun".