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 by sharing GPU memory between PyTorch and Vulkan. Data stays on the GPU โ€” there is no tensor.cpu() readback and no staging buffer copy.

vultorch.show(tensor)   # zero-copy, submillisecond

Key Features

  • Zero-copy display โ€” Vulkan external memory interop, data never leaves the GPU
  • True shared memory โ€” vultorch.create_tensor() returns a torch.Tensor backed by Vulkan memory (DLPack)
  • 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)  # zero-copy GPU โ†’ screen
    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.1-cp312-cp312-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.10Windows x86-64

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

Uploaded CPython 3.9Windows x86-64

vultorch-0.3.1-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.1-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: vultorch-0.3.1-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.12.3

File hashes

Hashes for vultorch-0.3.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 95d59bc142b5747487f23fd7d286f8cd523a58f666f79f5920f0040bc098a3f5
MD5 08c9428832548c9e00253c0198805dca
BLAKE2b-256 cbc95b1a245a76abad9b7d7e0bfea16e08a5c75c976d379b926e6bf63a9fc6a0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vultorch-0.3.1-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.12.3

File hashes

Hashes for vultorch-0.3.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 841d0b2926244133890d5fd4075b95f1873bc64951fb6e131d3a77016d373532
MD5 237983a15d43e89efbfa766bc2534004
BLAKE2b-256 ca934a9ecc32f32634f3425261d404ac976bb7a1d8755de05467be4018f1e6bf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vultorch-0.3.1-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.12.3

File hashes

Hashes for vultorch-0.3.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 7f779c12093dddb010edaab72495ab612d31886c5daa2d462db58d65b7f9b193
MD5 577e2b12ada4a498cd882fb98a29e1f1
BLAKE2b-256 3b9d374cd5270d30706a654c7907a537eb438fc24d18de0ed0e5745e1d316c70

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vultorch-0.3.1-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.12.3

File hashes

Hashes for vultorch-0.3.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 ec831642a18aaeaedceba6563b066e8c646f2e01b71c8479fb6055e03b19d6d8
MD5 dcef9a7e6d6922c9edc747364dedee52
BLAKE2b-256 d3ca55cdee62b57ee28c0ed54b32f5e4fc14ecf07852740ada85b0c249302fee

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vultorch-0.3.1-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.12.3

File hashes

Hashes for vultorch-0.3.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 56669f16584a1230b510b7777878abe24b5df3145650d92ade9091cc31c52acc
MD5 20593eea9cd08c1b06ae4be75f310e72
BLAKE2b-256 493d3c4dd23b418fb399e7200d0541b8c4a6aff2afd8db5313090a9033cfffae

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