gpujs / gpu.js

GPU Accelerated JavaScript
https://gpu.rocks
MIT License
15.07k stars 650 forks source link

Maybe use a Vulkan backend for node? #414

Open robertleeplummerjr opened 5 years ago

robertleeplummerjr commented 5 years ago

Started the thread here: https://github.com/maierfelix/nvk/issues/2 and got a good response for a GPGPU. Might be worth a shot.

DanielMazurkiewicz commented 5 years ago

It is a good idea for couple of reasons:

  1. Vulkan is not limiting computations to single device, it allows to use all GPUs simultaneously (even if from different vendors)
  2. Operating directly on SPIR-V level makes it even faster (spir-v compiles faster than GLSL and allows direct low level optimizations)
DanielMazurkiewicz commented 5 years ago

@robertleeplummerjr Just started to work on my libraries for vulkan:

https://github.com/DanielMazurkiewicz/vulkan-spirv https://github.com/DanielMazurkiewicz/vulkan-spirv-pretty https://github.com/DanielMazurkiewicz/vulkan-compute

Feel free to drop any comments, or expectations or so ...

maierfelix commented 5 years ago

Still considering using a Vulkan backend? - nvk now uses N-API, runs on Windows, Linux, Darwin, has no dependencies and is only 6mb in size

harshkhandeparkar commented 5 years ago

I would definitely love if this is implemented. Maybe it can be released in the next major? Vulkan is awesome! Much Much much faster than the current state. @robertleeplummerjr

robertleeplummerjr commented 5 years ago

Is there an example that is both headless, and returns an array?

robertleeplummerjr commented 5 years ago

Also, @HarshKhandeparkar speaks what I'm feeling as well. We do want this, I think in the form of its own dependency, that way it is optional. Probably similar to https://www.npmjs.com/package/@gpujs/expo-gl .

maierfelix commented 5 years ago

@robertleeplummerjr Yes that's what the mandelbrot example does. See this line, where the GPU memory gets read back