Community
cancel
Showing results for 
Search instead for 
Did you mean: 
556 Views

Myriad compute device not found when using inference engine over the opencv 3.4.3

Jump to solution

Issue:
When I try to use movidius neural compute stick over the openvino toolkit (which in turn is linked using opencv 3.4.3), i get the following exception:
Exception occured: OpenCV(3.4.3) ~/3rdparty/opencv/modules/dnn/src/op_inf_engine.cpp:500: error: (-215:Assertion failed) Failed to initialize Inference Engine backend: Can not init USB device: NC_DEVICE_NOT_FOUND in function 'initPlugin'

Functions Called:
...
cvDnn->setPreferableBackend(cv::dnn::DNN_BACKEND_INFERENCE_ENGINE);
cvDnn->setPreferableTarget(cv::dnn::DNN_TARGET_MYRIAD);
...
cvDnn->forward(...);

The following is the environment:
OS: Native Linux Installation - Ubuntu 16.04 Distro
Compiler: GCC 8.0
OpenCV: 3.4.3 along with USE_INF_ENGINE flag and OpenVINO dependency (OpenVINO is linked to our framework via the OpenCV 3.4.3)
OpenVINO version used: 2018R3
Neural network model used for the test: SSD (Single shot detection)

Things already done:
1. Tested the standalone installation of the movidius NCSDK SUCCESSFULLY.
2. Installed the USB Rules on the native ubuntu 1604 and loaded them.
3. lsusb detects the movidius stick successfully.
4. The framework builds successfully with the self built binaries of opencv3.4.3

The dependencies of the libopencv_dnn are as follows:
linux-vdso.so.1 (0x00007ffdfb1ee000)
libopencv_imgproc.so.3.4 => ~/3rdparty/opencv/desktop-x86_64-linux-gcc8/lib/release/./libopencv_imgproc.so.3.4 (0x00007fb21095f000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fb21075b000)
libinference_engine.so => ~/3rdparty/opencv/desktop-x86_64-linux-gcc8/lib/release/./libinference_engine.so (0x00007fb210387000)
libopencv_core.so.3.4 => ~/3rdparty/opencv/desktop-x86_64-linux-gcc8/lib/release/./libopencv_core.so.3.4 (0x00007fb20fe27000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fb20fa9e000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fb20f700000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fb20f4e8000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fb20f2c9000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fb20eed8000)
/lib64/ld-linux-x86-64.so.2 (0x00007fb211669000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fb20ecd0000)

The dependencies of libinference_engine are as follows:
linux-vdso.so.1 (0x00007fff640b3000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fcd82a13000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fcd8268a000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fcd822ec000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fcd820d4000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fcd81ce3000)
/lib64/ld-linux-x86-64.so.2 (0x00007fcd82feb000)

Question:
Am i missing out some preprocessing step for loading the model onto the neural stick?

0 Kudos
1 Solution
Severine_H_Intel
Employee
556 Views

Dear Siddhant, 

can you reproduce the issue with the OpenCV samples? You can find them in the directory of OpenCV, under samples\dnn. You can pick any of those. You can easily try the python examples and if you add the flag BUILD_EXAMPLES when compiling OpenCV, you can also have them as executable from C++ sample. 

I tried on Ubuntu the OpenCV python DNN objection detection sample and it worked with the Movidius stick. 

Best, 

Severine

View solution in original post

6 Replies
Severine_H_Intel
Employee
556 Views

Dear Siddhant, 

did you activate the environment variables? source /opt/intel/computer_vision_sdk/bin/setupvars.sh

Is it working with CPU or GPU also?

Best, 

Severine

Dmitry_K_Intel3
Employee
556 Views

Hi Siddhant!

OpenCV is a single process which uses NCS? From the documentation of Myriad plugin:

Single device cannot be shared across multiple processes.

Dmitry

556 Views

Habert, Severine (Intel) wrote:

Dear Siddhant, 

did you activate the environment variables? source /opt/intel/computer_vision_sdk/bin/setupvars.sh

Is it working with CPU or GPU also?

Best, 

Severine

 

Hello Severine, The env variables are activated and the function call works with CPU. Since we did not build OpenCV to use OpenCL kernels yet, the GPU is not tested. Its the Myriad device which is not getting initialized over the OpenCV call.

 

556 Views

Dmitry K. (Intel) wrote:

Hi Siddhant!

OpenCV is a single process which uses NCS? From the documentation of Myriad plugin:

Single device cannot be shared across multiple processes.

Dmitry

There is a single process running and there is a shared pointer to a single cv::dnn::net object which gets passed around. There is no new object created at any stage. This was verified with the shared_ptr_to_dnn.use_count().

Severine_H_Intel
Employee
557 Views

Dear Siddhant, 

can you reproduce the issue with the OpenCV samples? You can find them in the directory of OpenCV, under samples\dnn. You can pick any of those. You can easily try the python examples and if you add the flag BUILD_EXAMPLES when compiling OpenCV, you can also have them as executable from C++ sample. 

I tried on Ubuntu the OpenCV python DNN objection detection sample and it worked with the Movidius stick. 

Best, 

Severine

View solution in original post

556 Views

Hi Severine,

thanks for the reply and sorry for replying back so late.
Since it was made clear that the inferenceEngine backend of the OpenCV is optimisable using the model optimiser, we shall be dropping the use case where inference engine is used as the opencv backend and use the vino toolkit directly.

You can close this thread.

Bests,
Sid

Reply