-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wasm hardware support (including 32-bit like Windows i686 and Linux armhf) #757
Comments
About Wasm and 32-bit, I read a very interesting comment on WebAssembly design tracker (comment from 2021):
So, while we don't run Android, it gives us a glance on what kind of hardware platforms Wasm is expected to run. The same way there was actually 32-bit versions Windows 10 being distributed (even if hardware can do 64-bit), there are 32-bit Android being distributed, or even 32-bit Chrome (even if hardware can do 64-bit), sometime just to save on memory. So the same way we need to ship i686 build of our game for 32-bit Windows 10, some others may have to port Wasm to 32-bit arm for running web apps on phones. |
While this is interesting, it kind of suggest the only reason 32 bits wasm is available is to save memory, or cheap android phone. We don't want to support cheap android phones; and running 32 bits wasm executable is actually the wasmtime default anyway bytecodealliance/wasmtime#572, bytecodealliance/wasmtime#3153. "Runs 32 bits executables" and "Runs on a 32 bits CPU" are very different problems. And for our usecase we don't need to care about 64 bits devices equipped only with 32 bits runtimes because we own the runtime. |
I don't get this. There is no wasmtime runtime to build or download to redistribute, so we cannot distribute a 32-bit wasmtime runtime on Windows i686 (Like on 32-bit Windows-10) or Linux armhf (like on Raspberry Pi default distro), meaning we cannot distribute an engine on those systems. |
WAMR (WASM micro runtime) may be a better candidate than Wasmtime: it supports all platforms the engine currently run on (and even more), it has more hardware compatibility than both NaCl and Wasmtime. I found that information there: bytecodealliance/wasmtime#6675 (comment) Basically WAMR runs on amd64, i686, arm64, armhf, riscv64 architectures at least, and on Linux, Windows, macOS, and Android systems at least. I updated the table in first post. |
I built the toolchain and the virtual machine of WAMR, and I modified their benchmark script to also run
More iterations per second means the executable runs faster. Details provided by
When running |
This is a parent thread to follow outside work on Wasm as we investigate a migration from Native Client (NaCl) to WebAssembly (Wasm).
Platform support:
Note: the NaCl vm also supports mips (not the naclsdk) and wasmtime supports s390x but we probably have no usage for that.
See this wasmtime label for new targets being discussed:
We may also investigate the WebAssembly micro runtime (WAMR), WAMR runs on amd64, i686, arm64, armhf, riscv64 architectures at least, and on Linux, Windows, macOS, and Android systems at least.
This first post focus on 32-bit (what motivated this thread), but other architectures can be discussed.
As WebAssembly is the candidate of choice to replace NaCl, it is interesting to look at what platform it supports. Tracking this is low priority but it's not a bad idea to gather the related knowledge and have a place to track this in a dedicated place.
The NaCl stack we currently use to run the sandboxed game code provides ability to build and run 64-bit amd64 and 32-bit i686, armhf and mips binaries (I doubt there is a single compatible mips platform though). There may be a 64-bit arm64 support in NaCl repository, but a build for it haven't been found yet. So, from that we have working amd64, i386 and armhf.
The Wasmtime runtime provides support for 64-bit amd64, arm64, riscv64 and s390x (I doubt we would have a single s390x user though, and it's too early for riscv64). There is no supported 32-bit platform at all. So from that we may hope to get working amd64 and arm64.
Among existing 32-bit platform around, the major interests are in:
As @necessarily-equal wrote in Unvanquished/Unvanquished#1015
Here is the wasmtime ticket to track 32-bit arm support: bytecodealliance/wasmtime#1173
They're welcoming any 32-bit arm implementation but had to remove an half-implemented one because it was unmaintained: bytecodealliance/wasmtime#3721
The text was updated successfully, but these errors were encountered: