Coder Social home page Coder Social logo

hellowebgpu.net's Introduction

Hello WebGPU.Net

This an example of how to use WebGPU on .Net (Windows and Browser), leveraging the WaveEngine WebGPU bindings.

https://webgpu.z28.web.core.windows.net/

Check https://webgpu.z28.web.core.windows.net/ for a live preview.

WebGPU on the browser is only currently supported on Chrome/Edge Canary versions, and Firefox Nightly.

  • Firefox: about:config -> dom.webgpu.enabled: true
  • Chrome/Edge: chrome://flags/#enable-unsafe-webgpu -> "Enabled"

Run it locally

Set-Up environment

Right now compilation must be finished on linux. Follow the dotnet-setup.sh script to install necessary dependencies (tested on Ubuntu 18 LTS).

Compile & Link

First, compile the project with MSBuild, then go to Linux if you are on windows (Ubuntu 18 LTS - WSL1) and run package.sh with the specific arguments of your project:

./package.sh [PATH_TO_PROJECT]/HelloWebGPUNet/HelloWebGPUNet.Web/bin/Release/netstandard2.0 $HOME/.build HelloWebGPUNet.Web.dll -a

-a option builds the project on AOT mode (the only one supported for now due to a bug in mono). Check the full list of arguments at package.sh

After compilation and linking are successfull, serve the folder bin/$(Configuration)/wasm with a static server.

libWebGPU.o

TODO

hellowebgpu.net's People

Contributors

emepetres avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

nerocui redhead17

hellowebgpu.net's Issues

Where is libwebgpu.o come from?

I have problem build project as blazor webassembly.
I use NativeFileReference in ItemGroup to link libwebgpu.o. (https://learn.microsoft.com/zh-cn/aspnet/core/blazor/webassembly-native-dependencies?view=aspnetcore-7.0)
But when I build the project, it show lots of undefined symbol. One of these:
undefined symbol: emscripten_webgpu_get_device (referenced by top-level compiled C/C++ code)

If I add EmccExtraLDFlags>-s WARN_ON_UNDEFINED_SYMBOLS=0</EmccExtraLDFlags> to PropertyGroup.
It can build successful but run failed that web console show blazor.webassembly.js:1 missing function: emscripten_webgpu_get_device.
I don't know how to solve it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.