µ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:
uwgpu: Core library for writing microbenchmarks.microbenchmarks: Suite of microbenchmarks implemented withuwgpu.microbenchmarks-cli: CLI tool for native execution of the microbenchmarks.web-server: Server that serves the µwgpu website and collects execution results.
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 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.
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.
For launching and watching the web-server crate:
cargo wTo 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 wasmCompile and run CLI:
cargo cli <microbenchmark>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- 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.