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.
6403 Discussions

What is the proper way to detect OpenVino devices (particularly CPU and VPU) in 2019 in Linux and in Windows?

om77
New Contributor I
1,036 Views

Hi Intel team,

In OpenVino 2018 we used mkldnn_engine_create/mkldnn_engine_destroy APIs of libMKLDNNPlugin.so to check Intel CPU presence and ncDeviceCreate/ncDeviceDestroy API of libmyriadPlugin.so to check VPU devices presence.

In OpenVino 2019 these APIs are missing for outside usage.

So What is the proper way now to detect OpenVino devices (particularly CPU and VPU) in 2019 in Linux and in Windows?

P.S. The API CreatePluginEngine of e.g. libmyriadPlugin.so can't be used actually for this purpose. It's always ok, even if there is no VPU attached to USB.

0 Kudos
3 Replies
Shubha_R_Intel
Employee
1,036 Views

Dear om77:

Please study this code :

https://github.com/opencv/dldt/blob/2019/inference-engine/src/cldnn_engine/cldnn_engine.cpp

In particular, look at the code snippet below:

ExecutableNetworkInternal::Ptr clDNNEngine::LoadExeNetworkImpl(InferenceEngine::ICNNNetwork &network,
                                                               const std::map<std::string, std::string> &config) {
    auto specifiedDevice = network.getTargetDevice();
    auto supportedDevice = InferenceEngine::TargetDevice::eGPU;
    if (specifiedDevice != InferenceEngine::TargetDevice::eDefault && specifiedDevice != supportedDevice) {
        THROW_IE_EXCEPTION << "The plugin doesn't support target device: " << getDeviceName(specifiedDevice) << ".\n" <<
                           "Supported target device: " << getDeviceName(supportedDevice);
    }

 

If specifiedDevice doesn't have the correct device, then the device is not found.

Hope it helps !

Thanks for using OpenVino !

Shubha

0 Kudos
om77
New Contributor I
1,036 Views

Hi Shubha,

thank you for reply!

I can't check your solution for GPU mode actually since can't change this hardware on my laptop :)

For GPU mode we perform sanity check through libOpenCL.so (API clGetPlatformInfo, clGetPlatformIDs) and checking e.g. vendor "intel".

 

I tried your approach for VPU (Myriad) and it's not working so far. Looks like something other should be done.

For VPU mode actually my target here is to remove these lines from runtime log:

/teamcity/work/scoring_engine_build/releases_2018_R5/src/vpu/myriad_plugin/myriad_executor.cpp:191
/home/..../openvino_2018.5.445/include/details/ie_exception_conversion.hpp:71 

in the case of unplugged Myriad.

The lines above are part of std::exception x.what() which is triggered during LoadNetwork in the case of missing VPU (Myriad).

The full description of exception includes "Can not init USB device: NC_DEVICE_NOT_FOUND" before.

So again to be short :)

How the missing VPU device can be checked before LoadNetwork in 2019 with libmyriadPlugin.so?

Thanks.

0 Kudos
Shubha_R_Intel
Employee
1,036 Views

Dearest om77,

The API improvement discussions are going on as we speak. But in the meantime, you can try this (check response of LoadNetwork):

https://docs.openvinotoolkit.org/latest/classInferenceEngine_1_1InferencePlugin.html

If LoadNetwork fails, then that's a good indicator that your device is not being detected. LoadNetwork will give an error.

Hope it helps,

Shubha

0 Kudos
Reply