[Click] Need suggestions on integrating GPU computing into Click.

Weibin Sun wbsun at cs.utah.edu
Fri Jun 15 11:46:00 EDT 2012


Thanks Markku! Comments are inline below.

On Fri, Jun 15, 2012 at 2:34 AM, Markku Savela <Markku.Savela at vtt.fi> wrote:
> On 06/14/2012 07:01 PM, Weibin Sun wrote:
>> The current problem I've found is that GPU needs large number
>> of packets for acceleration, which may need some change to Element
>> interface to accept batched packets.
>
> I confess I'm not familiar about GPU interfaces. Can you access it
> directly in userspace?

Yes, you can access it directly in userspace. Recently, some work
(Gdev) enabled direct access from kernel space too. (I know this
sounds strange, but most GPU venders just provide userspace library
for GPU access on top of private kernel drivers release as blob).

> I don't think "batched packets" would help much, the Click push
> API is not that heavy. I would be more
> concerned about packet allocation overhead (packet pool use is
> a must) and achieving zero-copy on processing. So one possible
> approach would be to change the Click Packet optionally allocate
> the buffer data area directly from GPU's memory area?

Sure, use GPU memory for packet buffer would help a lot. But it is not
that easy, most of time you need a shadow in main memory as a
temporary buffer between NIC and GPU. There is a 'GPU-direct'
technology enables this. Though it is only available on very few NICs
and GPU, the Gdev work I mentioned above makes it available to more
general NICs and GPUs. In fact, your idea just helps me to figure out
something to do for GPU integration into Click: enable
'GPU-direct'-like functionality in Click to allow 'direct' memory copy
between NIC and GPU. THANK YOU!

> [I did some experiments with Octeon/Cavium processor, and used
> caviums FPA buffers directly as click payload store, whenever
> possible. The required patches to packet.cc can be viewed on
> github -- you would then need to write your own GPU alloc code.
>
> branch "octeon-experiment" at git://github.com/msa2/click.git
>
> Though, I've no idea whether same idea can be applied to GPU
> case...]

Oh, thank you for this! Then I may 'steal' your code :) This is
definitely similar to the GPU case, I can almost be sure your code
will help.

>
>
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>


More information about the click mailing list