Open source .NET

GPU, ML and real-time media for .NET. Everywhere it runs.

Write it once in C#. Run it on WebGPU, WebGL, WebAssembly, CUDA, OpenCL and CPU, in the browser and on the desktop. Start with one package and a working example.

Open source, free for commercial use 76 packages on nuget.org 648K+ downloads
Why SpawnDev

Built in public, yours to use

One codebase, every target

The same C# runs in the browser and on the desktop. GPU kernels compile to WGSL, GLSL, Wasm, PTX and OpenCL C from one source.

Tested on real hardware

Every change is verified on each backend it touches, on real GPUs and real browsers, before release.

Built for throughput

Bulk data stays on the GPU or in JavaScript typed arrays. No hidden copies through the .NET heap.

Open source, no lock-in

SpawnDev code is 100% MIT and all work is done in public. Use it, fork it, ship it. Forked code keeps its original permissive license (details).

SpawnDev.ILGPU

GPU compute in C#, in the browser or on the desktop.

SpawnDev.ILGPU extends ILGPU, the .NET compiler that turns C# methods into GPU code, with three browser backends (WebGPU, WebGL and WebAssembly) and a SIMD CPU backend (Velocity) for the desktop. A kernel written for CUDA or OpenCL runs unchanged in a Blazor WebAssembly app and on the desktop, and the application picks the best available backend at run time. It ships as one NuGet package that brings the forked ILGPU compiler and SpawnDev.SpawnJS for browser interop.

More about SpawnDev.ILGPU
Program.cs
// Registers every backend the environment offers:
// browser = WebGPU, WebGL, Wasm; desktop = CUDA, OpenCL, Velocity
using var context = await Context.CreateAsync(builder => builder.AllAcceleratorsAsync());

// Browser: WebGPU, then WebGL, then Wasm.
// Desktop: CUDA, then a discrete OpenCL GPU, then other OpenCL devices, then Velocity.
using var accelerator = await context.CreatePreferredAcceleratorAsync();

int length = 256;
using var a = accelerator.Allocate1D(Enumerable.Range(0, length).Select(i => (float)i).ToArray());
using var b = accelerator.Allocate1D(Enumerable.Range(0, length).Select(i => (float)i * 2f).ToArray());
using var c = accelerator.Allocate1D<float>(length);

var kernel = accelerator.LoadAutoGroupedStreamKernel<Index1D, ArrayView<float>, ArrayView<float>, ArrayView<float>>(VectorAdd);
kernel((Index1D)length, a.View, b.View, c.View);

await accelerator.SynchronizeAsync();               // wait for the GPU
float[] results = await c.CopyToHostAsync<float>(); // the one way to read results back in the browser

static void VectorAdd(Index1D i, ArrayView<float> a, ArrayView<float> b, ArrayView<float> c) => c[i] = a[i] + b[i];

Shipping on SpawnDev?

Private tickets, response targets, a private GitHub tracker and a shared channel. Invoicing for businesses.

An unhandled error has occurred. Reload x