Skip to content
/ uwgpu Public

A wgpu microbenchmarking compute pipeline, a collection of benchmarking shaders, a CLI tool for execution and a website for browser execution.

Notifications You must be signed in to change notification settings

zkwinkle/uwgpu

Repository files navigation

µwgpu

µwgpu is a project leveraging the wgpu graphics API to create a cross-platform microbenchmarking compute pipeline, a collection of microbenchmarks, a CLI tool for native execution and a website for browser execution.

This repository includes the following crates:

⚠️ NOTE: This project is in highly experimental stages. None of the crates have been published to crates.io yet due to being very likely to receive a lot of breaking changes.

Rationale

This project takes inspiration from µVkCompute and also attempts to probe and understand the characteristics of the target hardware.

But, thanks to leveraging wgpu "cross-platformness", we can gather execution statistics for a wide array of hardware being executed on different platforms. It might also give insight to the differences in performance of the WebGPU backends.

Native support

Native execution through the CLI has only been tested on Linux, but there should be no reason for it to not work on other major platforms.

Browser support

At the moment, browser execution only works on Chrome or Chromium-based browsers. And if you're on Linux you'll need to set an additional flag to enable WebGPU.

Firefox will be supported once it implements support for timestamp queries.

Useful commands

For launching and watching the web-server crate:

cargo w

To compile the microbenchmark's library as a WASM pack that the server can use:

wasm-pack build crates/microbenchmarks -d ../web-server/public/pkg --target web --no-typescript --no-pack -- --features wasm

Compile and run CLI:

cargo cli <microbenchmark>

Nix Flake

A flake.nix file is supplied, currently it only offers a package for the web-server crate.

To build the package, use the following command:

nix build '.#web-server' --extra-experimental-features "nix-command flakes" --show-trace

TODO

  • Create a separate crate with API types that can be sent to the server as requests, and methods to build them (like the post results request). Can be compiled to WASM and used from JS code to ensure data integrity/consistency. Can also be used by the CLI.

About

A wgpu microbenchmarking compute pipeline, a collection of benchmarking shaders, a CLI tool for execution and a website for browser execution.

Resources

Stars

Watchers

Forks