MAX/MSP Externals and CUDA

aps502's icon

Hi

I have written a multichannel audio convolution engine in CUDA that I would like to use in MAX.

I have the example MAX externals compiled and working but I'm unsure how to include CUDA functionality in an external.

Does anyone have any idea?

I'm on Win7 64bit VS 2012 professional.

Thanks
A.

dan b's icon

Did you get anywhere with this? I'm interested (speculatively at this stage) in including CUDA within MAX MSP externals.

skrasms's icon

Has anyone figured this out? I was just about to post a similar question. I can write/build/run simple Max externals, and I can write/build/run simple CUDA programs, but I don't really know where to begin in order to get Visual Studio working with CUDA code inside a Max external. I tried making a copy of simplemsp~ and telling Visual Studio that it's a CUDA project. That made Visual Studio attempt to build it with the CUDA compiler (nvcc), but that just returned a generic build error with no useful information.

It might be problematic that the simplemsp~ project is 32-bit, but CUDA only supports "Native x86_64" for the Windows compiler.

I am using Visual Studio 2015 Community, since that is the most recent free version of Visual Studio that the CUDA Toolkit supports. FYI: I tried VS 2015 Express first, but the CUDA Toolkit would not recognize it.

skrasms's icon

I was able to get CUDA working with the Max SDK. I have my graphics card processing realtime audio in Max now. In case anyone is interested, these were the steps that it took.

1. Right click the project in Visual Studio > Build Dependencies > Build Customizations...
If you have the CUDA Toolkit installed, there's an option here for CUDA. Check that box so that the CUDA compiler is used.

2. The CUDA compiler is 64-bit only, so change the active solution platform to x64 instead of the default x86. Cycling74 already has the x64 platform setup; you just need to select it. Also, you'll have to use the 64-bit version of Max.

3. Project Configuration Properties > Linker > Input > Additional Dependencies
Add cudart.lib here.

4. Project Configuration Properties > Linker > General > Additional Library Directories
Add $(CudaToolkitLibDir) here.

Pierre-Olivier Boulant's icon

Hi Skrams,
Do you have any way of testing audio processing on the GPU with CUDA? And especially the minimum latency?
I have a large delay matrix and each node with some simple 2-pole filters that I would like to offload to the GPU.
thanks