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.

Debug Assertion Failed when loading the plugin

Daraen
Beginner
995 Views

Good morning,

I'm using OpenVINO on a project working with MFC.

My program worked in Debug mode fine before including any OpenVINO headers or libraries and now I want to load the plugin with the following line :

_plugin = InferenceEngine::PluginDispatcher().getPluginByDevice("CPU");

But when I run my program, this window comes to me :

.

 

Anyone can help me ?

 

Thank you.

0 Kudos
9 Replies
Shubha_R_Intel
Employee
995 Views

Dear Daraen,

Please see my answer to your previous question:

https://software.intel.com/en-us/forums/computer-vision/topic/808641

Both in this question and the previous, the errors are stemming from Visual Studio internals, not OpenVino. Your OpenVino app is definitely causing these exceptions but there is no way to really state what is going on just based on the screen output you posted. You must debug the code (step through Inference Engine source code) to figure out why. 

Thanks,

Shubha

0 Kudos
Daraen
Beginner
995 Views

Hello,

I moved point to point in Debug mode to find where the issue is.

I found this (ie_plugin_dispatcher.hpp file, the "if" line give the issue) :

InferenceEnginePluginPtr getSuitablePlugin(TargetDevice device) const {
        FindPluginResponse result;
        ResponseDesc desc;
        if (InferenceEngine::OK != findPlugin({ device }, result, &desc)) {
            THROW_IE_EXCEPTION << desc.msg;
        }

        std::stringstream err;
        for (std::string& name : result.names) {
            try {
                return getPluginByName(stringToFileName(name));
            }
            catch (const std::exception &ex) {
                err << "Tried load plugin : " << name << ",  error: " << ex.what() << "\n";
            }
        }
        THROW_IE_EXCEPTION << "Cannot find plugin to use :" << err.str() << "\n";
    }

 

I can't go further, even with F11 key.

Do you have an idea to explain this ?

Thank you.

0 Kudos
Shubha_R_Intel
Employee
995 Views

Dear Daraen,

Go to file inference_engine\include\ie_plugin_dispatcher.hpp and put a breakpoint here:

switch (req.device) {

Or you can sprinkle cout statements throughout and figure out what's going on (of course you must add #include <iostream> for that) and recompile IE.

 if (InferenceEngine::OK != findPlugin({ device }, result, &desc)) {

          THROW_IE_EXCEPTION << desc.msg;

        }

The above is pretty obvious. It's not finding your plugins.

Start from your app. Do you have code like this in your main.cpp ?

 slog::info << "Loading plugin" << slog::endl;
        InferencePlugin plugin = PluginDispatcher({ FLAGS_pp }).getPluginByDevice(FLAGS_d);
        if (FLAGS_p_msg) {
            static_cast<InferenceEngine::InferenceEnginePluginPtr>(plugin)->SetLogCallback(error_listener);
        }
 

Lastly, I should have mentioned this before, sorry that I didn't. There is no setupvars.bat in dldt. So if you run the samples from within dldt, you should not do that (run setupvars.bat from the non-dldt version of OpenVino). My advice to you is to put your app in the same folder as all the other dldt samples, here https://github.com/opencv/dldt/tree/2019/inference-engine/samples

Create a new folder for your app but put it under samples (give it a unique name) and recompile.

You should be debugging that sample and stepping through the code.

Hope it helps,

Shubha

0 Kudos
stone__jesse
Beginner
995 Views

//ref. https://docs.openvinotoolkit.org/latest/_docs_IE_DG_inference_engine_intro.html
//and do this OK

InferenceEnginePluginPtr getSuitablePlugin(TargetDevice device) const
    {
        /*FindPluginResponse result;
        ResponseDesc desc;
        if (InferenceEngine::OK != findPlugin({ device }, result, &desc))
        {
            THROW_IE_EXCEPTION << desc.msg;
        }

        std::stringstream err;
        for (std::string& name : result.names)
        {
            try
            {
                return getPluginByName(stringToFileName(name));
            }
            catch (const std::exception &ex)
            {
                err << "Tried load plugin : " << name << ",  error: " << ex.what() << "\n";
            }
        }
        THROW_IE_EXCEPTION << "Cannot find plugin to use :" << err.str() << "\n";*/

        //by stone
        std::stringstream    err;
        std::string            name;
        switch(device)
        {
            case TargetDevice::eCPU:
                name = "MKLDNNPlugin";
                break;
            case TargetDevice::eGPU:
                name = "clDNNPlugin";
                break;
            case TargetDevice::eMYRIAD:
                name = "myriadPlugin";
                break;
            default:
                name = "MKLDNNPlugin";
                break;
        }

#if defined(_DEBUG)
        name += "d";
#endif
        try
        {
            return getPluginByName(stringToFileName(name));
        }
        catch (const std::exception &ex)
        {
            err << "Tried load plugin : " << name << ",  error: " << ex.what() << "\n";
        }
    }

0 Kudos
stone__jesse
Beginner
995 Views

/////////////////////////////////////////modify as this
InferenceEnginePluginPtr getSuitablePlugin(TargetDevice device) const
    {
        FindPluginResponse result;
        ResponseDesc desc;
        FindPluginRequest req;
        req.device = device;
        if (InferenceEngine::OK != findPlugin(req, result, &desc))
        {
            THROW_IE_EXCEPTION << desc.msg;
        }

        /*std::stringstream err;
        for (std::string& name : result.names)
        {
            try
            {
                return getPluginByName(stringToFileName(name));
            }
            catch (const std::exception &ex)
            {
                err << "Tried load plugin : " << name << ",  error: " << ex.what() << "\n";
            }
        }
        THROW_IE_EXCEPTION << "Cannot find plugin to use :" << err.str() << "\n";*/

        //by stone
        std::stringstream    err;
        std::string            name;
        switch(device)
        {
            case TargetDevice::eCPU:
                name = "MKLDNNPlugin";
                break;
            case TargetDevice::eGPU:
                name = "clDNNPlugin";
                break;
            case TargetDevice::eMYRIAD:
                name = "myriadPlugin";
                break;
            default:
                name = "MKLDNNPlugin";
                break;
        }

#if defined(_DEBUG)
        name += "d";
#endif
        try
        {
            return getPluginByName(stringToFileName(name));
        }
        catch (const std::exception &ex)
        {
            err << "Tried load plugin : " << name << ",  error: " << ex.what() << "\n";
        }
    }

////////////////////////////////////////////inference_engined.dll source c++
#include <ie_device.hpp> #include <details/ie_exception.hpp> #include "description_buffer.hpp" using namespace InferenceEngine; FindPluginResponse InferenceEngine::findPlugin(const FindPluginRequest& req) { switch (req.device) { case TargetDevice::eCPU: return { { #ifdef ENABLE_MKL_DNN "MKLDNNPlugin", #endif #ifdef ENABLE_OPENVX_CVE "OpenVXPluginCVE", #elif defined ENABLE_OPENVX "OpenVXPlugin", #endif } }; case TargetDevice::eGPU: return { { #ifdef ENABLE_CLDNN "clDNNPlugin", #endif #ifdef ENABLE_OPENVX "OpenVXPlugin", #endif } }; case TargetDevice::eFPGA: return{ { #ifdef ENABLE_DLIA "dliaPlugin", #endif #ifdef ENABLE_OPENVX "OpenVXPlugin", #endif } }; case TargetDevice::eMYRIAD: return{ { #ifdef ENABLE_MYRIAD "myriadPlugin", #endif } }; case TargetDevice::eGNA: return{ { #ifdef ENABLE_GNA "GNAPlugin", #endif } }; case TargetDevice::eHETERO: return{ { "HeteroPlugin", } }; default: THROW_IE_EXCEPTION << "Cannot find plugin for device: " << getDeviceName(req.device); } } INFERENCE_ENGINE_API(StatusCode) InferenceEngine::findPlugin( const FindPluginRequest& req, FindPluginResponse& result, ResponseDesc* resp) noexcept { try { result = findPlugin(req); } catch (const std::exception& e) { return DescriptionBuffer(GENERAL_ERROR, resp) << e.what(); } return OK; }

////////////////////////////////////inference_engine.dll  release version asm
.text:00000001800E3A00 ; __unwind { // __CxxFrameHandler3
.text:00000001800E3A00                 push    rbp
.text:00000001800E3A01                 sub     rsp, 0F0h
.text:00000001800E3A08                 lea     rbp, [rsp+20h]
.text:00000001800E3A0D                 mov     [rbp+0D0h+var_10], rbx
.text:00000001800E3A14                 mov     rbx, rdx
.text:00000001800E3A17                 mov     [rbp+0D0h+arg_10], r8
.text:00000001800E3A1E                 mov     rdx, rcx
.text:00000001800E3A21                 mov     [rbp+0D0h+var_18], 0FFFFFFFFFFFFFFFEh
.text:00000001800E3A2C
.text:00000001800E3A2C loc_1800E3A2C:                          ; DATA XREF: .rdata:00000001805D069C↓o
.text:00000001800E3A2C ;   try {
.text:00000001800E3A2C                 lea     rcx, [rbp+0D0h+var_30]
.text:00000001800E3A33                 call    sub_1800E3D10
.text:00000001800E3A38                 lea     rax, [rbp+0D0h+var_30]
.text:00000001800E3A3F                 cmp     rbx, rax
.text:00000001800E3A42                 jnz     loc_1800E3B00
.text:00000001800E3A48                 mov     rbx, [rbp+0D0h+var_30]
.text:00000001800E3A4F                 test    rbx, rbx
.text:00000001800E3A52                 jz      loc_1800E3BCE
.text:00000001800E3A58                 mov     rax, [rbp+0D0h+var_28]
.text:00000001800E3A5F                 cmp     rbx, rax
.text:00000001800E3A62                 jz      short loc_1800E3AA6
.text:00000001800E3A62 ;   } // starts at 1800E3A2C
.text:00000001800E3A62 ; } // starts at 1800E3A00

////////////////////////////////////inference_engined.dll  debug version asm
.text:00000001805D3E66 ; __unwind { // __CxxFrameHandler3
.text:00000001805D3E66                 push    rbp
.text:00000001805D3E67                 sub     rsp, 150h
.text:00000001805D3E6E                 lea     rbp, [rsp+20h]
.text:00000001805D3E73                 mov     [rsp+150h+var_150], rax
.text:00000001805D3E77                 mov     rax, 14Ch
.text:00000001805D3E7E
.text:00000001805D3E7E loc_1805D3E7E:                          ; CODE XREF: findPlugin_0+27↓j
.text:00000001805D3E7E                 mov     dword ptr [rsp+rax+150h+var_150], 0CCCCCCCCh
.text:00000001805D3E85                 sub     rax, 4
.text:00000001805D3E89                 cmp     rax, 4
.text:00000001805D3E8D                 jg      short loc_1805D3E7E
.text:00000001805D3E8F                 mov     rax, [rsp+150h+var_150]
.text:00000001805D3E93                 mov     dword ptr [rsp+150h+var_150], 0CCCCCCCCh
.text:00000001805D3E9A                 mov     dword ptr [rsp+150h+var_150+4], 0CCCCCCCCh
.text:00000001805D3EA2                 mov     [rbp+130h+arg_0], rcx
.text:00000001805D3EA9                 mov     [rbp+130h+arg_8], rdx
.text:00000001805D3EB0                 mov     [rbp+130h+arg_10], r8
.text:00000001805D3EB7                 mov     [rbp+130h+var_100], 0FFFFFFFFFFFFFFFEh
.text:00000001805D3EBF
.text:00000001805D3EBF loc_1805D3EBF:                          ; DATA XREF: .rdata:00000001812250C4↓o
.text:00000001805D3EBF ;   try {
.text:00000001805D3EBF                 lea     rax, [rbp+130h+var_F8]
.text:00000001805D3EC3                 mov     rdx, [rbp+130h+arg_0]
.text:00000001805D3ECA                 mov     rcx, rax
.text:00000001805D3ECD                 call    sub_18001B4FA
.text:00000001805D3ED2                 jmp     short loc_1805D3F01
.text:00000001805D3ED4 ; ---------------------------------------------------------------------------
.text:00000001805D3ED4
.text:00000001805D3ED4 loc_1805D3ED4:                          ; CODE XREF: findPlugin_0+9F↓j
.text:00000001805D3ED4                 mov     rax, [rbp+130h+var_D8]
.text:00000001805D3ED8                 mov     [rbp+130h+var_D0], rax
.text:00000001805D3EDC                 mov     rax, [rbp+130h+arg_8]
.text:00000001805D3EE3                 lea     rdx, [rbp+130h+var_F8]
.text:00000001805D3EE7                 mov     rcx, rax
.text:00000001805D3EEA                 call    sub_180009C6E
.text:00000001805D3EEF                 mov     [rbp+130h+var_C8], rax
.text:00000001805D3EF3                 lea     rax, [rbp+130h+var_F8]
.text:00000001805D3EF7                 mov     rcx, rax
.text:00000001805D3EFA                 call    sub_18000EBB5                //---------------------->crash here
.text:00000001805D3EFF                 jmp     short loc_1805D3F2B
.text:00000001805D3F01 ; ---------------------------------------------------------------------------
.text:00000001805D3F01
.text:00000001805D3F01 loc_1805D3F01:                          ; CODE XREF: findPlugin_0+6C↑j
.text:00000001805D3F01                 mov     [rbp+130h+var_D8], rax
.text:00000001805D3F05                 jmp     short loc_1805D3ED4
.text:00000001805D3F05 ;   } // starts at 1805D3EBF
.text:00000001805D3F07 ; ---------------------------------------------------------------------------
.text:00000001805D3F07
.text:00000001805D3F07 loc_1805D3F07:                          ; CODE XREF: findPlugin_0+270↓j
.text:00000001805D3F07                                         ; DATA XREF: findPlugin_0+261↓o ...
.text:00000001805D3F07                 mov     eax, [rbp+130h+var_10C]
.text:00000001805D3F0A                 mov     [rbp+130h+var_108], eax
.text:00000001805D3F0D                 lea     rax, unk_181084F48
.text:00000001805D3F14                 mov     rdx, rax
.text:00000001805D3F17                 mov     rcx, rbp
.text:00000001805D3F1A                 call    sub_180035D46
.text:00000001805D3F1F                 mov     eax, [rbp+130h+var_108]
.text:00000001805D3F22                 lea     rsp, [rbp+130h]
.text:00000001805D3F29                 pop     rbp
.text:00000001805D3F2A                 retn
.text:00000001805D3F2B ; ---------------------------------------------------------------------------
.text:00000001805D3F2B
.text:00000001805D3F2B loc_1805D3F2B:                          ; CODE XREF: findPlugin_0+99↑j
.text:00000001805D3F2B                 mov     eax, 0
.text:00000001805D3F30                 mov     [rbp+130h+var_104], eax
.text:00000001805D3F33                 lea     rax, unk_181084F48
.text:00000001805D3F3A                 mov     rdx, rax
.text:00000001805D3F3D                 mov     rcx, rbp
.text:00000001805D3F40                 call    sub_180035D46
.text:00000001805D3F45                 mov     eax, [rbp+130h+var_104]
.text:00000001805D3F48                 lea     rsp, [rbp+130h]
.text:00000001805D3F4F                 pop     rbp
.text:00000001805D3F50                 retn
.text:00000001805D3F50 ; } // starts at 1805D3E66
.text:00000001805D3F51 ; ---------------------------------------------------------------------------
.text:00000001805D3F51
.text:00000001805D3F51 loc_1805D3F51:                          ; DATA XREF: .rdata:0000000181084FB8↓o
.text:00000001805D3F51                                         ; .pdata:0000000181439244↓o ...
.text:00000001805D3F51 ;   cleanup() // owned by 1805D4024
.text:00000001805D3F51                 push    rbp
.text:00000001805D3F52                 sub     rsp, 150h
.text:00000001805D3F59                 lea     rbp, [rdx+20h]
.text:00000001805D3F5D                 mov     [rsp+0], rax
.text:00000001805D3F61                 mov     rax, 14Ch
.text:00000001805D3F68
.text:00000001805D3F68 loc_1805D3F68:                          ; CODE XREF: findPlugin_0+111↓j
.text:00000001805D3F68                 mov     dword ptr [rsp+rax+0], 0CCCCCCCCh
.text:00000001805D3F6F                 sub     rax, 4
.text:00000001805D3F73                 cmp     rax, 4
.text:00000001805D3F77                 jg      short loc_1805D3F68
.text:00000001805D3F79                 mov     rax, [rsp+0]
.text:00000001805D3F7D                 mov     dword ptr [rsp+0], 0CCCCCCCCh
.text:00000001805D3F84                 mov     dword ptr [rsp+4], 0CCCCCCCCh
.text:00000001805D3F8C                 mov     [rsp+2A8h+var_148], rcx
.text:00000001805D3F94                 mov     [rsp+2A8h+var_140], rdx
.text:00000001805D3F9C                 lea     rax, [rbp+130h+var_C0]
.text:00000001805D3FA0                 mov     rcx, rax
.text:00000001805D3FA3                 call    sub_18001D5CA
.text:00000001805D3FA8                 add     rsp, 150h
.text:00000001805D3FAF                 pop     rbp
.text:00000001805D3FB0                 retn

0 Kudos
stone__jesse
Beginner
995 Views

/////////////////////////////////////////modify as this
InferenceEnginePluginPtr getSuitablePlugin(TargetDevice device) const
    {
        FindPluginResponse result;
        ResponseDesc desc;
        FindPluginRequest req;
        req.device = device;
        if (InferenceEngine::OK != findPlugin(req, result, &desc))
        {
            THROW_IE_EXCEPTION << desc.msg;
        }

        /*std::stringstream err;
        for (std::string& name : result.names)
        {
            try
            {
                return getPluginByName(stringToFileName(name));
            }
            catch (const std::exception &ex)
            {
                err << "Tried load plugin : " << name << ",  error: " << ex.what() << "\n";
            }
        }
        THROW_IE_EXCEPTION << "Cannot find plugin to use :" << err.str() << "\n";*/

        //by stone
        std::stringstream    err;
        std::string            name;
        switch(device)
        {
            case TargetDevice::eCPU:
                name = "MKLDNNPlugin";
                break;
            case TargetDevice::eGPU:
                name = "clDNNPlugin";
                break;
            case TargetDevice::eMYRIAD:
                name = "myriadPlugin";
                break;
            default:
                name = "MKLDNNPlugin";
                break;
        }

#if defined(_DEBUG)
        name += "d";
#endif
        try
        {
            return getPluginByName(stringToFileName(name));
        }
        catch (const std::exception &ex)
        {
            err << "Tried load plugin : " << name << ",  error: " << ex.what() << "\n";
        }
    }

////////////////////////////////////////////inference_engined.dll source c++
https://github.com/opencv/dldt/blob/2019/inference-engine/src/inference_engine/ie_device.cpp


////////////////////////////////////inference_engine.dll  release version asm
.text:00000001800E3A00 ; __unwind { // __CxxFrameHandler3
.text:00000001800E3A00                 push    rbp
.text:00000001800E3A01                 sub     rsp, 0F0h
.text:00000001800E3A08                 lea     rbp, [rsp+20h]
.text:00000001800E3A0D                 mov     [rbp+0D0h+var_10], rbx
.text:00000001800E3A14                 mov     rbx, rdx
.text:00000001800E3A17                 mov     [rbp+0D0h+arg_10], r8
.text:00000001800E3A1E                 mov     rdx, rcx
.text:00000001800E3A21                 mov     [rbp+0D0h+var_18], 0FFFFFFFFFFFFFFFEh
.text:00000001800E3A2C
.text:00000001800E3A2C loc_1800E3A2C:                          ; DATA XREF: .rdata:00000001805D069C↓o
.text:00000001800E3A2C ;   try {
.text:00000001800E3A2C                 lea     rcx, [rbp+0D0h+var_30]
.text:00000001800E3A33                 call    sub_1800E3D10
.text:00000001800E3A38                 lea     rax, [rbp+0D0h+var_30]
.text:00000001800E3A3F                 cmp     rbx, rax
.text:00000001800E3A42                 jnz     loc_1800E3B00
.text:00000001800E3A48                 mov     rbx, [rbp+0D0h+var_30]
.text:00000001800E3A4F                 test    rbx, rbx
.text:00000001800E3A52                 jz      loc_1800E3BCE
.text:00000001800E3A58                 mov     rax, [rbp+0D0h+var_28]
.text:00000001800E3A5F                 cmp     rbx, rax
.text:00000001800E3A62                 jz      short loc_1800E3AA6
.text:00000001800E3A62 ;   } // starts at 1800E3A2C
.text:00000001800E3A62 ; } // starts at 1800E3A00

////////////////////////////////////inference_engined.dll  debug version asm
.text:00000001805D3E66 ; __unwind { // __CxxFrameHandler3
.text:00000001805D3E66                 push    rbp
.text:00000001805D3E67                 sub     rsp, 150h
.text:00000001805D3E6E                 lea     rbp, [rsp+20h]
.text:00000001805D3E73                 mov     [rsp+150h+var_150], rax
.text:00000001805D3E77                 mov     rax, 14Ch
.text:00000001805D3E7E
.text:00000001805D3E7E loc_1805D3E7E:                          ; CODE XREF: findPlugin_0+27↓j
.text:00000001805D3E7E                 mov     dword ptr [rsp+rax+150h+var_150], 0CCCCCCCCh
.text:00000001805D3E85                 sub     rax, 4
.text:00000001805D3E89                 cmp     rax, 4
.text:00000001805D3E8D                 jg      short loc_1805D3E7E
.text:00000001805D3E8F                 mov     rax, [rsp+150h+var_150]
.text:00000001805D3E93                 mov     dword ptr [rsp+150h+var_150], 0CCCCCCCCh
.text:00000001805D3E9A                 mov     dword ptr [rsp+150h+var_150+4], 0CCCCCCCCh
.text:00000001805D3EA2                 mov     [rbp+130h+arg_0], rcx
.text:00000001805D3EA9                 mov     [rbp+130h+arg_8], rdx
.text:00000001805D3EB0                 mov     [rbp+130h+arg_10], r8
.text:00000001805D3EB7                 mov     [rbp+130h+var_100], 0FFFFFFFFFFFFFFFEh
.text:00000001805D3EBF
.text:00000001805D3EBF loc_1805D3EBF:                          ; DATA XREF: .rdata:00000001812250C4↓o
.text:00000001805D3EBF ;   try {
.text:00000001805D3EBF                 lea     rax, [rbp+130h+var_F8]
.text:00000001805D3EC3                 mov     rdx, [rbp+130h+arg_0]
.text:00000001805D3ECA                 mov     rcx, rax
.text:00000001805D3ECD                 call    sub_18001B4FA
.text:00000001805D3ED2                 jmp     short loc_1805D3F01
.text:00000001805D3ED4 ; ---------------------------------------------------------------------------
.text:00000001805D3ED4
.text:00000001805D3ED4 loc_1805D3ED4:                          ; CODE XREF: findPlugin_0+9F↓j
.text:00000001805D3ED4                 mov     rax, [rbp+130h+var_D8]
.text:00000001805D3ED8                 mov     [rbp+130h+var_D0], rax
.text:00000001805D3EDC                 mov     rax, [rbp+130h+arg_8]
.text:00000001805D3EE3                 lea     rdx, [rbp+130h+var_F8]
.text:00000001805D3EE7                 mov     rcx, rax
.text:00000001805D3EEA                 call    sub_180009C6E
.text:00000001805D3EEF                 mov     [rbp+130h+var_C8], rax
.text:00000001805D3EF3                 lea     rax, [rbp+130h+var_F8]
.text:00000001805D3EF7                 mov     rcx, rax
.text:00000001805D3EFA                 call    sub_18000EBB5                //---------------------->crash here
.text:00000001805D3EFF                 jmp     short loc_1805D3F2B
.text:00000001805D3F01 ; ---------------------------------------------------------------------------
.text:00000001805D3F01
.text:00000001805D3F01 loc_1805D3F01:                          ; CODE XREF: findPlugin_0+6C↑j
.text:00000001805D3F01                 mov     [rbp+130h+var_D8], rax
.text:00000001805D3F05                 jmp     short loc_1805D3ED4
.text:00000001805D3F05 ;   } // starts at 1805D3EBF
.text:00000001805D3F07 ; ---------------------------------------------------------------------------
.text:00000001805D3F07
.text:00000001805D3F07 loc_1805D3F07:                          ; CODE XREF: findPlugin_0+270↓j
.text:00000001805D3F07                                         ; DATA XREF: findPlugin_0+261↓o ...
.text:00000001805D3F07                 mov     eax, [rbp+130h+var_10C]
.text:00000001805D3F0A                 mov     [rbp+130h+var_108], eax
.text:00000001805D3F0D                 lea     rax, unk_181084F48
.text:00000001805D3F14                 mov     rdx, rax
.text:00000001805D3F17                 mov     rcx, rbp
.text:00000001805D3F1A                 call    sub_180035D46
.text:00000001805D3F1F                 mov     eax, [rbp+130h+var_108]
.text:00000001805D3F22                 lea     rsp, [rbp+130h]
.text:00000001805D3F29                 pop     rbp
.text:00000001805D3F2A                 retn
.text:00000001805D3F2B ; ---------------------------------------------------------------------------
.text:00000001805D3F2B
.text:00000001805D3F2B loc_1805D3F2B:                          ; CODE XREF: findPlugin_0+99↑j
.text:00000001805D3F2B                 mov     eax, 0
.text:00000001805D3F30                 mov     [rbp+130h+var_104], eax
.text:00000001805D3F33                 lea     rax, unk_181084F48
.text:00000001805D3F3A                 mov     rdx, rax
.text:00000001805D3F3D                 mov     rcx, rbp
.text:00000001805D3F40                 call    sub_180035D46
.text:00000001805D3F45                 mov     eax, [rbp+130h+var_104]
.text:00000001805D3F48                 lea     rsp, [rbp+130h]
.text:00000001805D3F4F                 pop     rbp
.text:00000001805D3F50                 retn
.text:00000001805D3F50 ; } // starts at 1805D3E66
.text:00000001805D3F51 ; ---------------------------------------------------------------------------
.text:00000001805D3F51
.text:00000001805D3F51 loc_1805D3F51:                          ; DATA XREF: .rdata:0000000181084FB8↓o
.text:00000001805D3F51                                         ; .pdata:0000000181439244↓o ...
.text:00000001805D3F51 ;   cleanup() // owned by 1805D4024
.text:00000001805D3F51                 push    rbp
.text:00000001805D3F52                 sub     rsp, 150h
.text:00000001805D3F59                 lea     rbp, [rdx+20h]
.text:00000001805D3F5D                 mov     [rsp+0], rax
.text:00000001805D3F61                 mov     rax, 14Ch
.text:00000001805D3F68
.text:00000001805D3F68 loc_1805D3F68:                          ; CODE XREF: findPlugin_0+111↓j
.text:00000001805D3F68                 mov     dword ptr [rsp+rax+0], 0CCCCCCCCh
.text:00000001805D3F6F                 sub     rax, 4
.text:00000001805D3F73                 cmp     rax, 4
.text:00000001805D3F77                 jg      short loc_1805D3F68
.text:00000001805D3F79                 mov     rax, [rsp+0]
.text:00000001805D3F7D                 mov     dword ptr [rsp+0], 0CCCCCCCCh
.text:00000001805D3F84                 mov     dword ptr [rsp+4], 0CCCCCCCCh
.text:00000001805D3F8C                 mov     [rsp+2A8h+var_148], rcx
.text:00000001805D3F94                 mov     [rsp+2A8h+var_140], rdx
.text:00000001805D3F9C                 lea     rax, [rbp+130h+var_C0]
.text:00000001805D3FA0                 mov     rcx, rax
.text:00000001805D3FA3                 call    sub_18001D5CA
.text:00000001805D3FA8                 add     rsp, 150h
.text:00000001805D3FAF                 pop     rbp
.text:00000001805D3FB0                 retn

0 Kudos
stone__jesse
Beginner
995 Views

InferenceEnginePluginPtr getSuitablePlugin(TargetDevice device) const
    {
        FindPluginResponse    result;
        ResponseDesc        desc;
        
        /*if (InferenceEngine::OK != findPlugin({ device }, result, &desc))
        {
            THROW_IE_EXCEPTION << desc.msg;
        }*/
        
        //this fixed for debug assert
        std::vector<std::string>    pluginVec;
        FindPluginRequest            req = { device };
        switch (req.device)
        {
            case TargetDevice::eCPU:
                pluginVec.push_back("MKLDNNPlugin");
                break;
            case TargetDevice::eGPU:
                pluginVec.push_back("clDNNPlugin");
                break;
            case TargetDevice::eFPGA:
                pluginVec.push_back("dliaPlugin");
                break;
            case TargetDevice::eMYRIAD:
                pluginVec.push_back("myriadPlugin");
                break;
            case TargetDevice::eGNA:
                pluginVec.push_back("GNAPlugin");
                break;
            case TargetDevice::eHETERO:
                pluginVec.push_back("HeteroPlugin");
                break;
            default:
                THROW_IE_EXCEPTION << "Cannot find plugin for device";
                break;
        }

#ifdef _DEBUG        
        std::for_each(pluginVec.begin(), pluginVec.end(), [](std::string &name) {name += "d"; });
#endif
        result = { pluginVec };

        std::stringstream err;
        for (std::string& name : result.names)
        {
            try
            {
                return getPluginByName(stringToFileName(name));
            }
            catch (const std::exception &ex)
            {
                err << "Tried load plugin : " << name << ",  error: " << ex.what() << "\n";
            }
        }
        THROW_IE_EXCEPTION << "Cannot find plugin to use :" << err.str() << "\n";
    }

0 Kudos
Shubha_R_Intel
Employee
995 Views

Dear stone, jesse,

I have provided an answer to a very similar question on the dldt github dldt github issue 194

Thanks,

Shubha

 

0 Kudos
stone__jesse
Beginner
995 Views

I modify this and build in vs2015
debug and release all ok~~~
http://www.mediafire.com/file/2m1ungbb86rgi46/OpenVINO_2019.1.148.rar/file

 

0 Kudos
Reply