cuda-python icon indicating copy to clipboard operation
cuda-python copied to clipboard

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

Open jakirkham opened this issue 1 year ago • 4 comments

A common use case is to do some computation on the GPU and then render the result in a display ( https://github.com/cupy/cupy/issues/5711 ) ( https://github.com/vispy/vispy/issues/1985 ) ( https://github.com/vispy/vispy/issues/1986 ) ( https://github.com/napari/napari/issues/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 ( https://github.com/vispy/vispy/pull/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)

jakirkham avatar Nov 13 '24 22:11 jakirkham