Skip to main content

Real-time Torch visualization window with Vulkan zero-copy

Project description

๐Ÿ”ฅ Vultorch

Real-time Torch Visualization Window ยท Vulkan Zero-Copy

Visualize CUDA tensors at GPU speed โ€” zero CPU readback, zero staging buffers.

License: MIT Python 3.8+ Vulkan

๐Ÿ‡จ๐Ÿ‡ณ ไธญๆ–‡ ยท ๐ŸŒ Website


Vultorch screenshot

Overview

Vultorch displays CUDA tensors in a native window โ€” data never leaves the GPU. show() performs a fast GPU-GPU copy; create_tensor() eliminates even that via Vulkan shared memory.

vultorch.show(tensor)           # GPU-only, no CPU readback
tensor = vultorch.create_tensor(...)  # true zero-copy, no memcpy at all

Key Features

  • GPU-only display โ€” vultorch.show(tensor) does a fast GPU-GPU copy to Vulkan, no CPU readback ever
  • True zero-copy โ€” vultorch.create_tensor() returns a torch.Tensor backed by Vulkan shared memory โ€” zero memcpy
  • One-line API โ€” vultorch.show(tensor) handles format conversion, upload, and display
  • Built-in ImGui โ€” Sliders, buttons, color pickers, plots, docking layout โ€” all from Python
  • 3D scene view โ€” Map textures onto lit 3D planes with orbit camera, MSAA, Blinn-Phong shading
  • Docking windows โ€” Drag-and-drop window arrangement (ImGui docking branch)

Quick Start

pip install vultorch
import torch, vultorch
from vultorch import ui

# Your neural texture output (or any CUDA tensor)
texture = torch.rand(512, 512, 4, device="cuda")

win = vultorch.Window("Neural Texture Viewer", 800, 600)
while win.poll():
    if not win.begin_frame(): continue
    ui.begin("Output")
    vultorch.show(texture)  # GPU-only, no CPU round-trip
    ui.end()
    win.end_frame()
win.destroy()

True Zero-Copy

# Shared GPU memory โ€” writes are instantly visible on screen
tensor = vultorch.create_tensor(512, 512, channels=4)
tensor[:] = model(input)   # write directly, no copy needed

3D Scene

scene = vultorch.SceneView("3D", 800, 600, msaa=4)
scene.set_tensor(texture)
scene.render()  # orbit camera, Blinn-Phong lighting

Examples

Example Description
01_hello_tensor.py Minimal tensor display
02_imgui_controls.py ImGui widgets: sliders, plots, colors
03_scene_3d.py 3D scene with lighting + orbit camera
04_docking_layout.py Drag-and-drop dockable window layout
05_zero_copy.py True zero-copy shared tensor
python examples/01_hello_tensor.py

Building from Source

Prerequisites

Component Required Notes
GPU โœ… Any Vulkan-capable GPU (NVIDIA, AMD, Intel)
Vulkan Runtime Ships with your GPU driver โ€” no separate install needed
Vulkan SDK Build only lunarg.com/vulkan-sdk โ€” only for building from source
CUDA Toolkit Optional For show() and create_tensor()
Python 3.8+ โœ…
CMake 3.25+ Build only + Ninja

Clone & Build

git clone --recursive https://github.com/ChenlizheMe/Vultorch.git
cd Vultorch

One command โ€” configure, compile, and produce a wheel in dist/:

# Windows
build.bat

# Linux
./build.sh

The wheel appears in dist/. Install it:

pip install dist/vultorch-*.whl

The build script auto-detects the active Python environment, so the wheel matches whichever python is on your PATH (conda, venv, system, etc.).

Architecture

vultorch/
โ”œโ”€โ”€ src/                    # C++ core
โ”‚   โ”œโ”€โ”€ engine.cpp/h        # Vulkan + SDL3 + ImGui engine
โ”‚   โ”œโ”€โ”€ tensor_texture.*    # CUDA โ†” Vulkan zero-copy interop
โ”‚   โ”œโ”€โ”€ scene_renderer.*    # Offscreen 3D renderer (MSAA, Blinn-Phong)
โ”‚   โ”œโ”€โ”€ bindings.cpp        # pybind11 Python bindings
โ”‚   โ””โ”€โ”€ shaders/            # GLSL shaders โ†’ SPIR-V
โ”œโ”€โ”€ vultorch/               # Python package
โ”‚   โ””โ”€โ”€ __init__.py         # High-level API (Window, show, SceneView)
โ”œโ”€โ”€ external/               # Git submodules
โ”‚   โ”œโ”€โ”€ pybind11/           # C++ โ†” Python binding
โ”‚   โ”œโ”€โ”€ SDL/                # Window / input (SDL3)
โ”‚   โ””โ”€โ”€ imgui/              # Dear ImGui (docking branch)
โ”œโ”€โ”€ examples/               # Ready-to-run demos
โ”œโ”€โ”€ tools/                  # Build utilities
โ””โ”€โ”€ docs/                   # GitHub Pages website

License

MIT


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

vultorch-0.3.2-cp312-cp312-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.12Windows x86-64

vultorch-0.3.2-cp311-cp311-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.11Windows x86-64

vultorch-0.3.2-cp310-cp310-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.10Windows x86-64

vultorch-0.3.2-cp39-cp39-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.9Windows x86-64

vultorch-0.3.2-cp38-cp38-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.8Windows x86-64

File details

Details for the file vultorch-0.3.2-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: vultorch-0.3.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for vultorch-0.3.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 5cf53f239e5fed957f58158e18b543273d527c7984e714f93e46b5cc779e9690
MD5 3222cbef9fd31750dedf63421ee2f504
BLAKE2b-256 61a04dcffedb10719bc2fb195acb9979f6ec71551efe0c42774f4cdba10d94d4

See more details on using hashes here.

File details

Details for the file vultorch-0.3.2-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: vultorch-0.3.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for vultorch-0.3.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 3421700fc7e302a556202df2305ec30f5ac485419e3a4ba3f4774d43af1fa1be
MD5 22503967c0389789acaf12b4b435f9df
BLAKE2b-256 0c4dd0a2b6fedbf7db4666b5b4e00481115edc2cdfe0eb5748a8fc07ac57d3db

See more details on using hashes here.

File details

Details for the file vultorch-0.3.2-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: vultorch-0.3.2-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for vultorch-0.3.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 f30d3c9848acb0575b4afbcb9b0200a52328d797863f57c46f347a3b7861cf7a
MD5 8a21ef44e1f697da4d32e1936a3d4e70
BLAKE2b-256 d5c87a9891fb92cc163e5d139fa3a5991674834cd414e79219cb4a6bfa36c7a4

See more details on using hashes here.

File details

Details for the file vultorch-0.3.2-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: vultorch-0.3.2-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for vultorch-0.3.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 bc5493bb2a1fbb0be75e3ac2535e5c6a6761da24422cfd10a94a9095710967ea
MD5 86d47c292b1e0dd9ff155f53c80b3692
BLAKE2b-256 c9ebdbcdc9bfada6f287589cc5443d9f76ea51325660b71d80c8b2a20f90cf88

See more details on using hashes here.

File details

Details for the file vultorch-0.3.2-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: vultorch-0.3.2-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for vultorch-0.3.2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 8e7ed5b0e0a9e57c2113b51aa8644730c71c1d35ed06860850f7f8006c21d0be
MD5 78bd353db729ab359cd1a94fb9546eed
BLAKE2b-256 7d23dce6564da3ebbfe51370e7e0328a2c95022aafa358aded8be5f182bb6d8e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page