Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6506 Discussions

mvncAllocateGraph() fails after some deallocs / allocs

idata
Employee
1,224 Views

I've been scratching my head over a problem deallocating and allocating graphs on the Movidius using the C API. I've written a simple wrapper in C++ basing it on the available examples, and for some reason I'm getting an error upon calling "mvncAllocateGraph()" some time after I've deallocated an earlier graph.

 

The code is here and it's pretty minimal: https://github.com/sirdifferential/minimal_movidius

 

The code can be compiled using g++ -std=c++11 -g -O0 movidiusdevice.cpp main.cpp -lcrypto -lmvnc -o minimal_movidius

 

The networks are here http://plantmonster.net/koodailut/movidius/network.zip (They are simply the Age and Gender caffe networks built with MVNCCompile)

 

The problem is the following:

 

     

  • The movidius is opened
  •  

  • Images are loaded from disk and get turned into 16bit floats
  •  

  • For a few calls, graphs are loaded, inference is run, and graphs are unloaded
  •  

  • Suddenly the graphs no longer get allocated successfully and mvncAllocateGraph() returns -2 (MVNC_ERROR). The documentation at https://github.com/movidius/ncsdk/blob/master/docs/c_api/mvncAllocateGraph.md doesn't specify what this error means in this case.
  •  

  • I've run valgrind on the code and get no errors at --leak-check=full
  •  

  • I've tried to debug my process memory between successful and failing requests. All the graph files are loaded successfully, the device struct is intact and I fail to find anything wrong in my data. I've even verified that the sha256 sum of the graph data in memory is valid.
  •  

 

I'm on Debian 8, although I'm seeing this also on Debian 9 as well as Ubilinux 4 (3 different computers, multiple movidius sticks).

 

Movidius SDK is the latest version (1.11).

 

This is a problem that essentially requires us to open and close the device over and over again, which solves the problem. This isn't ideal for a system that runs independently for a long time.

0 Kudos
3 Replies
idata
Employee
928 Views

As an update, I was just informed the C API is now open source and built a debug version. After some digging, the problem is the following:

 

In mvnc_api.c, in mvncAllocateGraph() at line 488 calls usblink_setdata(), which at line 152 of usb_link_vsc.c calls usb_read(), which goes to line 62 where libusb_bulk_transfer() returns LIBUSB_ERROR_NO_DEVICE.

0 Kudos
idata
Employee
928 Views

Never mind, I just found this: https://ncsforum.movidius.com/discussion/364/multiple-graph-allocations#latest

 

So deallocation doesn't work currently. I'll be waiting for an updated C API then.

0 Kudos
idata
Employee
928 Views

@gekko Unfortunately, there is a bug with the NCSDK at the moment. We're still working on enabling this feature for a future release. Thanks for your patience.

0 Kudos
Reply