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

Unable to run Jina on Raspberry Pi 4 #2447

Closed
navanchauhan opened this issue May 19, 2021 · 25 comments · Fixed by #2506
Closed

Unable to run Jina on Raspberry Pi 4 #2447

navanchauhan opened this issue May 19, 2021 · 25 comments · Fixed by #2506
Assignees
Labels
type/bug Something isn't working

Comments

@navanchauhan
Copy link

navanchauhan commented May 19, 2021

I installed Jina using the installation instructions in the docs and I was unable to run even the Jina command without the error

free(): invalid pointer
Aborted

I have tried installing Jina from master branch, 1.2.4, and from pip. Yet, the problem persists


Environment
Can't actually run this command.

Latest version of Raspbian OS (aarm64), on a RPi4. Python 3.7.3

Screenshots

@FionnD FionnD added the type/bug Something isn't working label May 20, 2021
@FionnD
Copy link
Contributor

FionnD commented May 20, 2021

Hi @navanchauhan

Thanks for raising the issue, and sorry to hear it happened!

One of our team will try and reproduce the issue, it might take some time to get our hands on a Raspberry PI. It might take some time to get back to you, but we will!

@hanxiao
Copy link
Member

hanxiao commented May 20, 2021

arm64 should be supported, let me check

@alexcg1
Copy link
Member

alexcg1 commented May 20, 2021

I've got a Raspberry Pi Zero. I can try to test this tomorrow

@navanchauhan
Copy link
Author

navanchauhan commented May 21, 2021

After leaving the Pi 0 to build overnight (I should setup a cross-compile toolchain :p ), it did install jina but is having other issues and of them is probably because I used python3.9 to install it.

I have now tested installing jina using pip on x86_64, armv6l and aarch64. It installs without errors on all three platforms but does not run on aarch64 and throws invalid pointer issue.

p.s the docs don't mention It but I had to install libmupdf-dev and libfreetype6-dev on all platforms for PyMuPDF2 when pip could not install the wheel and had to manually build it.

Edit: I will try to install jina in a virtual environment on the Pi4 whenever I have time and report back

@alexcg1
Copy link
Member

alexcg1 commented May 21, 2021

Good point on how long it'll take! If it needs an overnight build I'd best wait til next week to test! Long weekend coming up here, and dragging my external monitor from office to home would be...well, it'd be a drag 😅

As for Python version, 3.7 or 3.8 are officially supported

@alexcg1
Copy link
Member

alexcg1 commented May 21, 2021

Right, progress update, with Jina 1.2.4:

jina -v throws Illegal instruction after RuntimeWarning about my protobuf backend. That warning just seems to be a standard thing when not using C++ protobuf backend I guess.

This is on a Raspberry Pi Zero

@alexcg1
Copy link
Member

alexcg1 commented May 21, 2021

FWIW I ran Jina 0.5 as well to see if this was a recent issue. But exact same result

@alexcg1
Copy link
Member

alexcg1 commented May 21, 2021

Running through gdb I get:

Program received signal SIGILL, Illegal instruction.
0xb67dc728 in ?? () from /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.1

@alexcg1
Copy link
Member

alexcg1 commented May 21, 2021

Same result on 1.2.4

@hanxiao
Copy link
Member

hanxiao commented May 22, 2021

hi all, actually the best way to use jina on arm device is not install from scratch but directly using Docker image.

if you go to this page, https://hub.docker.com/r/jinaai/jina/tags?page=1&ordering=last_updated

you will find all images are armv6, armv7 ready, as we already compiled it in CD, so you don't have to compile it again.

image

Try pull one of the docker image into your rpi and run it.

@alexcg1
Copy link
Member

alexcg1 commented May 25, 2021

Roger that @hanxiao . I'll give it a shot later today

@alexcg1
Copy link
Member

alexcg1 commented May 25, 2021

So, I'm trying Jina in Docker on my Raspberry Pi Zero. So far, a lot of silent fails.

  • It downloads just fine
  • Running docker run -v "$(pwd)/j:/j" jinaai/jina hello-world --workdir /j: CPU spins up, no output, j dir created but not populated
  • Running docker run -v "$(pwd)/j:/j" jinaai/jina hello fashion --workdir /j: same result
  • Running docker run -it jinaai/jina sh: same result

@navanchauhan
Copy link
Author

Whoops, there are no images for arm64:

admin@pi4:~ $ sudo !!
sudo docker run -it jinaai/jina sh
Unable to find image 'jinaai/jina:latest' locally
latest: Pulling from jinaai/jina
docker: no matching manifest for linux/arm64/v8 in the manifest list entries.
See 'docker run --help'.

Even if the official method is to use Docker images, shouldn't jina still run on a clean system with all the requirements satisfied?

@alexcg1
Copy link
Member

alexcg1 commented May 28, 2021

Raspberry Pi Zero runs on armv6 and Docker runs there but I think I wasn't getting great results. I'm heading to office again today so I can check again there.

@alexcg1
Copy link
Member

alexcg1 commented Jun 1, 2021

fwiw, I can't even get a shell on Jina running in Docker on a Raspberry Pi Zero.

Command: docker run -it --entrypoint /bin/sh jinaai/jina

  • On my Thinkpad X1 Carbon I get a shell.
  • On Raspberry Pi Zero I get a short pause then dumped back to shell with no output.

@alexcg1
Copy link
Member

alexcg1 commented Jun 1, 2021

Even -vvv for verbose output gives me nothing

@FionnD
Copy link
Contributor

FionnD commented Jun 1, 2021

Should we re-open this issue @alexcg1 ?

@alexcg1
Copy link
Member

alexcg1 commented Jun 1, 2021

I'm not sure running on armv6 is a priority. I can't see anyone running Jina on a Pi Zero for any practical reasons. It wouldn't really work IRL due to puny memory/CPU. For testing it IRL, best case scenario is it crashes or hangs due to lack of memory. But it shouldn't throw illegal instruction or just fail silently (like Docker did).

But like I said, no need to re-open issue. No real practical use except for bragging "hey, we can run Jina on a RaspPi Zero!" (but not actually do anything useful with it)

@FionnD
Copy link
Contributor

FionnD commented Jun 1, 2021

Should we remove it from docs so?

And I'll dismantle my super computer of Pi's

@navanchauhan
Copy link
Author

Will you be only removing references for armv6l (i.e. Pi Zero), because RPis 3/4 make good quick setup devices to try and prototype even if it doesn't make sense to use them in production

@alexcg1
Copy link
Member

alexcg1 commented Jun 1, 2021

I think removing support needs discussion. It's just my opinion that it's not worth us pushing a lot of effort into supporting an architecture (like armv6/rasp pi zero) where Jina wouldn't work in a practical sense. Note: If it actually did even barely work I wouldn't recommend removing support. It's just it's already broken and it's an impractical use case.

Having said that I fully support running Jina on a Pi 3/4. Those have enough grunt that Jina could actually do something practical.

@hanxiao thoughts?

@hanxiao
Copy link
Member

hanxiao commented Jun 1, 2021

it is closed because armv8 is supported by that pr

@hanxiao
Copy link
Member

hanxiao commented Jun 2, 2021

#2447 (comment)

this issue is about support on ARMv8 not ARMv6, ARMv8 is already supported by #2506 @navanchauhan please try pip install --pre again

@alexcg1 @FionnD Please do not mix the discussion on ARMv6 & ARMv8 just because they are all RPi. They are different architectures. Each arch must be compiled and installed differently.

@navanchauhan
Copy link
Author

I am having build errors now ugh. I'll try in a clean virtual environment and let it run overnight

@hanxiao
Copy link
Member

hanxiao commented Jun 10, 2021

I posted an issue on the upstream grpc/grpc#26457

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants