Skip to content
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

Bug: node.js tensorflow binding does not compile on arm64 #1

Open
johnwalicki opened this issue Jul 20, 2022 · 1 comment
Open

Bug: node.js tensorflow binding does not compile on arm64 #1

johnwalicki opened this issue Jul 20, 2022 · 1 comment

Comments

@johnwalicki
Copy link
Collaborator

The Node-RED service container will run on arm64 but the COCO SSD node fails because the node.js tensorflow binding does not compile successfully. Object detection fails.

I've been down this rabbit hole before with node-gyp and libtensorflow on arm64.

To test manually, on a Raspberry Pi, run/exec into a container, copy in the package.json, install the gcc toolchains, install the npm dev dependencies, try to compile npm rebuild @tensorflow/tfjs-node --build-from-source

"/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" --verbose --module_name=tfjs_binding --module_path="./lib/napi-v{napi_build_version}"

will compile the .o objects but fails when linking.

SOLINK_MODULE(target) Release/obj.target/tfjs_binding.node
/usr/bin/ld: skipping incompatible /opt/app-root/data/node_modules/@tensorflow/tfjs-node/deps/lib/libtensorflow.so when searching for -ltensorflow
/usr/bin/ld: cannot find -ltensorflow

The /opt/app-root/data/node_modules/@tensorflow/tfjs-node/deps/lib/libtensorflow_framework.so.1.14.0 and libtensorflow.so.1.14.0 exist but don't link.

Over the past 5 years, I've dug deep here. Maybe one time I found success on a Jetson Nano by reusing a CUDA gpu lib.... (?)

Opening this ticket so others might not fall down the hole as deep as I have.

@johnwalicki
Copy link
Collaborator Author

docker run -it registry.access.redhat.com/ubi9:9.0.0-1576
then, within the container:

dnf install --nodocs -y nodejs nodejs-nodemon npm --setopt=install_weak_deps=0 --disableplugin=subscription-manager     && dnf install --nodocs -y make gcc gcc-c++  --setopt=install_weak_deps=0 --disableplugin=subscription-manager     && dnf clean all --disableplugin=subscription-manager

npm install --no-audit --no-update-notifier --no-fund --omit=dev --omit=optional -g npm@8.14.0
npm install --no-audit --no-update-notifier --no-fund
cd node_modules

Proceed with the above npm rebuild

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant