How to build cuda enabled plugin?
AnsweredI have integrated darknet.so for analytics. I have made necessary changes to the cmake as below
(rest is same as in the example stub plugin)

Compilation is smooth, but when I run vms with this build then I get
WARNING nx::vms::server::analytics::SdkObjectFactory(0x7fc3f408c5e0): Unable to find an SDK plugin object. Plugin name: AI plugin, plugin Id ({49b257b8-5e33-036b-1019-8c783bababf7})
Though the plugin used to run without cuda support and darknet using simple opencv stuff.
Any help would be appreciated
-
Official comment
Hello Anubhav,
I am a kind of confused and did understand quite well what's wrong.
So, let's move step by step.
1. What is the title (name) of your plugin? What is resulting binary file name of your plugin? darknet.so?
2. What is libdark.so? What is darknet.so?
3. Did the server load the your plugin successfully?
4. Please, describe what is the real issue: plugin is not loaded; is loaded but does not work as expected etc.?
-
Hi Andrey,
1. Title of the plugin. Plugin filename all are ai_plugin and libai_plugin.so respectively.
2. Darket.so is the third party binary shared object built from darknet which is a cuda enabled library. This is integrated with the nx plugin.3. If i remove cuda stuff, the nx plugin works. But as soon as i compile with cuda dependencies. It builds but doesn't work with the nx.
4.plugin is not loaded.
0 -
Hi Anubhav,
The recommended place of storing third party libraries your plugin is using on the server is the same directory your plugin binary resides.
If your plugin name is "ai_plugin" create a directory "ai_plugin" in ...mediaserver/bin/plugins/
Place there your plugin binary along with third party libraries. In your case the "ai_plugin" directory should contains
libai_plugin.so
libdark.so0 -
is the cmake file appropriate. do you see any glitches. Also do have you experienced failures when initialising cuda on jetson through nx.
0 -
https://support.networkoptix.com/hc/en-us/articles/360023931393-10-Development-Tools-Tips
Sorry the link is
https://docs.google.com/document/d/1iA9JHkHEaWJyXauxZbXA6hEZf7lzli9h1vsGk_LfFn4/edit?ts=5b45131e
Also,this link doesnt allow me to access it. Any idea what it talks about.
0 -
I checked the link to the article. No restrictions in permissions. Is accessible.
Have you tried to save file in one directory?
Could you describe in step by step manner what is the problem at the moment, please?
What do your try to do? What does not work as you expect it to work?
0 -
I have a library that uses CUDA for implementing Neural Network for Object Detection. The library is called Darknet, hosted at:
https://github.com/AlexeyAB/darknet
I have compiled the library and used as a shared object in the current NX plugin an example of the plugin is hosted by NX at :
I have successfully replaced the object detection and now trying to utilise the power of CUDA by calling the detector from the plugin. But I realise that the code compiles successfully but fails to load the plugin when the plugin is placed in the right position from where it gets called usually without the CUDA stuff.
Plugin location : /opt/networkoptix-metavms/mediaserver/bin/plugins
The the shared object file libdark.so is located at /usr/local/lib which I believe is accessible from the metavms path as I have created a symbolic link to the directory, as I know all the other stuff which is already at /usr/local/lib is also accessible.
In other words, lets say I have a CUDA shared object, library how can I create the right CMAKE what commands to use to make things right. Am I linking the library correctly.
0 -
The further discussion has been moved to support ticket.
The result will be posted here once problem is resolved.
0 -
Could you check your mailbox, please? There should be messages from the ticket system. Could you reply to them, please?
0 -
Was there a final solution to this issue?
0
Please sign in to leave a comment.
Comments
10 comments