Closed dan-reznik closed 3 years ago
The issue is that you are using unsigned (4 8bit integers, packed to GPU, unpacked, and repacked for storage of a lower precision 32 bit float) output. You likely could get past it by just using 'Array' as the argument/return types, or just omit those altogether, and let GPU.js detect the types. I'm working out a fix.
Robert thanks! can I simply declare that everything is single?
There is this tension of not declaring anything and declaring everything which has caused me (a newbie) a lot of trouble. Also, would appreciate if could be more clear in the documentation about what is the difference of
a) functions declared normally before the gpu.createKernel() b) gpu.addFunction() c) kernel.addFunction() d) native functions e) injected functions
When should we need either?
Dan
On Wed, Apr 14, 2021 at 11:13 AM Robert Plummer @.***> wrote:
The issue is that you are using unsigned (4 8bit integers, packed to GPU, unpacked, and repacked for storage of a lower precision 32 bit float) output. You likely could get past it by just using 'Array' as the argument/return types, or just omit those altogether, and let GPU.js detect the types. I'm working out a fix.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gpujs/gpu.js/issues/687#issuecomment-819550497, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD32VFRWIJS3PSGFFCCPWBLTIWPHHANCNFSM425CUJPA .
can I simply declare that everything is single?
Not for when in graphical mode.
Also, would appreciate if could be more clear in the documentation
Much of that came about from the project being incomplete when I found it. I'm just a maintainer.
When should we need either?
I personally use gpu.addFunction()
, I feel it is the most descriptive.
I ran your use case and found that it looks like you are doing some advanced stuff with matrices, which is highly experimental. I'd try and stick to simple arrays if possible unless you'd like to be a contributor as well, which is always welcomed.
In any case, I provided a fix which allows us to use Array(2)
, Array(3)
, and Array(4)
in both unsigned and single precision use cases. That was just published: https://www.npmjs.com/package/gpu.js/v/2.11.3
Robert thanks for the update. I just tried it and it is still falling back to the CPU. Perhaps I did not update it correctly. I am using this from within the browser. I am loading the library from index.html with:
<script @.***/dist/gpu-browser.min.js">
Will this get me to the latest version?
Dan
On Wed, Apr 14, 2021 at 5:55 PM Robert Plummer @.***> wrote:
can I simply declare that everything is single?
Not for when in graphical mode.
Also, would appreciate if could be more clear in the documentation
Much of that came about from the project being incomplete when I found it. I'm just a maintainer.
When should we need either?
I personally use gpu.addFunction(), I feel it is the most descriptive.
I ran your use case and found that it looks like you are doing some advanced stuff with matrices, which is highly experimental. I'd try and stick to simple arrays if possible unless you'd like to be a contributor as well, which is always welcomed.
In any case, I provided a fix which allows us to use Array(2), Array(3), and Array(4) in both unsigned and single precision use cases. That was just published: https://www.npmjs.com/package/gpu.js/v/2.11.3
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
I am not trying to do anything with matrices. This is geometry code, it has arrays of points (I think this is called Array1D(2)), e.g., representing the 3 vertices of a triangle.
On Wed, Apr 14, 2021 at 5:55 PM Robert Plummer @.***> wrote:
can I simply declare that everything is single?
Not for when in graphical mode.
Also, would appreciate if could be more clear in the documentation
Much of that came about from the project being incomplete when I found it. I'm just a maintainer.
When should we need either?
I personally use gpu.addFunction(), I feel it is the most descriptive.
I ran your use case and found that it looks like you are doing some advanced stuff with matrices, which is highly experimental. I'd try and stick to simple arrays if possible unless you'd like to be a contributor as well, which is always welcomed.
In any case, I provided a fix which allows us to use Array(2), Array(3), and Array(4) in both unsigned and single precision use cases. That was just published: https://www.npmjs.com/package/gpu.js/v/2.11.3
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
To try to debug why I cannot yet invoke the GPU,
0) perhaps I still don't have the fixed version 1) How can I know which types are being assigned to each function? 2) Currently, i don't gpu.addFunction() anywhere. Could this be a problem?
In this repository one only needs to files: index.html and main.js
https://github.com/dan-reznik/Isodynamic-Map-GPU
On Wed, Apr 14, 2021 at 9:33 PM Dan Reznik @.***> wrote:
I am not trying to do anything with matrices. This is geometry code, it has arrays of points (I think this is called Array1D(2)), e.g., representing the 3 vertices of a triangle.
On Wed, Apr 14, 2021 at 5:55 PM Robert Plummer @.***> wrote:
can I simply declare that everything is single?
Not for when in graphical mode.
Also, would appreciate if could be more clear in the documentation
Much of that came about from the project being incomplete when I found it. I'm just a maintainer.
When should we need either?
I personally use gpu.addFunction(), I feel it is the most descriptive.
I ran your use case and found that it looks like you are doing some advanced stuff with matrices, which is highly experimental. I'd try and stick to simple arrays if possible unless you'd like to be a contributor as well, which is always welcomed.
In any case, I provided a fix which allows us to use Array(2), Array(3), and Array(4) in both unsigned and single precision use cases. That was just published: https://www.npmjs.com/package/gpu.js/v/2.11.3
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
I wrote my first GPU.js program (below). Though the graphical output it produces is perfectly correct, it is automatically falling back to CPU mode (no idea why). My PC does have a GPU: Vendor: Google Inc. (NVIDIA), ANGLE (NVIDIA, NVIDIA GeForce GTX 1050 Ti Direct3D11 vs_5_0 ps_5_0, D3D11-27.21.14.5671)
Would appreciate ideas on how to change the code below so it runs on the GPU. It is live here.