w-okada / image-analyze-workers

The zoo of image processing webworkers for javascript or typescript.
280 stars 56 forks source link

SIMD Error: Compiling function #24 failed: Invalid opcode 0xfd #41

Closed kenshin54 closed 3 years ago

kenshin54 commented 3 years ago

Hi, thanks for making those excellent demos, they're really helpful for learning and experiment.

When running the demos on my local, I got the following error from console, and the SIMD toggle seemed broken also.

Uncaught (in promise) RuntimeError: abort(CompileError: WebAssembly.instantiate(): Compiling function #24 failed: Invalid opcode 0xfd (enable with --experimental-wasm-simd) @+13294). Build with -s ASSERTIONS=1 for more info.
    at abort (http://localhost:3000/tflite/tflite-simd.js:9:9108)
    at http://localhost:3000/tflite/tflite-simd.js:9:11100

I also compared the tflite-simd.js from the demos you published on S3 and my local one, they have the md5 hash, it seems they are identical.

Can you instruct me what's the potential problem? (I'm new in this area)

Thanks

kenshin54 commented 3 years ago

After the research, it seems I need to turn on the flag enable-webassembly-simd in Google Chrome. Now the error disappeared. But when running the demo from the links you shared, it doesn't have any errors even without the flag. Is there anything I missed?

w-okada commented 3 years ago

maybe you missed add the "origin-trial". If so, see https://dannadori.medium.com/build-tflite-wasm-simd-and-run-google-meet-virtual-background-6090226ed465 and add your origin-trial code.

kenshin54 commented 3 years ago

@w-okada Ah, that's exactly what I missed. Thanks for your help.