Skip to main content

Real-time Torch visualization window with Vulkan zero-copy โ€” built for neural textures and GPU-intensive research

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


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
cmake --preset release-windows
cmake --build --preset release-windows

# Linux
cmake --preset release-linux
cmake --build --preset release-linux

The wheel appears in dist/. Install it:

pip install dist/vultorch-*.whl

Or use the convenience scripts:

# Windows
build.bat

# Linux / macOS
./build.sh

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.11Windows x86-64

vultorch-0.3.0-cp310-cp310-win_amd64.whl (8.0 MB view details)

Uploaded CPython 3.10Windows x86-64

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

Uploaded CPython 3.9Windows x86-64

vultorch-0.3.0-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.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: vultorch-0.3.0-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.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 acc70544fced0af63de40b5dbc7ddd7a572162ee75b2dc0be5d821d519aa7630
MD5 95a68c9baec0b31d9b4e51591859fdfd
BLAKE2b-256 2a5bddeebcc41776fc24968e8cf0d13ccae4653f99e16115e03d2f4a56dfd112

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vultorch-0.3.0-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.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 836e10eb5f3d43c6669dbf4bdee80e31637a7e7a0eaa2388baf5ac463749ddb8
MD5 307adccbd385d211e71de5af6c24fb12
BLAKE2b-256 a48fd6e4494f324d311690de0b10b6457b0319ccc05196fde72e80364e2fd475

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vultorch-0.3.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 8.0 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.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 d00730b77a4a0ce6070e14696cdbe49f33a7ba012230fafeccab83b4fdc4b2e9
MD5 016ed5ed807afb2e05cf046d332b2885
BLAKE2b-256 76069a11be5b82a53d67d77282e7380ffcc6da44acb7792e5f217b7cb617c3ac

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vultorch-0.3.0-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.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 6e3205c8913a4b53f723d08e2aee380de67420bbce0c2db60b659589a169f6b5
MD5 9885d247f8bff710d9b0f8ca6d52cf21
BLAKE2b-256 767017282ba083bb2f6141557440cfaf61bcef3f56e796ecaf39520ee4f56076

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vultorch-0.3.0-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.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 41670923bff6ba0447ca4ef3a9b8eb949744bacfbcfdf1398393b2b82b081777
MD5 b616d0eef3cc5c8075b40c87d0ce45bc
BLAKE2b-256 3769a0e52a7003edb5c9ac250879b8afbdf8cb536e31ed1d46519c372ef3e4bb

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