Code Monkey home page Code Monkey logo

Comments (7)

walkingeyerobot avatar walkingeyerobot commented on August 17, 2024

The error message is complaining about atomics, so maybe it needs to be built with threads. Try adding threads = "emscripten", to your wasm_cc_binary

from emsdk.

Yongle-Fu avatar Yongle-Fu commented on August 17, 2024

Thank you very much. Build completed successfully now

from emsdk.

Yongle-Fu avatar Yongle-Fu commented on August 17, 2024

The error message is complaining about atomics, so maybe it needs to be built with threads. Try adding threads = "emscripten", to your wasm_cc_binary

I am using WebAssembly (Wasm) in a WeChat Mini Program environment, but it does not support Web Workers.

worker=new Worker(pthreadMainJs,workerOptions)

Would you like additional information or suggestions on how to handle WebAssembly in WeChat Mini Programs without Web Workers? @walkingeyerobot

like without option threads = "emscripten" in wasm_cc_binary,

thank you so much !~

from emsdk.

walkingeyerobot avatar walkingeyerobot commented on August 17, 2024

Are you able to get tensorflow lite to compile without threads outside of bazel and run in your environment? If yes, I'm happy to help dig into this further. If no, I think that's a question for hte tensorflow lite folks.

from emsdk.

Yongle-Fu avatar Yongle-Fu commented on August 17, 2024

Thank you very much for your help.

According to the advice from a TensorFlow Lite team member, I tried remove the -pthread lines in the emlink params file and ran emcc_link.sh. It was successful, although the generated wasm-loader.js is larger than usual. Are there any unfinished tasks that need to be completed after running emcc_link.sh?

generated wasm-loader.js file
tensorflow isuse help which build wasm_cc_binary without pthread

from emsdk.

mattsoulanille avatar mattsoulanille commented on August 17, 2024

Are you able to get tensorflow lite to compile without threads outside of bazel and run in your environment? If yes, I'm happy to help dig into this further. If no, I think that's a question for hte tensorflow lite folks.

This works internally in google3 (you can ping me in chat for a link) for building @tensorflow/tfjs-tflite, so I think the Bazel wasm tooling probably supports it. My guess is there's something misconfigured in the oss build, possibly before anything gets passed to wasm_cc_binary, that's causing it to use threads even when threads are not requested. If that's the case, then this is a TFLite issue.

from emsdk.

Yongle-Fu avatar Yongle-Fu commented on August 17, 2024

The error message is complaining about atomics, so maybe it needs to be built with threads. Try adding threads = "emscripten", to your wasm_cc_binary

I found a solution to fix the emcc_link issue by threads = "off" and adding -s USE_PTHREADS=0

from emsdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.