second-state / WasmEdge-WASINN-examples

Apache License 2.0
217 stars 33 forks source link

Error on running example openvino-road-segmentation-adas #134

Open nerdola-de-cartola opened 1 week ago

nerdola-de-cartola commented 1 week ago

I'm running WSL2 on Ubuntu 22

I have dowloaded openvino with the folowwing comands

wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
echo "deb https://apt.repos.intel.com/openvino/2023 ubuntu20 main" | sudo tee /etc/apt/sources.list.d/intel-openvino-2023.list
sudo apt update
sudo apt-get -y install openvino
sudo ldconfig

Instaled wasedge with

curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- --plugins wasi_nn-openvino

Compiled the example code with

cd openvino-road-seg-adas
cargo build --target wasm32-wasi --release

And tried to run with

wasmedge --dir .:. ./openvino-road-seg-adas/target/wasm32-wasi/release/openvino-road-seg-adas.wasm ./model/road-segmentation-adas-0001.xml ./model/road-segmentation-adas-0001.bin ./image/empty_road_mapillary.jpg

But got the following erros

[2024-04-24 16:43:56.046] [error] loading failed: invalid path, Code: 0x20
[2024-04-24 16:43:56.046] [error]     load library failed:libopenvino_c.so.2302: cannot open shared object file: No such file or directory
[2024-04-24 16:43:56.046] [error] loading failed: invalid path, Code: 0x20
[2024-04-24 16:43:56.046] [error]     load library failed:libopenvino_c.so.2302: cannot open shared object file: No such file or directory
[2024-04-24 16:43:56.077] [error] WASI-NN plugin not installed. Please install the plugin and restart WasmEdge.
Error: BackendError(InvalidArgument)
Load graph ...

Seams that the problem is my openvimo installation or my wasmedge plug-in. There any way to check this components?

hydai commented 1 week ago

What's the version of your OpenVINO? The pre-built assets are using OpenVINO-2302. If you are using other versions, please build from source.

nerdola-de-cartola commented 1 week ago

I have manged to compile OpenVINO-2302 from souce, but how can I link this build to my wasmedge runtime?

hydai commented 1 week ago

It uses dynamic linking. So you can put the OpenVINO library in a folder that can be searched in the system path, or you can use LD_LIBRARY_PATH to set it.

nerdola-de-cartola commented 4 days ago

Thanks. After compiling the version 2023.0.2 and adding the openvino/bin folder to my LD_LIBRARY_PATH. Everything works fine. But it seams that in my case this demo is not making use of my GPU, is there any info about what types of gpu it can use or not?. btw I tested on an integrated gpu from Intel, maybe that's the problem?

hydai commented 4 days ago

You may need to check the OpenVINO to know how to use the GPU part. I am not familiar with OpenVINO. However, you only need to replace the CPU version library with GPU version library when using PyTorch.