Community
cancel
Showing results for 
Search instead for 
Did you mean: 
song__minghui
Beginner
437 Views

Cannot add cpu extension: libMKLDNNPlugin.so in Python ?

When I ran following python program:

# this folder include all extensions (.so), including: libcpu_extension_avx2.so, libMKLDNNPlugin.so and some others
plugin_dir = '/home/temp/intel/openvino/deployment_tools/inference_engine/lib/intel64'

plugin = IEPlugin(device=‘CPU', plugin_dirs=plugin_dir)

cpu_extension_path = '/home/temp/intel/openvino/deployment_tools/inference_engine/lib/intel64/libMKLDNNPlugin.so'

plugin.add_cpu_extension(cpu_extension_path)

 

An error happens:

RuntimeError: dlSym cannot locate method 'CreateExtension': /home/temp/intel/openvino/deployment_tools/inference_engine/lib/intel64/libMKLDNNPlugin.so: undefined symbol: CreateExtension

looks like the function CreateExtension is not included in libMKLDNNPlugin.so.  When I use libcpu_extension_avx2.so, no errors happend, and this function (CreateExtension) is exactly contained in libcpu_extension_avx2.so.

 

Any advise ? thanks in advance

0 Kudos
3 Replies
Shubha_R_Intel
Employee
437 Views

Dear song, minghui,

Looks like you solved your own problem. 

 

When I use libcpu_extension_avx2.so, no errors happend, and this function (CreateExtension) is exactly contained in libcpu_extension_avx2.so.

CPU extensions are in fact handled in a separate library as you've discovered. They are not part of MKLDNNPlugin.so.

Thanks,

Shubha

verma__Ashish
Beginner
437 Views

I am using latest OpenVino release 2020.2 in Linux .

I have separated out the code of face detector from interactive_face_detection_demo but when I am running the code,

I am getting this error-

terminate called after throwing an instance of 'InferenceEngine::details::InferenceEngineException'
  what():  dlSym cannot locate method 'CreateExtension': /opt/intel/openvino/deployment_tools/inference_engine/lib/intel64/libMKLDNNPlugin.so: undefined symbol: CreateExtension

while  adding the CPU extension

if ((deviceName.find("CPU") != std::string::npos))

{ // CPU(MKLDNN) extensions are loaded as a shared library and passed as a pointer to base extension

auto extension_ptr = make_so_pointer<IExtension>("/opt/intel/openvino/deployment_tools/inference_engine/lib/intel64/libMKLDNNPlugin.so");

// auto extension_ptr = make_so_pointer<IExtension>("/opt/intel/openvino/deployment_tools/inference_engine/lib/intel64/libcpu_extension_avx2.so"); ie.AddExtension(extension_ptr, "CPU");

// slog::info << "CPU Extension loaded: " << FLAGS_l << slog::endl;

}

libcpu_extension_avx2.so is not available in the latest release.

Can you tell me what I am doing wrong?

Regards

Ashish

JAIVIN_J_Intel
Employee
437 Views

Hi Ashish,

CPU extensions are moved to plugin since OpenVINO release 2020.1. The extensions are loaded automatically while loading the CPU plugin, hence 'AddExtension' need not be used.

Regards,

Jaivin

Reply