Stream: general

Topic: wasmtime cannot run wasi-threads


view this post on Zulip Dennis Zhang (Jun 21 2024 at 17:32):

Hi Community,

I am trying to follow the steps in https://bytecodealliance.org/articles/wasi-threads, and I have encountered the error:

../wasmtime/target/debug/wasmtime run --wasm=threads --wasi-modules=experimental-wasi-threads thread-test.wasm
error: unexpected argument '--wasi-modules' found

  tip: a similar argument exists: '--wasi'

Usage: wasmtime run <--optimize <KEY[=VAL[,..]]>|--codegen <KEY[=VAL[,..]]>|--debug <KEY[=VAL[,..]]>|--wasm <KEY[=VAL[,..]]>|--wasi <KEY[=VAL[,..]]>> <WASM>...

For more information, try '--help'.

Then I tried another commend, but still get error:

../wasmtime/target/debug/wasmtime run --wasm=threads thread-test.wasm
Error: failed to run main module `thread-test.wasm`

Caused by:
    0: failed to instantiate "thread-test.wasm"
    1: unknown import: `env::memory` has not been defined

Any help will be appreciated!

Until now, one piece missing from WebAssembly standalone engines was the ability to spawn threads.Browsers have had this ability for some time via Web Workers, but standalone engines had no standardway to do this. This post describes the...

view this post on Zulip bjorn3 (Jun 21 2024 at 17:38):

You need wasmtime run --wasi threads=y --wasi preview2=n.

view this post on Zulip bjorn3 (Jun 21 2024 at 17:39):

The wasmtime cli has changed since the wasi-threads announcement was made.

view this post on Zulip Dennis Zhang (Jun 21 2024 at 17:45):

bjorn3 said:

The wasmtime cli has changed since the wasi-threads announcement was made.

Thanks so much!


Last updated: Dec 23 2024 at 12:05 UTC