Topic: CUDA or OpenCL engine

Hello,

I won Pianoteq while ago, and me & my girlfriend we are very happy with it. In meantime I am also computer science PhD student, lately we started making heavy use of CUDA GPU computing, which give us great performance boost and possibilities comparing to CPU.

I wonder if you guys have every tried, considered CUDA engine backend. CUDA is partially compatible with C and I believe it woulnd't be so hard to port your simulation & synthesis algorithms to CUDA, taking into consideration that you have them already done for multicore.

Having that average GPU has like 4x-10x more computing power of average CPU, such backend would give a great performance boost to Pianoteq, and since CUDA is available on most of the modern computer GPUs from nVIDIA, and OpenGL is also available for ATI this is great opportunity to have great polyphony on average laptop.

I am keen to help you guys too. Just drop me a PM if you're interested.

Best regards,
Adam

My life is... Image Reconstruction, Electronics, Synthesizers...

Re: CUDA or OpenCL engine

That might be interesting, but AFAIK the current implementation of CUDA is not yet viable for audio processing because of added latency? At least that's the case with currently available CUDA convolution reverb engines...

Also, if this is tackled with Pianoteq, I wouldn't really be concerned about polyphony. Max of 256 is perfectly fine for even the most elaborate work. I would rather concentrate on making the core sound calculating engine more complex, allowing more piano intricacies to be modelled to the most faithful degree (the attacks, "the woodiness", better soundboard, more complex resonances etc.).

Last edited by EvilDragon (21-10-2010 14:03)
Hard work and guts!

Re: CUDA or OpenCL engine

EvilDragon wrote:

That might be interesting, but AFAIK the current implementation of CUDA is not yet viable for audio processing because of added latency? At least that's the case with currently available CUDA convolution reverb engines...

I agree that the latency could be a problem. But here you're taking an effect as an example, in this case you need transfer audio samples to the GPU forth and back. In case of synthesis, you do not need to transfer anything to GPU except maybe few bytes about note pitch&velocity, but you need to transfer samples back to CPU and send it to the soundcard immediately. However since CUDA 2.2 there's zero-copy memory option, where you can write/read a pinned memory address back and forth and use the data for processing, at least it works for small chunks which is the case of the audio processing and in theory this should give you latency close to zero.

Few references about CUDA latency:
http://forums.nvidia.com/index.php?show...hl=latency
http://forums.nvidia.com/index.php?showtopic=92290

EvilDragon wrote:

Also, if this is tackled with Pianoteq, I wouldn't really be concerned about polyphony. Max of 256 is perfectly fine for even the most elaborate work. I would rather concentrate on making the core sound calculating engine more complex, allowing more piano intricacies to be modelled to the most faithful degree (the attacks, "the woodiness", better soundboard, more complex resonances etc.).

Take into consideration that 256 polyphony is only achievable on quite strong CPU configurations, which is not the case of laptops. Moreover high CPU usage makes fast battery drain. So moving processing to GPU can probably limit battery drain (if you work on battery), stop all fans running high speeds (extra noise) and finally make 256 polyphony available at entry level laptops/machines if only they run nVIDIA or ATI card.

Last edited by ono (21-10-2010 14:32)
My life is... Image Reconstruction, Electronics, Synthesizers...

Re: CUDA or OpenCL engine

Would be still cool to have a more detailed sound model by enabling CUDA processing, along with increasing poly.

Thanks for your input, I'll vote positively!

Last edited by EvilDragon (21-10-2010 14:36)
Hard work and guts!

Re: CUDA or OpenCL engine

I must ask: What is CUDA processing? It doesn't seem to be a programming language, from what I can gather.

Re: CUDA or OpenCL engine

Jake Johnson wrote:

I must ask: What is CUDA processing? It doesn't seem to be a programming language, from what I can gather.

Answering briefly, it is standard coming from nVIDIA for driving computing made on GPU (graphic card processor).

GPUs have slightly different architecture than regular CPU (central processor, usually coming from Intel or AMD). Modern GPUs are tens or hundreds floating point processing units that can do no more than floating point numbers calculations, while CPUs are just few cores made for general purpose such as device handling, floating point calculation but also integer calculation, operating system and process/application handling etc.

While single GPU processing unit is weaker in terms of performance than single CPU core, GPU units simply outnumber CPU cores so much so altogether they have much more computing power than CPU cores.
That's why for all algorithms or processes that can be divided into separate calculation chunks GPU computing seems to be good alternative. And IMHO this is the case of audio synthesis here in Pianoteq.

Last edited by ono (21-10-2010 15:50)
My life is... Image Reconstruction, Electronics, Synthesizers...

Re: CUDA or OpenCL engine

Well, would the user of a typical graphics card, or a user using a "card" built into the motherboard, benefit, or would a higher-end graphics card be needed?

Re: CUDA or OpenCL engine

You would need to have a CUDA-enabled graphics card (I think?), and I believe DirectX 10.2.

Last edited by EvilDragon (21-10-2010 18:03)
Hard work and guts!

Re: CUDA or OpenCL engine

This is potentially 'well cool!'

I for one would benefit from this way of programming pianoteq, if it works!

I'll vote positively.

Re: CUDA or OpenCL engine

Good idea! I also voted positively!

I'd like to point out, though, that I agree with EvilDragon that the main advantage of this would be the opportunity to use a more sophisticated model rather than the higher polyphony

Re: CUDA or OpenCL engine

Looks as though I already have a CUDA-enabled card, and didn't know it. Following the advice at this site -- http://www.nvidia.com/object/cuda_gpus.html -- I right-clicked on my desktop and found my CUDA control panel.

Re: CUDA or OpenCL engine

Then simply vote positively.

Hard work and guts!

Re: CUDA or OpenCL engine

I succumbed and voted yes, but not because of polyphony needs.

Still trying to understand, though: would using the video chip allow more complex calculations?

Re: CUDA or OpenCL engine

Yep. Because there are a lot more parallel computations done in a graphics chip than in CPU. Your CPU is 2, 4, 6-core. GPU is like a multi-million-core, with each core doing floating-point calculations on each pixel that gets displayed on the screen (for example, 1920x1200 resolution = 2304000!)

I presume this would greatly lift the heavy load that goes to main CPU, and yes, allow even more computations to be done in realtime. More computations = more precise model = better and more nuanced sound!

Hard work and guts!

Re: CUDA or OpenCL engine

I fear the fact the processor practically stoped to evolute.
Now they just put two, three or more processors.

This increase energy consume, and can't be compared to the old evolution we had, since it's now a arithmetic progression and not a geometric progression like before.

This is a obstacle to modelled instruments developments, since computer power evolution it's the key to modelled instruments get way better.
A 20 violins modelled instrument or a giant huge pipe organ, unfortunatelly have no estimation to appears soon, give the bad prognostic of computer power for the next years.

Last edited by Beto-Music (22-10-2010 18:31)

Re: CUDA or OpenCL engine

Beto-Music wrote:

A 20 violins modelled instrument or a giant huge pipe organ, unfortunatelly have no estimation to appears soon, give the bad prognostic of computer power for the next years.

You didn't hear that Wallander Instruments is secretly working on WIVI Strings?

Just so you know, currently WIVI wind instrument player can manage about a 100 separate players on a normal 2-2.5 GHz dualcore CPU! How's that for using the available CPU?


Also, CPUs don't really need to evolve much in terms of speed - speed is pretty much enough as it is now, the only evolution will be in parallelization (going for more and more processing cores). And actual software support from certain programs for multicores is weak! Majority of VST instruments use only single core, for example! It's not CPU's fault - it's the programmer's fault for not utilizing the available multicores correctly! Thankfully, Modartt does this!

Last edited by EvilDragon (22-10-2010 19:06)
Hard work and guts!

Re: CUDA or OpenCL engine

My laptop does 256 voices and it's just a 2.4Ghz Core 2 Duo.

Greg.

Re: CUDA or OpenCL engine

CPUs will still continue to evolve rapidly. However, the whole idea of putting a GPU in work aside from graphics is simply great!
You won't have an idle set of processing units waiting to shine only at the video tasks of your PC, instead you can utilize them to their full potential!

Re: CUDA or OpenCL engine

My question is:

How will be the evolution of processors (short run) besides the mult cores, if the material reached their limit ?


Evidragon, is this completely modelled, or sampled with modeling algorithms ?

Re: CUDA or OpenCL engine

Beto-Music wrote:

Evidragon, is this completely modelled, or sampled with modeling algorithms ?

For the most part it's additive synthesis which uses analyzed data from real recordings of the instruments (like Pianoteq in that regard) from what I reckon, so no samples included at all.

Hard work and guts!