gpujs / gpu.js

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

Chrome 113 with WebGPU breaks GPU.js #820

Open dimagoltsman opened 1 year ago

dimagoltsman commented 1 year ago

A GIF or MEME to give some spice of the internet

What is wrong?

Chrome 113 breaks GPU.js when not scoped, its already has GPU object

Where does it happen?

when u try to use new GPU

How do we replicate the issue?

try using GPU.js

How important is this (1-5)?

5

Expected behavior (i.e. solution)

to work

Other Comments

lampmaker commented 1 year ago

Same. is there a quick fix / hack?

lampmaker commented 1 year ago

Nevermind; renamed all "GPU" instances in gpu-browser.min to "GPUX" That worked for now.

dimagoltsman commented 1 year ago

Nevermind; renamed all "GPU" instances in gpu-browser.min to "GPUX" That worked for now.

Me to, but thats a very bad practice.... thats a temp solution not a permanent one

lampmaker commented 1 year ago

Oh, yes, bad practice indeed. "Dont try this at home" Consider it a workaround until a better solution is implemented.

end-me-please commented 1 year ago

@robertleeplummerjr can you fix this? all the cool gpu.js projects suddenly stopped working :p

robertleeplummerjr commented 1 year ago

Yea I'll have to address it soon. Perhaps next week.

end-me-please commented 1 year ago

maybe gpu.js can leverage WebGPU? if it has any advantages performance-wise, and if the effort required doesn't mean rewriting all of gpu.js

would be especially interesting to see if it allows more flexibility with data types passed to/returned by gpu.js

dimagoltsman commented 1 year ago

yeah that will be awesome!

robertleeplummerjr commented 1 year ago

We'd love to do that, but the existing API isn't mature enough across browsers, at least from what I've seen with compute capabilities. I've never had a stock example actually run and have a means of starting to upgrade GPU.js to that.

As far as the issue with GPU being overwritten (rude with prejudice) what do you guys think of using GPUJS for browser only, and GPU everywhere else (node, typescript, etc.)?

end-me-please commented 1 year ago

sounds good enough

jacobbogers commented 6 months ago

We'd love to do that, but the existing API isn't mature enough across browsers, The api is very VERY mature, but only a few browsers support it https://caniuse.com/?search=webgpu

jacobbogers commented 6 months ago

As I have looked at gpu.js code vs current webgpu surface, it will be largely obsoleted, as gpu.js has to deal with how webgl handles concurrency, there is no such problem in webgpu, so I think its better to totally start from scratch (keep the brand name if you must, but from scratch you must start)