Machine learning visualization from VRAM

Caliper validates supported MPS and CUDA tensor inputs, then uses Metal or Vulkan to colormap or blit them into live ImGui textures. Imported geometry is drawn from the same device-resident allocation system.

Source available · no packaged release

Tensor input MPS   CUDA
GPU path Metal   Vulkan
Frame output ImGui   ImPlot   ImPlot3D

Tensor views stay inside the frame loop.

For supported inputs on native backends, Caliper hands tensor storage to the renderer without a host-memory round trip. Colormap and blit work remain on the GPU, and ImGui receives the resulting texture in the same frame.

Curve and scatter coordinates may still use small CPU arrays. The device-resident paths cover accepted dense textures and geometry drawn from imported allocations.

Tensor bridge reference
Comparison between a host-staged texture path and Caliper's native path. The host-staged path copies a GPU tensor to a CPU array, encodes and decodes a file, then uploads a texture. Caliper's native path performs the tensor-to-texture work on the GPU and draws it with ImGui in the same frame.
Native tensor bridge path compared with a host-staged texture path.

Native backends use different memory handoffs.

The sequence stays consistent: validate the descriptor, process the data on the active GPU backend, and present the result through ImGui. Storage and synchronization differ by platform.

macOS / Metal

Unified-memory path

Metal path on Apple silicon. A contiguous MPS tensor is validated, handed to Metal through unified memory, converted to a texture on the GPU, and drawn through ImGui.
MPS tensor data is colormapped or blitted on the GPU before ImGui draws it.

The Metal renderer is the macOS default. The bridge validates layout and device information before using the buffer; unsupported inputs are rejected instead of reinterpreted.

Windows / Vulkan

Device-local CUDA interop

Vulkan and CUDA path on Windows. A CUDA tensor stays in device-local memory, passes through a Vulkan-exported shared buffer and GPU colormap operation, and is drawn through ImGui without system-RAM staging.
The path remains in device-local memory, with one VRAM copy at most and no system-RAM staging.

Vulkan exports device-local memory for CUDA import. When shared timeline semaphores are available, GPU-side ordering avoids CPU synchronization on the hot path; otherwise the producer is drained before handoff. Device pairing is UUID-based, and mismatches disable interop instead of crossing adapters.

How input becomes a rendered view.

A DLPack-aligned descriptor carries the device, type, shape, strides, and optional stream. Caliper validates that descriptor before selecting the active renderer path.

Validate the descriptor

Checks device compatibility, data type, dimensions, layout, and byte extent before renderer access. Unsupported inputs are rejected rather than reinterpreted.

Process device memory

Accepted 2-D f32 data runs through a LUT colormap; accepted RGBA8 data uses a blit path. Metal and Vulkan perform this work on the GPU, and imported allocations can feed geometry draws.

Present and update

The renderer exposes an opaque texture ID to ImGui, updates the same resource for matching shape and type, and releases it on the frame thread. OpenGL remains a CPU-staged path for CPU inputs.

Backend status

macOSMetal default · GPU-resident MPS tensor path
WindowsVulkan default · CUDA external-memory interop
FallbackOpenGL 3.3 core · CPU-staged tensor upload

Documentation

Renderer architecture, tensor and geometry references, backend compatibility, verification, and the project decision log.