Csound Csound-dev Csound-tekno Search About

[Csnd] Parallel processing using csound+OpenCL ?

Date2019-09-10 13:27
FromDariusPetermann
Subject[Csnd] Parallel processing using csound+OpenCL ?
Hello All,

I've recently started to look again at some of the work that has already
been done on the csound and parallel computing front. Looking at several
papers that have been published on the topic (i.e: "STREAMING SPECTRAL
PROCESSING WITH CONSUMER-LEVEL GRAPHICS PROCESSING UNITS", -
Lazzarini,ffitch,Timoney), it seems that they all mention the use of NVIDIA
environment/hardware. 

I am trying to stay away from NVIDIA's CUDA as much as I can for now as I
don't personally own an NVIDIA GPU and I'd like to make code that is as
portable as possible and doesn't necessarily rely on an external third-party
unit of some sort. I know that OpenCL is open-source and compatible with a
large range of GPU's (including mine: Intel UHD Graphics 630). 

I am seeing that csound 6.03 was introduced with some experimental OpenCL
opcodes for additive synthesis, but couldn't get my hands on them. Does
anyone know where to find them ? Additionally, if anyone has already done
some work on that front (and I am sure that there are some of you), any
advice, resource or documentation would be gladly welcome :)

Thank you all!
Darius





--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2019-09-10 13:35
FromVictor Lazzarini
SubjectRe: [Csnd] Parallel processing using csound+OpenCL ?
Ok, there’s code under Opcodes/opencl for phase vocoder additive synthesis (essentially a version
of pvsadsyn). It is added to CMake so if you have it setup for opencl build, it will build it.

There is also this latest work I am doing at the moment. 

https://github.com/vlazzarini/opencl_fft

========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 10 Sep 2019, at 13:27, DariusPetermann  wrote:
> 
> Hello All,
> 
> I've recently started to look again at some of the work that has already
> been done on the csound and parallel computing front. Looking at several
> papers that have been published on the topic (i.e: "STREAMING SPECTRAL
> PROCESSING WITH CONSUMER-LEVEL GRAPHICS PROCESSING UNITS", -
> Lazzarini,ffitch,Timoney), it seems that they all mention the use of NVIDIA
> environment/hardware. 
> 
> I am trying to stay away from NVIDIA's CUDA as much as I can for now as I
> don't personally own an NVIDIA GPU and I'd like to make code that is as
> portable as possible and doesn't necessarily rely on an external third-party
> unit of some sort. I know that OpenCL is open-source and compatible with a
> large range of GPU's (including mine: Intel UHD Graphics 630). 
> 
> I am seeing that csound 6.03 was introduced with some experimental OpenCL
> opcodes for additive synthesis, but couldn't get my hands on them. Does
> anyone know where to find them ? Additionally, if anyone has already done
> some work on that front (and I am sure that there are some of you), any
> advice, resource or documentation would be gladly welcome :)
> 
> Thank you all!
> Darius
> 
> 
> 
> 
> 
> --
> Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here


Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2019-09-11 13:25
FromDariusPetermann
SubjectRe: [Csnd] Parallel processing using csound+OpenCL ?
Great, thank you!

cladsynth works wonderfully! Two following questions on my end:
1. Is the /libclop1/ library supposed to build as part of CMake ? I found
myself having to manually run the shell script otherwise the openCL opcode
wouldn't be found. Prior to building I also made sure that the 
*BUILD_OPENCL_OPCODES* flag was set to ON in both
"/Custom-vs.cmake"/"CMakeLists.txt/", but that didn't seem to help.

2. While trying to add an OpenCL test opcode of my own and compile it as
part of the libclop library, I ran into duplicate symbols clashing with the
existing cladsynth ones.

Here's the modified shell script I ran: *gcc -O3 -dynamiclib -o
libclop1.dylib -DUSE_DOUBLE -D_FORTIFY_SOURCE=0 ocltest.c cladsynth.c
-I../../include -framework OpenCL*

Here's the duplicated symbols:

/duplicate symbol _csound_opcode_init in:
    /var/folders/j5/z_1g1qk95b99y2j7jtxkjl2c0000gn/T/ocltest-2fd3de.o
    /var/folders/j5/z_1g1qk95b99y2j7jtxkjl2c0000gn/T/cladsynth-91e0c7.o
duplicate symbol _csoundModuleInfo in:
    /var/folders/j5/z_1g1qk95b99y2j7jtxkjl2c0000gn/T/ocltest-2fd3de.o
    /var/folders/j5/z_1g1qk95b99y2j7jtxkjl2c0000gn/T/cladsynth-91e0c7.o
duplicate symbol _cl_error_string in:
    /var/folders/j5/z_1g1qk95b99y2j7jtxkjl2c0000gn/T/ocltest-2fd3de.o
    /var/folders/j5/z_1g1qk95b99y2j7jtxkjl2c0000gn/T/cladsynth-91e0c7.o
duplicate symbol _code in:
    /var/folders/j5/z_1g1qk95b99y2j7jtxkjl2c0000gn/T/ocltest-2fd3de.o
    /var/folders/j5/z_1g1qk95b99y2j7jtxkjl2c0000gn/T/cladsynth-91e0c7.o
ld: 4 duplicate symbols for architecture x86_64/

I'm a bit confused since all the method names in my test file differ from
the cladsynth ones. Any idea on what would be the problem here ? 

Thank you very much for sharing your latest work as well, this will come
extremely handy.

Best Regards,
Darius



--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here