# OpenGL rendering with CUDA

**URL:** <https://discourse.julialang.org/t/opengl-rendering-with-cuda/82063>\
**Category:** GPU\
**Tags:** gpu, cuda, visualization\
**Created:** [June 1, 2022, 4:34pm UTC](https://discourse.julialang.org/t/opengl-rendering-with-cuda/82063 "2022-06-01T16:34:30Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![sjkelly](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sjkelly/32/9280_2.png) [@sjkelly](https://discourse.julialang.org/u/sjkelly)\
**Post date:** [June 1, 2022, 4:58pm UTC](https://discourse.julialang.org/t/opengl-rendering-with-cuda/82063/2 "2022-06-01T16:58:26Z")

</div>

There is a small example here that may be of help:

> [@CuArray + GLMakie](https://discourse.julialang.org/t/cuarray-glmakie/52461/10):
>
> Turns out there was some “scalar indexing” going on, where individual elements of the GPU buffers were being copied to the CPU for processing. By using GLBuffer{Point2f} directly, and using low-level APIs that avoid some of the automatic processing (e.g. center! inspects data to determine limits, lines! does a map to detect invalid vertices) I have a working example that keeps all data on the GPU: function plot(; T=Float32, N=1024, resolution=(800,600)) t = CUDA.rand(T, N) X = CUDA.rand…

This uses GLMakie which is built upon GLFW.

---

_[View the full topic](https://discourse.julialang.org/t/opengl-rendering-with-cuda/82063)._
