Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GPU accelerated math in the browser

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?

like image 505
micho Avatar asked May 17 '11 19:05

micho


People also ask

Do browsers use GPU?

Browsers like Google Chrome use GPU power even more than applications like Microsoft Office do. It is by default enabled in Chrome, Firefox, and Internet Explorer.

Can JavaScript use GPU?

In short, GPU. js is a JavaScript acceleration library that can be used for general-purpose computations on GPUs using JavaScript. It supports browsers, Node. js and TypeScript.

What is GPU compositing?

Composition of layers whose contents are created directly on GPU works as follows: instead of rendering straight into the backbuffer, they render into a texture (using a Frame Buffer Object) that the compositor context grabs and uses when rendering that GraphicsLayer.


2 Answers

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".

like image 53
Bart Avatar answered Sep 28 '22 00:09

Bart


Since this old question was a top search hit for me on this topic, I thought I'd mention that some further exploration led me to gpu.js, which wraps WebGL in utility functions.

EDIT: ...and hopping through GitHub issues etc. from there led me to weblas as well. I don't have a comparison of these two yet, converting this answer to community wiki in case someone with experience in either of these sees this and has something to add.

like image 27
2 revs Avatar answered Sep 28 '22 00:09

2 revs