venus — Vulkan-over-virtio
github.com/go-virtio/venus is the pure-Go (CGO=0) implementation of
Venus, the Vulkan-over-virtio protocol — the guest-side counterpart
to the gpu virtio-gpu work. Venus reuses the virtio-gpu
device but replaces the whole submission model and serialises
essentially the entire Vulkan API, so it is a genuinely larger
undertaking than the virgl/GL path. This repo de-risks it bottom-up, one
verifiable rung at a time.
What it provides
internal/vncs— the wire runtime (thevn_cs.hequivalent): anEncoderand a mirroringDecoderover a[]byte, with LE, 4-byte-aligned primitives (Uint32/Int32/Uint64/Float32/Flags/Bool32/ DeviceSize/ArraySize/SimplePointer/BlobArray/String/Handle/Result) plus fixed/union array helpers. Each method transcribes a specific Mesavn_encode_*/vn_decode_*function, cited inline.gen— parsesvk.xml(encoding/xml) into a typed model and emits Go encoders and decoders by walking struct/command members exactly as Mesa's Python generator does (honouringoptional/len/altlen/sType/pNext, enums, handles,VkBool32/VkDeviceSize/size_t, nested-by-value structs, fixed-size arrays, theVkClearColorValueunion, counted arrays, typedpNextextension chains, count+array reply decoders, and returned-only struct decoders).cmd/vkgen— the generator CLI (-xml,-out,-pkg).proof— a generated proof subset spanning the full clear-image → readback command closure (vkCreateInstance/Device/Image,vkAllocateMemory,vkCmdClearColorImage,vkQueueSubmit, …) whose encoded/decoded bytes are asserted against independently hand-derived Mesa bytes — no GPU, no host required.
End-to-end
Beyond the offline-verified generator, Venus carries a working
shared-memory ring transport. A clear-image runs end-to-end on a real
renderer: the guest submits the full Vulkan command sequence
(instance → device → image → clear → submit) over the ring to
virgl_test_server --venus + lavapipe, and the host creates the image
and executes the clear. Guest-side pixel readback is closed too: on a
Linux render-node host the guest maps the cleared image's
HOST3D|MAPPABLE blob (gbm dma_buf) and reads the texels back as RED.
License
BSD-3-Clause.