Piping data to the GPU

[Old posts from the commercial version of ArrayFire] Discussion of ArrayFire using CUDA or OpenCL.

Moderator: pavanky

Piping data to the GPU

Postby melonakos » Mon Apr 11, 2011 4:33 pm

One Jacket programmer recently asked:

I'm interested in using Jacket for real-time processing of video data with a possible large-scale deployment down the road. I'm using a PCIe-1429 frame grabber from National Instruments. I'm wondering if there is a super-efficient way for me to move data from the frame buffer of the grabber (which is located inside the system memory) and out to the GPU. My preliminary measurements show that loading the data onto the GPU takes nearly as long as the processing itself.

There are two ways to get memory from your NI board to the GPU/Jacket.

1) Use the standard MATLAB mechanisms to get the data into MATLAB. Use Jacket's casting commands (e.g. GDOUBLE, GSINGLE, etc) to move the memory to the GPU. This is slower than #2.

2) Avoid loading the data initially into MATLAB. Instead, use the Jacket SDK to move memory directly from system memory to the GPU/Jacket. Once it is on the GPU/Jacket, the reference pointer to that memory automatically becomes available in MATLAB and all of Jacket's functions are available to process that data.

There is a nice blog post describing #2, http://blog.accelereyes.com/blog/2010/02/01/streaming-data-to-the-gpu/

John Melonakos (john@arrayfire.com)
User avatar
Posts: 503
Joined: Tue Jun 10, 2008 9:49 am

Return to [archive-commercial] Programming & Development with ArrayFire