Particles without the display

Hi all, hope this isn’t too obvious, I’ve only just started with CUDA programming…

What I’d like to do is take the particles example from the CUDA SDK, and remove the display code, so I can execute it over SSH. I tried the obvious (just removed the code that creates the window and initialised GL etc), but it just crashed when trying to create the VBO arrays (Vertex Buffer Objects) during initialisation.

So my questions are: in order to use VBOs, does GL need to be fully initialised? Are the VBOs just there so that the display code can access the data, or do you need to use them to copy into CUDA global memory? Is there another way of getting the data onto the card without using the GL functions so that it can be accessed as a texture array?

The reason why I’m asking, is the machine with the GPU is shared, and I would like to be able to write/compile/execute the code remotely over SSH without needing to physically be at the machine.

Any help appreciated.



Disclaimer: I’m not familiar with the particles example, but: Yep, no prob. Assuming that it’s a 2D texture, you simply use a cudaArray and bind that to a texture. Then you cudaMemcpy into it from normal device memory. (You can of course copy from host memory if you need to.)

There are some example projects that use textures & cudaArrays. IIRC, I learned a lot from the texture convolution sample.

the particles example use linear array you can simply bind your pos and sortedpos arrays to 1D texture.

You just need to replace the VBO allocations with cudaMallocs.

Thanks everyone, I will try your suggestions.