Loading a separate binary in the plugin

17 views
Skip to first unread message

Aaron Boxer

unread,
Jun 11, 2020, 3:43:20 PM6/11/20
to ofx-discussion
Hello!
I am building an opencl-enabled plugin, and I would like to include the kernel binary in the .ofx
bundle and be able to access the binary from the plugin.
So, if I have MyPlugin.ofx.bundle, where should I put my MyPlugin.bin kernel binary?
Thanks,
Aaron

Paul Miller

unread,
Jun 11, 2020, 3:53:48 PM6/11/20
to ofx-dis...@googlegroups.com

I'd run it through a tool like xxd to turn it into a .c file you link with.


Thanks,
Aaron
--
You received this message because you are subscribed to the Google Groups "ofx-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ofx-discussio...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ofx-discussion/31e28c2d-15a3-4c7a-a69a-88005ae039a2o%40googlegroups.com.


PierreJasmin_REVisionEffects

unread,
Jun 11, 2020, 3:58:32 PM6/11/20
to ofx-discussion
Is this going to work across different vendors?

Pierre

Dithermaster

unread,
Jun 11, 2020, 3:59:07 PM6/11/20
to ofx-dis...@googlegroups.com
Shipping binary kernels can be problematic as there is no universal OpenCL program binary format that works on all platforms and drivers. But as Paul says, you could use xxd to make a .c file that you could link with. Or you can drop the .bin wherever you want in your bundle / folder structure. As long as it doesn't match the search rules for the plug-in binary, hosts will ignore it. Then your plug-in can open it from your known location.

///d@


Paul Miller

unread,
Jun 11, 2020, 4:02:24 PM6/11/20
to ofx-dis...@googlegroups.com
On 6/11/2020 2:58 PM, Dithermaster wrote:
Shipping binary kernels can be problematic as there is no universal OpenCL program binary format that works on all platforms and drivers. But as Paul says, you could use xxd to make a .c file that you could link with. Or you can drop the .bin wherever you want in your bundle / folder structure. As long as it doesn't match the search rules for the plug-in binary, hosts will ignore it. Then your plug-in can open it from your known location.

Oh, yeah - what Dennis said. Your binary won't work across all types of GPUs/drivers.

I usually compress my kernel source into a .zip and then embed that as source code using xxd.



///d@


On Thu, Jun 11, 2020 at 2:53 PM Paul Miller <ste...@gmail.com> wrote:
On 6/11/2020 2:43 PM, Aaron Boxer wrote:
Hello!
I am building an opencl-enabled plugin, and I would like to include the kernel binary in the .ofx
bundle and be able to access the binary from the plugin.
So, if I have MyPlugin.ofx.bundle, where should I put my MyPlugin.bin kernel binary?


I'd run it through a tool like xxd to turn it into a .c file you link with.


Thanks,
Aaron
--
You received this message because you are subscribed to the Google Groups "ofx-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ofx-discussio...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ofx-discussion/31e28c2d-15a3-4c7a-a69a-88005ae039a2o%40googlegroups.com.


--
You received this message because you are subscribed to the Google Groups "ofx-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ofx-discussio...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ofx-discussion/1720bfaa-6280-0898-57a6-d13ab24b46af%40gmail.com.
--
You received this message because you are subscribed to the Google Groups "ofx-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ofx-discussio...@googlegroups.com.

Aaron Boxer

unread,
Jun 11, 2020, 4:04:52 PM6/11/20
to ofx-discussion


On Thursday, June 11, 2020 at 3:53:48 PM UTC-4, Paul Miller wrote:
On 6/11/2020 2:43 PM, Aaron Boxer wrote:
Hello!
I am building an opencl-enabled plugin, and I would like to include the kernel binary in the .ofx
bundle and be able to access the binary from the plugin.
So, if I have MyPlugin.ofx.bundle, where should I put my MyPlugin.bin kernel binary?


I'd run it through a tool like xxd to turn it into a .c file you link with.


Thanks, that's an interesting idea. I need the binary to load into clBuildProgram when I need to run the kernel.

 

Thanks,
Aaron
--
You received this message because you are subscribed to the Google Groups "ofx-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ofx-dis...@googlegroups.com.

Aaron Boxer

unread,
Jun 11, 2020, 4:05:34 PM6/11/20
to ofx-discussion

On Thursday, June 11, 2020 at 3:58:32 PM UTC-4, PierreJasmin_REVisionEffects wrote:
Is this going to work across different vendors?

This is for one specific vendor.

Aaron Boxer

unread,
Jun 11, 2020, 4:07:15 PM6/11/20
to ofx-discussion


On Thursday, June 11, 2020 at 4:02:24 PM UTC-4, Paul Miller wrote:
On 6/11/2020 2:58 PM, Dithermaster wrote:
Shipping binary kernels can be problematic as there is no universal OpenCL program binary format that works on all platforms and drivers. But as Paul says, you could use xxd to make a .c file that you could link with. Or you can drop the .bin wherever you want in your bundle / folder structure. As long as it doesn't match the search rules for the plug-in binary, hosts will ignore it. Then your plug-in can open it from your known location.

Oh, yeah - what Dennis said. Your binary won't work across all types of GPUs/drivers.

I usually compress my kernel source into a .zip and then embed that as source code using xxd.


Yep, this will not be cross platform. With AMD, I've had good luck compiling into binary format, and
it's also possible to strip source code and IR.


 



///d@


On Thu, Jun 11, 2020 at 2:53 PM Paul Miller <ste...@gmail.com> wrote:
On 6/11/2020 2:43 PM, Aaron Boxer wrote:
Hello!
I am building an opencl-enabled plugin, and I would like to include the kernel binary in the .ofx
bundle and be able to access the binary from the plugin.
So, if I have MyPlugin.ofx.bundle, where should I put my MyPlugin.bin kernel binary?


I'd run it through a tool like xxd to turn it into a .c file you link with.


Thanks,
Aaron
--
You received this message because you are subscribed to the Google Groups "ofx-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ofx-dis...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "ofx-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ofx-dis...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "ofx-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ofx-dis...@googlegroups.com.

Aaron Boxer

unread,
Jun 11, 2020, 4:08:17 PM6/11/20
to ofx-discussion


On Thursday, June 11, 2020 at 3:59:07 PM UTC-4, Dennis Adams wrote:
Shipping binary kernels can be problematic as there is no universal OpenCL program binary format that works on all platforms and drivers. But as Paul says, you could use xxd to make a .c file that you could link with. Or you can drop the .bin wherever you want in your bundle / folder structure. As long as it doesn't match the search rules for the plug-in binary, hosts will ignore it. Then your plug-in can open it from your known location.

Thanks, I think this is the simplest approach, just drop it somewhere in the bundle.

 

///d@


On Thu, Jun 11, 2020 at 2:53 PM Paul Miller <ste...@gmail.com> wrote:
On 6/11/2020 2:43 PM, Aaron Boxer wrote:
Hello!
I am building an opencl-enabled plugin, and I would like to include the kernel binary in the .ofx
bundle and be able to access the binary from the plugin.
So, if I have MyPlugin.ofx.bundle, where should I put my MyPlugin.bin kernel binary?


I'd run it through a tool like xxd to turn it into a .c file you link with.


Thanks,
Aaron
--
You received this message because you are subscribed to the Google Groups "ofx-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ofx-dis...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "ofx-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ofx-dis...@googlegroups.com.

Aaron Boxer

unread,
Jun 11, 2020, 4:09:48 PM6/11/20
to ofx-discussion


On Thursday, June 11, 2020 at 4:08:17 PM UTC-4, Aaron Boxer wrote:


On Thursday, June 11, 2020 at 3:59:07 PM UTC-4, Dennis Adams wrote:
Shipping binary kernels can be problematic as there is no universal OpenCL program binary format that works on all platforms and drivers. But as Paul says, you could use xxd to make a .c file that you could link with. Or you can drop the .bin wherever you want in your bundle / folder structure. As long as it doesn't match the search rules for the plug-in binary, hosts will ignore it. Then your plug-in can open it from your known location.

Thanks, I think this is the simplest approach, just drop it somewhere in the bundle.

The issue is then getting the path right, because it will depend on the working binary of the program loading the plugin, I think.

Aaron Boxer

unread,
Jun 11, 2020, 4:10:26 PM6/11/20
to ofx-discussion


On Thursday, June 11, 2020 at 4:09:48 PM UTC-4, Aaron Boxer wrote:


On Thursday, June 11, 2020 at 4:08:17 PM UTC-4, Aaron Boxer wrote:


On Thursday, June 11, 2020 at 3:59:07 PM UTC-4, Dennis Adams wrote:
Shipping binary kernels can be problematic as there is no universal OpenCL program binary format that works on all platforms and drivers. But as Paul says, you could use xxd to make a .c file that you could link with. Or you can drop the .bin wherever you want in your bundle / folder structure. As long as it doesn't match the search rules for the plug-in binary, hosts will ignore it. Then your plug-in can open it from your known location.

Thanks, I think this is the simplest approach, just drop it somewhere in the bundle.

The issue is then getting the path right, because it will depend on the working binary of the program loading the plugin, I think.

s/working binary/ working directory/

Dithermaster

unread,
Jun 11, 2020, 4:31:26 PM6/11/20
to ofx-dis...@googlegroups.com
Ah, right, because it's a library and not an exe.
So Paul's idea is best, link to a xxd .c module.

To unsubscribe from this group and stop receiving emails from it, send an email to ofx-discussio...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ofx-discussion/865da030-8835-46bb-85b8-7c648b2f063co%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages