gpujs / gpu.js

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

"Falling back to CPU" but in dev mode works #640

Open peterprib opened 3 years ago

peterprib commented 3 years ago

A GIF or MEME to give some spice of the internet

What is wrong?

Run several kernel then get "Falling back to CPU". If run dev mode works.

Plus when it goes into CPU mode it then gets ReferenceError: Cannot access 'constants_size' before initialization at CPUKernel.eval [as run] (eval at build (C:\Users\peter\git\node-red-contrib-gpu\node_modules\gpu.js\src\backend\cpu\kernel.js:170:18)

Where does it happen?

How do we replicate the issue?

Not sure how as basically it runs same logic a few times with different arrays then fails. Before deconstructing logic into "require" the same array worked in same sequence.

How important is this (1-5)?

1

Expected behavior (i.e. solution)

Consistent behaviour and if "Falling back to CPU" should give a reason so can fix issue. Plus should be able to control behaviour that is allow or disallow swap to CPU mode.

Other Comments

midnight-dev commented 3 years ago

I do agree - giving a reason would be greatly helpful for such events. But do you have any sample code that you know triggers it? If the behavior can't be reproduced, that generally makes bug hunting harder.

peterprib commented 3 years ago

Is repeatable. Need to external to github my current version. Will do when I sort out some issues in other areas. What conditions cause it to go to logic "Falling back to CPU".? And why the variance with "CPU" mode. The code fails earlier with same error when I sent CPU mode. Why does code that operate in GPU mode not work in CPU mode as this seems poor behaviour. Expect CPU mode to be more resilent.

peterprib commented 3 years ago

Problem is now not reproduceable and have no way compare to see differential in code. In theory only change was recopy of same code into require. So can drop priority to 5 as still think it should indicate reason for down grade to CPU plus make it optional as failure as would rather react to need to downgrade performance. Plus inconsistency between modes should not occur.