News for hackers. Stuff that matters.
Re:GPU.js by tenaciousDaniel on Friday October 08, 2021 @05:01PM (#28804156)
I think this uses Canvas/WebGL to provoke the GPU into performing calculations behind the scenes. If that's true, I imagine this solution will fall by the wayside as WebGPU becomes production ready.
Re:GPU.js by vegetablepotpie on Friday October 08, 2021 @05:29PM (#28804382)
It should. Then again WebCl existed 10 years ago to solve this problem but never took off because you needed vendor support for each device. So hacks like mapping matrix math to textures and back again is much more likely to work on the widest number of devices, which is why you see these libraries. With W3C support, JS GPU programming should be built into web browsers and we shouldn’t need such hacks to build high performance web apps.
Re:GPU.js by brundolf on Friday October 08, 2021 @06:03PM (#28804654)
There's a long tradition on the web of bundling various implementations of an emerging feature under a library that can automatically pick the best one for the platform it's running on. Usually these act as temporary scaffolding until the browser-sanctioned API becomes ubiquitous, at which point they're phased out
Re:GPU.js by pjmlp on Saturday October 09, 2021 @04:25AM (#28808020)
From what I remember Intel failed at least twice to make it happen with compute shaders.

First they had a kind of OpenCL plugin, which died when plugins got widespread killed.

Then they finally managed to ramp enough quorum to add OpenGL compute shaders to WebGL 2.0, as an extension, just to have Google killing the efforts with "compute on the Web should be done via WebGPU".

So now it is time to wait again, until WebGPU actually makes it.

Re:GPU.js by bperson on Friday October 08, 2021 @05:10PM (#28804251)
I checked, "Get WebGPU as an alternate backend (help wanted)"

> We need this [WebGPU] in GPU.js, possibly as a sub-project: https://github.com/maierfelix/webgpu Once it becomes stable, and well supported and tested, we could possibly make it the default fallback.

https://github.com/gpujs/gpu.js/issues/507

Re:GPU.js by fulafel on Saturday October 09, 2021 @02:18AM (#28807505)
These things tend to take a long time to mature.

We are just getting to the situation where WebGL 2 carrying the GLES 3.0 feature set works in all browsers (Safari delayed it many years).

GLES 3.0 was released in 2012 (edit: fixed year) and WebGL 2 in 2017.

But apps take a long time to mature too of course, so good that developers can get a taste of WebGPU already.

Re:GPU.js by Mikeb85 on Saturday October 09, 2021 @02:28AM (#28807552)
GLES 3 was released in 2012...
Re:GPU.js by fulafel on Saturday October 09, 2021 @02:36AM (#28807586)
Fixed, thanks.
Re:GPU.js by pjmlp on Friday October 08, 2021 @05:37PM (#28804445)
Which looking to the 10 years that took for WebGL 2.0 to finally become available everywhere, and WGSL is still half baked, being production ready is still a couple of years away.
Re:GPU.js by manomanomano on Friday October 08, 2021 @05:08PM (#28804220)
It's for nodejs
Re:GPU.js by zamadatix on Friday October 08, 2021 @05:36PM (#28804440)
Your comment probably got downed more drastically than normal for being a new account but on the off chance you're a legitimate new account that just had an unlucky first comment:

It's compatible with both web and Node. In Node it uses https://github.com/stackgl/headless-gl to provide a WebGL compatible implementation as Node doesn't ship with GPU access out of the box. The project is looking into https://github.com/maierfelix/webgpu or similar to instead provide Node with a WebGPU compatible implementation. Both require N-API. The tracking issue can be found here for reference https://github.com/gpujs/gpu.js/issues/507.

Re:GPU.js by worldsayshi on Friday October 08, 2021 @06:02PM (#28804641)
I also felt that it could be made clearer on the web page that it works on both node js and the web. Right now it could be interpreted as both or only node.
Re:GPU.js by dhritzkiv on Friday October 08, 2021 @08:20PM (#28805757)
Slight correction: headless-gl uses the precursor to N-API: nan, built with node-gyp. Regrettably.

Source: I'm the custodian/maintainer of headless-gl