WasmEdge / WasmEdge

WasmEdge is a lightweight, high-performance, and extensible WebAssembly runtime for cloud native, edge, and decentralized applications. It powers serverless apps, embedded functions, microservices, smart contracts, and IoT devices.

Home Page:https://WasmEdge.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bug: Can't install Rust TLS plugin on Mac OS

alabulei1 opened this issue · comments

Summary

Using the following command line to install Rust TLS plugin and ggml plugin.

curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- --plugins wasmedge_rustls wasi_nn-ggml
source /home/azureuser/.bashrc

Then, I use wasmedge -v to check out if installed successfully. I received the following errors.

wasmedge -v
[2024-02-22 14:42:51.914] [error] loading failed: invalid path, Code: 0x20
[2024-02-22 14:42:51.914] [error]     load library failed:dlopen(/Users/alabulei/.wasmedge/lib/../plugin/._libwasmedge_rustls.dylib, 0x0005): tried: '/Users/alabulei/.wasmedge/lib/._libwasmedge_rustls.dylib' (no such file), '/Users/alabulei/.wasmedge/lib/../plugin/._libwasmedge_rustls.dylib' (not a mach-o file), '/System/Volumes/Preboot/Cryptexes/OS/Users/alabulei/.wasmedge/lib/../plugin/._libwasmedge_rustls.dylib' (no such file), '/Users/alabulei/.wasmedge/lib/../plugin/._libwasmedge_rustls.dylib' (not a mach-o file), '/Users/alabulei/.wasmedge/lib/._libwasmedge_rustls.dylib' (no such file), '/Users/alabulei/.wasmedge/plugin/._libwasmedge_rustls.dylib' (not a mach-o file), '/System/Volumes/Preboot/Cryptexes/OS/Users/alabulei/.wasmedge/plugin/._libwasmedge_rustls.dylib' (no such file), '/Users/alabulei/.wasmedge/plugin/._libwasmedge_rustls.dylib' (not a mach-o file)
[2024-02-22 14:42:51.915] [error] loading failed: invalid path, Code: 0x20
[2024-02-22 14:42:51.915] [error]     load library failed:dlopen(/Users/alabulei/.wasmedge/lib/../plugin/._libwasmedge_rustls.dylib, 0x0005): tried: '/Users/alabulei/.wasmedge/lib/._libwasmedge_rustls.dylib' (no such file), '/Users/alabulei/.wasmedge/lib/../plugin/._libwasmedge_rustls.dylib' (not a mach-o file), '/System/Volumes/Preboot/Cryptexes/OS/Users/alabulei/.wasmedge/lib/../plugin/._libwasmedge_rustls.dylib' (no such file), '/Users/alabulei/.wasmedge/lib/../plugin/._libwasmedge_rustls.dylib' (not a mach-o file), '/Users/alabulei/.wasmedge/lib/._libwasmedge_rustls.dylib' (no such file), '/Users/alabulei/.wasmedge/plugin/._libwasmedge_rustls.dylib' (not a mach-o file), '/System/Volumes/Preboot/Cryptexes/OS/Users/alabulei/.wasmedge/plugin/._libwasmedge_rustls.dylib' (no such file), '/Users/alabulei/.wasmedge/plugin/._libwasmedge_rustls.dylib' (not a mach-o file)
wasmedge version 0.13.5

After I renamed libwasmedge_rustls.dylib to ._libwasmedge_rustls.dylib, it works well.

Current State

No response

Expected State

The installer install WasmEdge Rusttls plugin successfully.

Reproduction steps

  1. run the following command
curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- --plugins wasmedge_rustls wasi_nn-ggml
source /home/azureuser/.bashrc
  1. Run the following command
wasmedge -v
  1. Get error

Screenshots

DESCRIPTION

Any logs you want to share for showing the specific issue

No response

Components

CLI

WasmEdge Version or Commit you used

0.13.5

Operating system information

macOS 14.1.1 (23B81)

Hardware Architecture

arm64

Compiler flags and options

No response

Please share the files under ~/.wasmedge/plugin via ls -alh ~/.wasmedge/plugin.

Now I'm using WasmEdge to execute som tasks.

I simply used ls to show the files before creating this issue.

ls plugin
ggml-metal.metal		libwasmedge_rustls.dylib
libwasmedgePluginWasiNN.dylib

I'm not sure if it met your requirement. If not, please wait a moment.

You must use ls -alh to list all files, including the ._* files if there is any.

This command will not break any wasmedge which is already executing.

ls -alh
total 7992
drwxr-xr-x  6 alabulei  staff   192B Feb 23 14:40 .
drwxr-xr-x  7 alabulei  staff   224B Feb 23 14:40 ..
-rwxr-xr-x  1 alabulei  staff   163B Nov  3 19:00 ._libwasmedge_rustls.dylib
-rw-r--r--  1 alabulei  staff   248K Feb 22 13:05 ggml-metal.metal
-rwxr-xr-x  1 alabulei  staff   2.0M Feb 22 13:05 libwasmedgePluginWasiNN.dylib
-rwxr-xr-x  1 alabulei  staff   1.6M Nov  3 19:00 libwasmedge_rustls.dylib

This command will not break any wasmedge which is already executing.

I also can't use WasmEdge to run LLMs with the error caused by rustTLS plugin. So I reinstalled WasmEdge yesterday before your comment.

wasmedge --dir .:. \
  --env mmproj=mmproj-model-f16.gguf \
  --env image=monalisa.jpg \
  --nn-preload default:GGML:AUTO:ggml-model-q5_k.gguf \
  wasmedge-ggml-llava.wasm default
[2024-02-23 14:44:10.648] [error] loading failed: invalid path, Code: 0x20
[2024-02-23 14:44:10.648] [error]     load library failed:dlopen(/Users/alabulei/.wasmedge/lib/../plugin/._libwasmedge_rustls.dylib, 0x0005): tried: '/Users/alabulei/.wasmedge/lib/._libwasmedge_rustls.dylib' (no such file), '/Users/alabulei/.wasmedge/lib/../plugin/._libwasmedge_rustls.dylib' (not a mach-o file), '/System/Volumes/Preboot/Cryptexes/OS/Users/alabulei/.wasmedge/lib/../plugin/._libwasmedge_rustls.dylib' (no such file), '/Users/alabulei/.wasmedge/lib/../plugin/._libwasmedge_rustls.dylib' (not a mach-o file), '/Users/alabulei/.wasmedge/lib/._libwasmedge_rustls.dylib' (no such file), '/Users/alabulei/.wasmedge/plugin/._libwasmedge_rustls.dylib' (not a mach-o file), '/System/Volumes/Preboot/Cryptexes/OS/Users/alabulei/.wasmedge/plugin/._libwasmedge_rustls.dylib' (no such file), '/Users/alabulei/.wasmedge/plugin/._libwasmedge_rustls.dylib' (not a mach-o file)
[2024-02-23 14:44:10.649] [error] loading failed: invalid path, Code: 0x20
[2024-02-23 14:44:10.649] [error]     load library failed:dlopen(/Users/alabulei/.wasmedge/lib/../plugin/._libwasmedge_rustls.dylib, 0x0005): tried: '/Users/alabulei/.wasmedge/lib/._libwasmedge_rustls.dylib' (no such file), '/Users/alabulei/.wasmedge/lib/../plugin/._libwasmedge_rustls.dylib' (not a mach-o file), '/System/Volumes/Preboot/Cryptexes/OS/Users/alabulei/.wasmedge/lib/../plugin/._libwasmedge_rustls.dylib' (no such file), '/Users/alabulei/.wasmedge/lib/../plugin/._libwasmedge_rustls.dylib' (not a mach-o file), '/Users/alabulei/.wasmedge/lib/._libwasmedge_rustls.dylib' (no such file), '/Users/alabulei/.wasmedge/plugin/._libwasmedge_rustls.dylib' (not a mach-o file), '/System/Volumes/Preboot/Cryptexes/OS/Users/alabulei/.wasmedge/plugin/._libwasmedge_rustls.dylib' (no such file), '/Users/alabulei/.wasmedge/plugin/._libwasmedge_rustls.dylib' (not a mach-o file)
[2024-02-23 14:44:10.652] [error] instantiation failed: module name conflict, Code: 0x60
[2024-02-23 14:44:10.653] [error]     At AST node: module

Could you just remove the ._libwasmedge_rustls.dylib under the plugin folder? I am not sure why it will produce this file.

After removing the ._libwasmedge_rustls.dylib, I can run LLM using WasmEdge now. But it has two warning messages, which never happened before.

wasmedge --dir .:. --nn-preload default:GGML:AUTO:gemma-2b-it-Q5_K_M.gguf llama-api-server.wasm -p gemma-instruct -c 4096
[2024-02-23 14:53:29.037] [error] instantiation failed: module name conflict, Code: 0x60
[2024-02-23 14:53:29.038] [error]     At AST node: module
[INFO] Socket address: 0.0.0.0:8080

This is a known issue, a false positive error.

If I only install WasmEdge with the ggml plugin, it won't have such warning messages.

wasmedge --dir .:. --nn-preload default:GGML:AUTO:gemma-2b-it-Q5_K_M.gguf llama-api-server.wasm -p gemma-instruct -c 4096
[INFO] Socket address: 0.0.0.0:8080
[INFO] Model name: default
[INFO] Model alias: default
[INFO] Prompt context size: 4096
[INFO] Number of tokens to predict: 1024
[INFO] Number of layers to run on the GPU: 100
[INFO] Batch size for prompt processing: 512

Yes. As mentioned above, it will only happen when you use a Rust plugin. C++ plugins are fine.