[GPU Computing] Particle Systems with OpenCL and CUDA

OpenCL logo

“OpenCL was very straightforward to get started with. I coded as I read the spec, and it worked almost immediately.”
– John Carmack –

So true. It’s a pity AMD doesn’t want to officialize the OpenCL support in Catalyst…

1 – Adventures in OpenCL Part 2: Particles with OpenGL

Here is a article that takls about GL interop: the ability for OpenCL to directly update OpenGL buffers. And the author uses the example of a particle system to show how things work.

Read the complete article here: Adventures in OpenCL Part 2: Particles with OpenGL.

OpenCL / OpenGL particle system

2 – CUDA Accelerated Particle Engine in OpenGL – 12 Million Particles

This is a particle engine I wrote using OpenGL and CUDA to update the particles. You can download it and try it out yourself here:
(You need an NVIDIA graphics card, 8 series or newer)
or download the source code and check it out here:
(It’s fairly well documented, hopefully you can figure it out)
My goal was 750,001 particles, I am running over 12 million here.
The song is Tri-State – Above and Beyond

Certainly cool to see millions particles moving at 40FPS but I have a GTX 460 (main card) and a GT 240 (aux card) and this demo selects the weakest one: the GT 240. Result: 6 FPS… 🙁

Update (2010.08.30)

CUDA device selection in NVCPL
Selection of the GTX 460 as main CUDA device

CUDA Particle System
Around 41FPS on the GTX 460


2 thoughts on “[GPU Computing] Particle Systems with OpenCL and CUDA”

  1. Stefem

    Dude, you can select the preferred CUDA device from the NVIDIA control panel from 256 driver release 🙂

    39 fps on GTX 260 c216

Comments are closed.