Skip to main content

Efficiently Render Torch Tensors Directly from CUDA to GPU Without CPU Copy

Project description

Buy Me A Coffee Twitter Twitter

cudacanvas

CudaCanvas: High Performance real-time PyTorch Tensor Visualisation in CUDA Eliminating CPU Transfer

import torch
import cudacanvas

noise_image = torch.rand((4, 500, 500), device="cuda")

cudacanvas.set_image(noise_image)
cudacanvas.create_window()

#replace this with you training loop
while (True):

    cudacanvas.render()

    if cudacanvas.should_close():
        #end process if the window is closed
        break

CudaCanvas is a simple Python module that eliminates CPU transfer for Pytorch tensors for displaying and rendering images in the training or evaluation phase, ideal for machine learning scientists and engineers.

Installation

Before instllation make sure you have torch with cuda support already installed on your machine

Identify your current torch and cuda version, cudacanvas currently only supports torch 2.1.2 and cuda (11.8 or 12.1)

import torch
torch.__version__

If you are running torch 2.1.2 with Cuda 12.1 (2.1.2+cu121) you can download it straight from pypi by running

pip install cudacanvas

If you are running torch 2.1.2 with Cuda 11.8 (2.1.2+cu118) you can run this script

pip install cudacanvas --find-links https://github.com/OutofAi/cudacanvas/wiki/cu118

or manaully download the latest wheel releases from https://github.com/OutofAi/cudacanvas

Support

Also support my channel ☕ ☕ : https://www.buymeacoffee.com/outofai

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

cudacanvas-1.0.0-cp310-cp310-win_amd64.whl (95.2 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

cudacanvas-1.0.0-cp310-cp310-manylinux2014_x86_64.whl (79.5 kB view hashes)

Uploaded CPython 3.10

cudacanvas-1.0.0-cp39-cp39-win_amd64.whl (97.2 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

cudacanvas-1.0.0-cp39-cp39-manylinux2014_x86_64.whl (79.0 kB view hashes)

Uploaded CPython 3.9

cudacanvas-1.0.0-cp38-cp38-win_amd64.whl (97.6 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

cudacanvas-1.0.0-cp38-cp38-manylinux2014_x86_64.whl (2.9 MB view hashes)

Uploaded CPython 3.8

Supported by

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