---
title: "onegpu"
url: https://recursiveai.org/onegpu/
description: "GPU compute and rendering for .NET from pure C#, on Vulkan, Metal and browser WebGPU. A compute-first device layer with typed buffers and async readback, plus HLSL compute kernels for all three backends. MIT or Apache-2.0. 1.0.0."
---

# 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.

```sh
dotnet add package RecursiveAI.OneGpu.Backends --version 1.0.0
```

```sh
dotnet add package RecursiveAI.OneGpu.Kernels --version 1.0.0
```

- [Getting started](https://recursiveai.org/onegpu/docs/getting-started/)
- [Docs](https://recursiveai.org/onegpu/docs/)
- [GitHub](https://github.com/recursive-ai-oss/onegpu-csharp)
- [NuGet](https://www.nuget.org/packages/RecursiveAI.OneGpu.Backends)

## The packages

| Package | What it is |
|---|---|
| `RecursiveAI.OneGpu` | 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.OneGpu.Vulkan` | Vulkan 1.3 backend (Windows, Linux). |
| `RecursiveAI.OneGpu.Metal` | Metal backend (macOS, Apple silicon). |
| `RecursiveAI.OneGpu.WebGpu` | WebGPU backend for the browser (`[JSImport]`, publishes `onegpu.js`). |
| `RecursiveAI.OneGpu.Backends` | `GpuBackends`: picks Metal on Apple platforms, WebGPU in a browser and Vulkan elsewhere. Reference it to get all three. |
| `RecursiveAI.OneGpu.Kernels` | 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](https://recursiveai.org/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-f16` and `subgroups` are 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.

## Go further

- [Getting started](https://recursiveai.org/onegpu/docs/getting-started/)
- [Compute surface](https://recursiveai.org/onegpu/docs/compute/)
- [Kernels](https://recursiveai.org/onegpu/docs/kernels/)
- [Matrix multiplication](https://recursiveai.org/onegpu/docs/gemm/)
- [Names and environment variables](https://recursiveai.org/onegpu/docs/environment/)
- [Changelog](https://recursiveai.org/onegpu/docs/changelog/)
- [GitHub](https://github.com/recursive-ai-oss/onegpu-csharp)
