It’s complicated… It should be possible, but the CUDA api is so weird for this, that we haven’t really integrated it well yet, since it would take a considerable amount of work.
This is the last example we tried:
using CUDA, GLMakie, NVTX
using GLMakie.GLAbstraction
# from https://discourse.julialang.org/t/cuarray-glmakie/52461/11?u=maleadt
function cu_plot(; T=Float32, N=1024, resolution=(800, 600))
t = CUDA.rand(T, N)
X = CUDA.rand(T, N)
# so that we can create a GLBuffer before having rendered anything.
fig = Figure(; resolution)
ax = Axis(fig[1, 1]; limits=(0, 1, 0, 1))
screen = display(fig)
# get a buffer object and register it with CUDA
buffer = GLAbstraction.GLBuffer(Point2f, N)
resource = let
ref = Ref{CUDA.CUgraphicsResource}()
CUDA.cuGraphicsGLRegisterBuffer(ref, buffer.id,
CUDA.CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD)
ref[]
This file has been truncated. show original
2 Likes