Skip to content

Sharing buffers with display renderers (like OpenGL, Vulkan, etc.) #241

Description

@jakirkham

A common use case is to do some computation on the GPU and then render the result in a display ( cupy/cupy#5711 ) ( vispy/vispy#1985 ) ( vispy/vispy#1986 ) ( napari/napari#2243 ). This could be an image that is shown or a plot or something else. Given the registration/unregistration and mapping/unmappaing of memory, this can generate quite a bit of boilerplate in Python ( vispy/vispy#2391 ), which in turn hinders adoption. Ideally some standard objections/functions could be supplied (ideally in CUDA Python) that users could leverage to prep data for rendering. Preferably they could use one function call to covert any __cuda_array_interface__, __dlpack__, etc. supporting object into one that can be used for rendering (and hang onto the lifetimes of any supporting buffers via RAII-style semantics)

Activity

  1. added
    triageNeeds the team's attention
    featureNew feature or request
    cuda.coreEverything related to the cuda.core module
    on Nov 15, 2024
  2. added this to the cuda.core parking lot milestone on Apr 23, 2025
  3. leofang commented on Sep 10, 2025

    @leofang
    Member

    Adding @rparolin to evaluate how the APIs would look like to make comptue-graphics interop easy and performant

  4. rparolin commented on Sep 16, 2025

    @rparolin
    Collaborator

    @leofang : Is there a use case that we are looking to enable that can help focus the conversation? Is there a graphics API that the majority of the community is using? For example, pygame? opengl?

  5. leofang commented on Sep 18, 2025

    @leofang
    Member

    I think OpenGL should be the primary target. John has linked to various discussions and works in the issue description that some of us contributed to in the past few years, which should be good starting points especially those involving CuPy <-> vispy inter-op.

  6. jakirkham commented on Jan 10, 2026

    @jakirkham
    Author

    My understanding is users would like an object that represents a GL buffer (analogous to StridedMemoryView) and has RAII style behavior so cleanup happens during Python GC

    Having a function to facilitate that conversion (StridedMemoryView to GLStridedMemoryView?) would also help

    This comment captures this: vispy/vispy#1986 (comment)

  7. mohawk2 commented on Mar 21, 2026

    @mohawk2

    Just adding this to cross-link onto the DLPack issue I opened: dmlc/dlpack#183

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

cuda.coreEverything related to the cuda.core modulefeatureNew feature or request

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions