Realm

Vulkan in Rust.

Native Vulkan bindings, cached dispatch, and an integrated Rust allocator for graphics and GPU compute. Free functions and associated methods share the same operation bodies.

RustMIT
A GPU board with glowing orange circuit traces
vk · Vulkan Rust bindings

Install

The Cargo package is vkrust; the library and import namespace are vk.

Cargo.toml

1[dependencies]
2vk = { package = "vkrust", version = "0.13" }
3

The default loader feature loads the system Vulkan library at runtime. Consumers do not need a Vulkan SDK, C compiler, or binding generator.

Integrated allocator

Enable the allocator feature for vk::mem, the Rust-native, VMA-derived allocator. It provides managed buffers and images, memory pools, mapping, budgets, virtual placement, and explicit multi-pass relocation. Consumers need no C++ allocator or FFI bridge.

The allocator remains Experimental. Native resources and allocations need explicit cleanup; operations and Drop never submit or wait. Full VMA equivalence, unrestricted mixed-phase concurrency, broader platform execution, and comparative performance remain unqualified.

Allocator benchmarks

Vk had a lower median time than VMA 3.4.0 in 23 of 44 workloads. For 20, the entire 95% interval was below 1.0×. The ratio spanned 0.624× to 1.091× across the full matrix.

Workloadvk / VMA95% interval
Virtual TLSF · churn at minimum offset0.624×0.619 to 0.630
Virtual linear · LIFO free0.697×0.607 to 0.711
Virtual linear · churn0.760×0.739 to 0.806
Virtual TLSF · churn · 32 live0.810×0.755 to 0.875
Pooled buffers · TLSF · reverse · 1 live0.911×0.902 to 0.928
Pooled buffers · TLSF · LIFO free0.924×0.903 to 0.936
Separate buffers · LIFO free0.966×0.948 to 1.026
Pooled buffer · map, write 8 bytes, unmap1.011×1.002 to 1.036
Separate images · LIFO free1.037×1.018 to 1.060
Pooled buffers · TLSF · shuffled free1.042×1.013 to 1.063
Pooled images · TLSF · LIFO free1.045×1.018 to 1.058
Pooled buffers · TLSF · churn · 32 live1.057×1.042 to 1.087
Pooled buffers · linear · shuffled free1.091×0.980 to 1.172

Selected workloads from the run on a Surface Laptop 5 with Intel Iris Xe and Mesa 26.3.1. Each ratio combines allocation and release time across 20 interleaved pairs of fresh processes. Measurements use development commit 05bb378. Full benchmark results and methodology

Native contracts

SurfaceContract
DispatchImmutable per-context function tables. No mutable global dispatch or per-call symbol lookup.
Calling stylesFree functions take an explicit dispatch context; associated methods delegate to the same implementation.
Record constructionGenerated borrowed setters keep backing host storage live. Native layout and raw fields remain available.
Resource ownershipVulkan calls remain unsafe. The caller owns valid usage, synchronization, exact completion, and explicit destruction.

Vk exposes Vulkan directly. OA uses these bindings in its runtime to execute operations on semantic values such as matrices, images, and audio.

Version and qualification

These guides follow 0.13.5+1.4.365, with Rust 1.98.1 as the declared baseline. The version suffix identifies the generated Vulkan header snapshot; it does not require a Vulkan 1.4 driver. Requested API versions and enabled features must match the actual implementation.

v0.13.5 inlines allocator publication and skips repeated export checks and reservations. The public function signatures are unchanged.

See the qualification report for physical-device, platform, and allocator limits.