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.3-cp312-cp312-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.10Windows x86-64

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

Uploaded CPython 3.9Windows x86-64

vultorch-0.3.3-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.3-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: vultorch-0.3.3-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.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c4b19c69acfc4558e14f658e9005bb757350c662bf1e959146149666b1140b1e
MD5 a7a9cbc71ac777e6b11ca762c2279c64
BLAKE2b-256 28453d013f0abd2744f0106a56b13a5a32d8143163559d68123474aab0b5088f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vultorch-0.3.3-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.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 84e438fc5fdf7dae404264808b9c515ab67c64fa60cdb060a24e6783d77e9f30
MD5 6fb69984d9a93fd9c962fb51a7025f8a
BLAKE2b-256 8036fc694d8afeab77af4c7e326b804e3d155b725dff21e512d5a3957c355e1e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vultorch-0.3.3-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.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 51e8cab46f4e2d24d4d9214adfa499f5864933d463595f613c4e115398bf4bbf
MD5 0a2b2a0ed7f63c19276cc53a1dd771a3
BLAKE2b-256 c5d0118e6c4597b66f8c6811cb06d49bb7b813c458f737b8c2be2c2b10a29655

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vultorch-0.3.3-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.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 1f15cc85e7074204717e775692de9a2d8d90f0bfba06e5dd9b28214f458f54df
MD5 4beba9e3efc468ac96b4d0c4029342b4
BLAKE2b-256 15c214559ef158ae933659a8ce688fdfd4235208bc595a20c5ac50345ef36639

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vultorch-0.3.3-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.3-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 ac8957f6cb6bd0c3b5ad71dda024a3c6a20372735ef96e3aa6f18c0ed90064e7
MD5 eb0b2687c5ace3ed6b98da2469e4c1e6
BLAKE2b-256 1821545c230f84dc9c05dcd77dfac764b8e6ed184ae48fd5050753ac03b15ea9

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