Skip to content

Commit c5ddda3

Browse files
authored
chore: use wasm32-wasip1 for > rust 1.84 (#193)
Signed-off-by: hydai <[email protected]>
1 parent 89276c5 commit c5ddda3

File tree

16 files changed

+51
-51
lines changed

16 files changed

+51
-51
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ ldconfig
4040
#### Rust Installation
4141

4242
For building the WASM files from rust source, please refer to the [Rust Official Site](https://www.rust-lang.org/tools/install) for the Rust installation.
43-
After the installation, developers should add the `wasm32-wasi` target.
43+
After the installation, developers should add the `wasm32-wasip1` target.
4444

4545
```bash
46-
rustup target add wasm32-wasi
46+
rustup target add wasm32-wasip1
4747
```
4848

4949
#### Download the `wasi-nn` Rust Crate

openvino-mobilenet-image/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ This example demonstrates how to use WasmEdge WASI-NN OpenVINO plugin to perform
1010

1111
> It is recommended to use Rust 1.68 or above in the stable channel.
1212
13-
Then, add `wasm32-wasi` target to the Rustup toolchain:
13+
Then, add `wasm32-wasip1` target to the Rustup toolchain:
1414

1515
```bash
16-
rustup target add wasm32-wasi
16+
rustup target add wasm32-wasip1
1717
```
1818

1919
- Clone the example repo
@@ -54,10 +54,10 @@ Please refer to [WasmEdge Docs](https://wasmedge.org/docs/contribute/source/plug
5454

5555
```bash
5656
cd rust
57-
cargo build --target wasm32-wasi --release
57+
cargo build --target wasm32-wasip1 --release
5858
cd ..
5959

60-
wasmedge --dir .:. ./rust/target/wasm32-wasi/release/wasmedge-wasinn-example-mobilenet.wasm mobilenet.xml mobilenet.bin input.jpg
60+
wasmedge --dir .:. ./rust/target/wasm32-wasip1/release/wasmedge-wasinn-example-mobilenet.wasm mobilenet.xml mobilenet.bin input.jpg
6161
```
6262

6363
If the commands above run successfully, you will get the output:

openvino-mobilenet-raw/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ This example demonstrates how to use WasmEdge WASI-NN OpenVINO plugin to perform
1010

1111
> It is recommended to use Rust 1.68 or above in the stable channel.
1212
13-
Then, add `wasm32-wasi` target to the Rustup toolchain:
13+
Then, add `wasm32-wasip1` target to the Rustup toolchain:
1414

1515
```bash
16-
rustup target add wasm32-wasi
16+
rustup target add wasm32-wasip1
1717
```
1818

1919
- Clone the example repo
@@ -54,10 +54,10 @@ Please refer to [WasmEdge Docs](https://wasmedge.org/docs/contribute/source/plug
5454

5555
```bash
5656
cd rust
57-
cargo build --target wasm32-wasi --release
57+
cargo build --target wasm32-wasip1 --release
5858
cd ..
5959

60-
wasmedge --dir .:. ./rust/target/wasm32-wasi/release/wasmedge-wasinn-example-mobilenet-image.wasm mobilenet.xml mobilenet.bin input.jpg
60+
wasmedge --dir .:. ./rust/target/wasm32-wasip1/release/wasmedge-wasinn-example-mobilenet-image.wasm mobilenet.xml mobilenet.bin input.jpg
6161
```
6262

6363
If the commands above run successfully, you will get the output:

openvino-road-segmentation-adas/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ The model files and the images used for this demonstration are from the [Intel o
1919

2020
> It is recommended to use Rust 1.68 or above in the stable channel.
2121
22-
Then, add `wasm32-wasi` target to the Rustup toolchain:
22+
Then, add `wasm32-wasip1` target to the Rustup toolchain:
2323

2424
```bash
25-
rustup target add wasm32-wasi
25+
rustup target add wasm32-wasip1
2626
```
2727

2828
- Clone the example repo
@@ -62,10 +62,10 @@ Please refer to [WasmEdge Docs](https://wasmedge.org/docs/contribute/source/plug
6262

6363
```bash
6464
cd openvino-road-seg-adas
65-
cargo build --target wasm32-wasi --release
65+
cargo build --target wasm32-wasip1 --release
6666
cd ..
6767

68-
wasmedge --dir .:. ./openvino-road-seg-adas/target/wasm32-wasi/release/openvino-road-seg-adas.wasm \
68+
wasmedge --dir .:. ./openvino-road-seg-adas/target/wasm32-wasip1/release/openvino-road-seg-adas.wasm \
6969
./model/road-segmentation-adas-0001.xml \
7070
./model/road-segmentation-adas-0001.bin \
7171
./image/empty_road_mapillary.jpg

openvinogenai-raw/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ This example demonstrates how to use WasmEdge WASI-NN OpenVINO GenAI plugin to p
1010

1111
> It is recommended to use Rust 1.68 or above in the stable channel.
1212
13-
Then, add `wasm32-wasi` target to the Rustup toolchain:
13+
Then, add `wasm32-wasip1` target to the Rustup toolchain:
1414

1515
```bash
16-
rustup target add wasm32-wasi
16+
rustup target add wasm32-wasip1
1717
```
1818

1919
- Clone the example repo
@@ -72,13 +72,13 @@ This example demonstrates how to use WasmEdge WASI-NN OpenVINO GenAI plugin to p
7272
- Build the example
7373

7474
```bash
75-
cargo build --target wasm32-wasi --release
75+
cargo build --target wasm32-wasip1 --release
7676
```
7777

7878
- Run the example
7979

8080
```bash
81-
wasmedge ./target/wasm32-wasi/release/openvinogenai-deepseek-raw.wasm path_to_model_xml_folder
81+
wasmedge ./target/wasm32-wasip1/release/openvinogenai-deepseek-raw.wasm path_to_model_xml_folder
8282
```
8383

8484
You will get the output:

pytorch-mobilenet-image/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ wasi-nn = "0.6.0"
1818
Compile the application to WebAssembly:
1919

2020
```bash
21-
cargo build --target=wasm32-wasi --release
21+
cargo build --target=wasm32-wasip1 --release
2222
```
2323

24-
Because here, we will demonstrate two ways of using wasi-nn. So the output WASM files will be at [`target/wasm32-wasi/release/wasmedge-wasinn-example-mobilenet-image.wasm`](wasmedge-wasinn-example-mobilenet-image.wasm) and [`target/wasm32-wasi/release/wasmedge-wasinn-example-mobilenet-image-named-model.wasm`](wasmedge-wasinn-example-mobilenet-image-named-model.wasm).
24+
Because here, we will demonstrate two ways of using wasi-nn. So the output WASM files will be at [`target/wasm32-wasip1/release/wasmedge-wasinn-example-mobilenet-image.wasm`](wasmedge-wasinn-example-mobilenet-image.wasm) and [`target/wasm32-wasip1/release/wasmedge-wasinn-example-mobilenet-image-named-model.wasm`](wasmedge-wasinn-example-mobilenet-image-named-model.wasm).
2525
To speed up the image processing, we can enable the AOT mode in WasmEdge with:
2626

2727
```bash
28-
wasmedgec rust/target/wasm32-wasi/release/wasmedge-wasinn-example-mobilenet-image.wasm wasmedge-wasinn-example-mobilenet-image-aot.wasm
28+
wasmedgec rust/target/wasm32-wasip1/release/wasmedge-wasinn-example-mobilenet-image.wasm wasmedge-wasinn-example-mobilenet-image-aot.wasm
2929

30-
wasmedgec rust/target/wasm32-wasi/release/wasmedge-wasinn-example-mobilenet-image-named-model.wasm wasmedge-wasinn-example-mobilenet-image-named-model-aot.wasm
30+
wasmedgec rust/target/wasm32-wasip1/release/wasmedge-wasinn-example-mobilenet-image-named-model.wasm wasmedge-wasinn-example-mobilenet-image-named-model-aot.wasm
3131
```
3232

3333
## Run

pytorch-yolo-image/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ https://github.com/ultralytics/assets/releases
1414
### Build + Run
1515

1616
To build (from the `/rust` directory):
17-
`cargo build --release --target wasm32-wasi`
17+
`cargo build --release --target wasm32-wasip1`
1818

1919
To compile the WASM AOT (Ahead of Time) - this results in a much more performant binary
2020
`
21-
wasmedge compile ./target/wasm32-wasi/release/wasmedge-wasinn-example-yolo-image.wasm ./target/wasm32-wasi/release/wasmedge-wasinn-example-yolo-image.wasm
21+
wasmedge compile ./target/wasm32-wasip1/release/wasmedge-wasinn-example-yolo-image.wasm ./target/wasm32-wasip1/release/wasmedge-wasinn-example-yolo-image.wasm
2222
`
2323

2424
To Run (from root `/` directory of the example):
2525
`
26-
wasmedge --dir .:. ./rust/target/wasm32-wasi/release/wasmedge-wasinn-example-yolo-image.wasm ./yolov8n.torchscript ./input.jpg
26+
wasmedge --dir .:. ./rust/target/wasm32-wasip1/release/wasmedge-wasinn-example-yolo-image.wasm ./yolov8n.torchscript ./input.jpg
2727
`
2828

2929
> **Note**

tflite-birds_v1-image/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ wasi-nn = "0.4.0"
1818
Compile the application to WebAssembly:
1919

2020
```bash
21-
cd rust && cargo build --target=wasm32-wasi --release
21+
cd rust && cargo build --target=wasm32-wasip1 --release
2222
```
2323

24-
The output WASM file will be at [`rust/target/wasm32-wasi/release/wasmedge-wasinn-example-tflite-bird-image.wasm`](wasmedge-wasinn-example-tflite-bird-image.wasm).
24+
The output WASM file will be at [`rust/target/wasm32-wasip1/release/wasmedge-wasinn-example-tflite-bird-image.wasm`](wasmedge-wasinn-example-tflite-bird-image.wasm).
2525
To speed up the image processing, we can enable the AOT mode in WasmEdge with:
2626

2727
```bash
28-
wasmedge compile rust/target/wasm32-wasi/release/wasmedge-wasinn-example-tflite-bird-image.wasm wasmedge-wasinn-example-tflite-bird-image.wasm
28+
wasmedge compile rust/target/wasm32-wasip1/release/wasmedge-wasinn-example-tflite-bird-image.wasm wasmedge-wasinn-example-tflite-bird-image.wasm
2929
```
3030

3131
## Run

wasmedge-chatTTS/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@ Then you will have an executable `wasmedge` runtime under `/usr/local/bin` and t
2626

2727
## Build wasm
2828

29-
Run the following command to build wasm, the output WASM file will be at `target/wasm32-wasi/release/`
29+
Run the following command to build wasm, the output WASM file will be at `target/wasm32-wasip1/release/`
3030

3131
```bash
32-
cargo build --target wasm32-wasi --release
32+
cargo build --target wasm32-wasip1 --release
3333
```
3434

3535
## Execute
3636

3737
Execute the WASM with the `wasmedge`.
3838

3939
``` bash
40-
wasmedge --dir .:. ./target/wasm32-wasi/release/wasmedge-chattts.wasm
40+
wasmedge --dir .:. ./target/wasm32-wasip1/release/wasmedge-chattts.wasm
4141
```
4242

4343
Then you will generate the `output1.wav` file. It is the wav file of the input text.

wasmedge-ggml/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ Compile the application to WebAssembly:
5858

5959
```bash
6060
cd llama
61-
cargo build --target wasm32-wasi --release
61+
cargo build --target wasm32-wasip1 --release
6262
```
6363

64-
The output WASM file will be at `target/wasm32-wasi/release/`.
64+
The output WASM file will be at `target/wasm32-wasip1/release/`.
6565

6666
```bash
67-
cp target/wasm32-wasi/release/wasmedge-ggml-llama.wasm ./wasmedge-ggml-llama.wasm
67+
cp target/wasm32-wasip1/release/wasmedge-ggml-llama.wasm ./wasmedge-ggml-llama.wasm
6868
```
6969

7070
## Get Model

0 commit comments

Comments
 (0)