How to build cuda enabled plugin?

Answered

Comments

9 comments

  • Official comment
    Avatar
    Andrey Terentyev

    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.?

    Comment actions Permalink
  • Avatar
    Anubhav Rohatgi

    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
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    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.so

    0
    Comment actions Permalink
  • Avatar
    Anubhav Rohatgi

    is the cmake file appropriate. do you see any glitches. Also do have you experienced failures when initialising  cuda on jetson through nx.

    0
    Comment actions Permalink
  • 0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    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
    Comment actions Permalink
  • Avatar
    Anubhav Rohatgi

    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 :

    https://bitbucket.org/networkoptix/nx_open_integrations/src/default/cpp/vms_server_plugins/opencv_object_detection_analytics_plugin/step5/

    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
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    The further discussion has been moved to support ticket.

    The result will be posted here once problem is resolved.

    0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    Anubhav,

    Could you check your mailbox, please? There should be messages from the ticket system. Could you reply to them, please?

    0
    Comment actions Permalink

Please sign in to leave a comment.