onegpu
GPU compute and rendering for .NET from pure C#, on Vulkan, Metal and browser WebGPU. There are no native binaries of ours and no CUDA install: the backends talk to the platform’s own GPU API through the driver already on the machine.
It has two jobs. It is a small, compute-first device layer (typed buffers, async readback, compute pipelines, command encoders, timestamps, capabilities as data) with the surfaces, textures and graphics pipelines a renderer needs. And it ships the compute kernels that machine-learning inference needs, written in HLSL and compiled at build time for all three backends.
Open source, MIT or Apache-2.0, made by Recursive AI. Version 1.0.0 is on NuGet, for .NET 10.
The packages
| Package | What it is |
|---|---|
RecursiveAI. | Devices, adapters and capabilities, typed buffers, uploads and async readback, compute pipelines, command encoders, dispatch, timestamps, memory statistics, plus surfaces, textures and graphics pipelines. BCL only; no interop. |
RecursiveAI. | Vulkan 1.3 backend (Windows, Linux). |
RecursiveAI. | Metal backend (macOS, Apple silicon). |
RecursiveAI. | WebGPU backend for the browser ([JSImport], publishes onegpu.js). |
RecursiveAI. | GpuBackends: picks Metal on Apple platforms, WebGPU in a browser and Vulkan elsewhere. Reference it to get all three. |
RecursiveAI. | HLSL compute kernels with generated bindings: GEMM, attention, convolution, reductions, softmax, norms, gather and scatter, int8, recurrent layers, element-wise, integer and bool ops. |
Backends brings the three backends; reference RecursiveAI.OneGpu and one backend alone to be smaller. onegame takes its GPU layer from these packages. OneModel’s GPU support, built on these kernels, is coming in a later OneModel release.
Platforms and requirements
- .NET
.NET 10. Every package is trimmable and Native AOT compatible.
- Linux and Windows
A Vulkan 1.3 driver (NVIDIA, AMD, Intel; the Mesa software driver works too). Tested on NVIDIA and AMD hardware and on llvmpipe; Intel is not tested. The loader library (
libvulkan.so.1,vulkan-1.dll) must be installed. - macOS
Apple silicon with Metal. Tested on an M2.
- Browser
Chrome with WebGPU.
shader-f16andsubgroupsare used when the adapter offers them; a kernel that needs a missing feature falls back to a portable variant or reports it by name. - Not supported
No OpenGL, no CUDA, no mobile.