Skip to content

Expose WebGPU? #42896

Closed as not planned
Closed as not planned

Description

@targos

What is the problem this feature will solve?

WebGPU is a new web platform feature that allows to use graphics hardware power from JavaScript. With it, you can write algorithms in a shading language and take advantage of the high parallelism of GPUs to make fast computations.
The WebGPU API is being implemented by Chrome, Firefox and Safari.

What is the feature you are proposing to solve the problem?

I'm proposing that we work towards making the API available in standard installations under navigator.gpu, like in browsers.

Chrome's implementation is being developed as a standalone C++ library called Dawn.
They also have written Node.js bindings for it.
/cc @Kangz @ben-clayton What do you think about this?

What alternatives have you considered?

Let it be in userland.

Activity

  1. Kangz commented on Apr 28, 2022

    @Kangz

    Whoever wants to use WebGPU in node should just use dawn.node and not bother reimplementing things. We use it for internal testing against the WebGPU CTS so it basically feature complete except for some device creation logic and swapchains. I don't know that it should be bundled in standard node installations: it's not going to work everywhere because you need a GPU or Swiftshader to make WebGPU run.

  2. changed the title [-]Implement WebGPU?[/-] [+]Expose WebGPU?[/+] on Apr 28, 2022
  3. targos commented on Apr 28, 2022

    @targos
    MemberAuthor

    I renamed the issue to "Expose WebGPU" because I'm really not suggesting we reimplement everything.
    What I'd like to know is whether other people think it's a good idea to try and include dawn/dawn.node in standard Node.js installations (even if it may end up being available on incompatible systems).
    BTW, I would be interested in trying dawn.node separately, but I haven't found any public build of it.

  4. bnoordhuis commented on Apr 28, 2022

    @bnoordhuis
    Member

    Deno supports WebGPU and ML people seem to love it.

    An alternative to Dawn is wgpu / wgpu-native. In Rust, yes, but with broader community support and used outside Chrome/Chromium.

  5. moved this to Pending Triage in Node.js feature requestson Apr 28, 2022
  6. mscdex commented on Apr 28, 2022

    @mscdex
    Contributor

    I think we should leave this to userland.

  7. Kangz commented on Apr 28, 2022

    @Kangz

    As long as there is a package that's easy to add for developers, it seems that userland would be fine, no?

  8. targos commented on Apr 29, 2022

    @targos
    MemberAuthor

    As long as there is a package that's easy to add for developers, it seems that userland would be fine, no?

    Maybe, at least as a first step. Does such a package exist?

  9. Kangz commented on Apr 29, 2022

    @Kangz

    It doesn't exist yet, mostly because the Dawn contributors don't have experience on how to do it (and because it only recently reached good enough quality). I'll volunteer @DeltaEvo to figure out how to setup dawn.node to be published. The difficult is to do it on multi OSes since the binary is OS depend.

  10. bnoordhuis commented on May 1, 2022

    @bnoordhuis
    Member

    There's already a Dawn binding but it's pretty buggy and doesn't look actively maintained (last update 2 years ago.)

  11. Kangz commented on May 2, 2022

    @Kangz

    @maierfelix would you be interested in transitioning the webgpu package to be based on dawn.node? Let's chat on Matrix.

  12. github-actions commented on Oct 30, 2022

    @github-actions
    Contributor

    There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment.

    For more information on how the project manages feature requests, please consult the feature request management document.

  13. added
    staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.
    on Oct 30, 2022
  14. 2 remaining items

  15. github-actions commented on Apr 29, 2023

    @github-actions
    Contributor

    There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment.

    For more information on how the project manages feature requests, please consult the feature request management document.

  16. added
    staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.
    on Apr 29, 2023
  17. removed
    staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.
    on Apr 29, 2023
  18. benjamingr commented on Apr 29, 2023

    @benjamingr
    Member

    @nodejs/github-bot (hope that's the right ping), it looks like the never-stale label is broken ^

  19. bnoordhuis commented on Apr 29, 2023

    @bnoordhuis
    Member

    OTOH, if no one is actively working on it, then we may just as well close it out.

    I would summarize the consensus as: no strong resistance against inclusion in core but no strong desire either. Third-party packages exist and are likely Good Enough(TM).

  20. moved this from Pending Triage to Stale in Node.js feature requestson May 1, 2023
  21. added
    staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.
    and removed
    never-staleIssues and PRs exempt from automated stale handling.
    on May 1, 2023
  22. benjamingr commented on May 1, 2023

    @benjamingr
    Member

    Closing as not planned (as this is not completed)

  23. devsnek commented on Aug 24, 2023

    @devsnek
    Member

    For anyone wandering past in need of webgpu, I updated dawn to include a proper node.js module entrypoint, exposing a gpu object analogous to navigator.gpu: https://dawn.googlesource.com/dawn/+/refs/heads/main/src/dawn/node/index.js

    if there is enough interest we may be able to set up an auto-published npm module.

  24. matthargett commented on Oct 25, 2023

    @matthargett

    Yes, please make a blessed npm package!

  25. iampi31415 commented on Apr 16, 2025

    @iampi31415

    So currently one can use this library which exposes dawn (whatever this means) ?

    Is there any way to use the Rust counterpart ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues requesting new Node.js features.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions