[Asterisk-Dev] GPU backending for codecs

Nick Bachmann asterisk at not-real.org
Thu Jan 20 12:11:25 MST 2005


Steve Kann wrote:

> Holger Schurig wrote:
>
>> I also know that on SF.NET there is a project of a hardware-gnostic 
>> GPU programming language with compiler towards various GPUs, but I 
>> forgot the name.
>
> That would be libsh, which Nick mentioned already :)

:-)

> I think that there still probably needs to be some research done to 
> see how much this might help; i.e. is there going to be a lot of 
> latency or overhead in moving data to/from the GPU, and making things 
> happen?
>
> One characteristic of what we're trying to do here is that, for 
> translators, we're performing lots of operations (encode/decode) on 
> very small data sets;  

> So, in most cases, the encode operation might be:
>
> 1) copy 20ms of PCM audio to GPU-accessible memory (unless it can 
> access main memory?)
> 2) Call the GPU routines.
> 3) The GPU does the encoding.
> 4) Wait for the GPU to complete.
> 5) copy back the encoded 20ms data.
>
> As opposed to the Primary CPU equivalent:
> C1) The CPU does the encoding.

But consider: what do GPUs do in their normal operation? Basically the 
same thing... except they make triangles instead of audio data.  They 
have to process the video data quickly (in fact, probably faster...) and 
still have to deal with the same memory issues.  However, as a dedicated 
processor they don't really have to deal with interrupts, context 
shifts, or any of that other stuff while being highly optimized for 
doing certain calculations.

> This needs to be done 50 times/sec/call...

Yes.  That is one of my concerns... how many cps can the GPU handle... 
these are the questions I was hoping an expert could answer.

> So, while (3) might be much faster than C1, 1+2+3+4+5 might not..
>
> Of course, there may be ways to alleviate this, like coding many calls 
> together or something, to exploit the GPU parallelism, etc, but 
> there's still a real possibility that this might not be a win at all..
>
> Certainly an interesting research project, though.

Like I said, I'm still looking for an expert who could help assess 
feasibility... :)

Nick



More information about the asterisk-dev mailing list