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

Building Bazel on NOOBS 1.9.0 #5

Closed
trungdn opened this issue Mar 22, 2016 · 17 comments
Closed

Building Bazel on NOOBS 1.9.0 #5

trungdn opened this issue Mar 22, 2016 · 17 comments
Labels

Comments

@trungdn
Copy link

trungdn commented Mar 22, 2016

I follow your step to install tensorflow on raspberry pi 2 - newest Raspbian
I have a trouble when building Bazel
./compile.sh
It shows that error

= new Signal("INT");
^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:32: warning: Signal is internal proprietary API and may be removed in a future release
private static final Signal SIGINT = new Signal("INT");
^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:34: warning: SignalHandler is internal proprietary API and may be removed in a future release
private SignalHandler oldHandler;
^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:42: warning: SignalHandler is internal proprietary API and may be removed in a future release
this.oldHandler = Signal.handle(SIGINT, new SignalHandler() {
^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:44: warning: Signal is internal proprietary API and may be removed in a future release
public void handle(Signal signal) {
^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:42: warning: Signal is internal proprietary API and may be removed in a future release
this.oldHandler = Signal.handle(SIGINT, new SignalHandler() {
^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:55: warning: Signal is internal proprietary API and may be removed in a future release
Signal.handle(SIGINT, oldHandler);
^
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.util.jar.Manifest$FastInputStream.(Manifest.java:332)
at java.util.jar.Manifest$FastInputStream.(Manifest.java:327)
at java.util.jar.Manifest.read(Manifest.java:195)
at java.util.jar.Manifest.(Manifest.java:69)
at java.util.jar.JarFile.getManifestFromReference(JarFile.java:199)
at java.util.jar.JarFile.getManifest(JarFile.java:180)
at sun.misc.URLClassPath$JarLoader$2.getManifest(URLClassPath.java:944)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:450)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at com.sun.tools.javac.main.Main.resourceMessage(Main.java:610)
at com.sun.tools.javac.main.Main.compile(Main.java:543)
at com.sun.tools.javac.main.Main.compile(Main.java:381)
at com.sun.tools.javac.main.Main.compile(Main.java:370)
at com.sun.tools.javac.main.Main.compile(Main.java:361)
at com.sun.tools.javac.Main.compile(Main.java:56)
at com.sun.tools.javac.Main.main(Main.java:42)

Do u have any idea to solve this problems. I guess it maybe OutOfMemoryError. Should I do the swap memory first before compile Bazel.

Thank you very much.

@samjabrahams
Copy link
Owner

Interesting- the Raspberry Pi 2 has the same amount of memory as the Pi 3, but perhaps there's a difference in memory allocation somewhere.

Would you mind adding the swap memory and trying again? Hopefully the build didn't take too long. If the bug persists, we can do some further prodding.

@trungdn
Copy link
Author

trungdn commented Mar 23, 2016

I'm sr. My mistake. I'm running on Raspberry Pi 3. I also tried to swap memory but it still shows that errors. Do I need to update java?

@samjabrahams
Copy link
Owner

Ok- just to double check: you built Protobuf from scratch and moved in the compiled protobuf-java-3.0.0-beta-2.jar file as protobuf-java-3.0.0-beta-1.jar?

@samjabrahams samjabrahams removed the bug label Mar 23, 2016
@samjabrahams
Copy link
Owner

Additionally, did you make sure to checkout Bazel version 0.1.4 with the command git checkout tags/0.1.4? I did some tests and was only able to recreate the message you received when building an incorrect version of Bazel.

@trungdn
Copy link
Author

trungdn commented Mar 23, 2016

Thank you for fast responding me.

I tried to install Raspbian from Noobs instead of writing to SD card.
But yes, i'm still having that problems

-Yes. I checked with Bazel version 0.1.4 git checkout tags/0.1.4 Note: checking out 'tags/0.1.4'. HEAD is now at c553e35... Release 0.1.4 (2016-01-15)
-After built Protobuf from scratch. I check 2 file needed to compile Bazel
Aready run 2 copy command
sudo cp /usr/bin/protoc third_party/protobuf/protoc-linux-arm32.exe
sudo cp ../protobuf/java/core/target/protobuf-java-3.0.0-beta-2.jar third_party/protobuf/protobuf-java-3.0.0-beta-1.jar

That is my free memory after I bulit Probuf sucessfully.
free -m
total used free shared buffers cached
Mem:
862 745 117 47 15 574
-/+ buffers/cache: 155 706
Swap: 99 0 99

@samjabrahams
Copy link
Owner

Hmm. Let's try this: I've uploaded the protoc-linux-arm32.exe and protobuf-java-3.0.0-beta-1.jar files that I used to compile on my Pi3 here. Try dropping those into their respective locations and try recompiling to see if that works.

@samjabrahams
Copy link
Owner

I should also say that I used NOOBS to install Raspbian for this build.

@trungdn
Copy link
Author

trungdn commented Mar 24, 2016

Since for some reasons, the protoc-linux-arm32.exe file you uploaded doesn't include compiler, it will show error below when I compile Bazel.

🍃 Building Bazel from scratch
Protobuf compiler not found in third_party/protobuf/protoc-linux-arm32.exe

So, the result with new protobuf-java-3.0.0-beta-1.jar still the same.

I also go through compile.sh looks like it requires java version 1.8 or later.
Mine is 1.7. Do u think it might be the problem?
Also I check the error Java.Outofmemory : java heap space. I tried to increase heap size maximum to 1Gb but still doesn't change anything.

java -version
java version "1.7.0_95"
OpenJDK Runtime Environment (IcedTea 2.6.4) (7u95-2.6.4-1~deb8u1+rpi1)
OpenJDK Zero VM (build 24.95-b01, mixed mode)

@samjabrahams
Copy link
Owner

My Java version is the same as yours. I'll do a clean wipe on one of my RPi3s and go through the guide to see if I can replicate this issue.

In the meantime, if you have time, upgrade your Java to see if it helps. I'm quite puzzled as to why we're getting different results here.

@trungdn
Copy link
Author

trungdn commented Mar 24, 2016

Thank you so much. Yes me too. Since my rasp's the new one and only install this repo. I dont see the different here. Maybe more information.
It's able to run tensorflow if pip installation, but I need to use inceptionv3 model that why bazel is still necessary. When I am building the Bazel. It only show
INFO: You can skip this first step by providing a path to the bazel binary as second argument:
INFO: ./compile.sh build /path/to/bazel
🍃 Building Bazel from scratch..
Compiling Bazel Java code...
and then stop and show the error.
I will try to update java too

@samjabrahams
Copy link
Owner

I reformatted my SD card, reinstalled Raspbian with NOOBS, and followed the guide verbatim without touching any other software and was able to build Bazel without any issues.

I just checked and saw that I'm using NOOBS version 1.8.0, and the most recent is 1.9.0. Perhaps there was a change that could be messing this up. I'll look into it (and probably try the process again with NOOBS 1.9.0)

@trungdn
Copy link
Author

trungdn commented Mar 24, 2016

Thank you so much. I'll try with NOOBS 1.8.0

@trungdn
Copy link
Author

trungdn commented Mar 24, 2016

Gosh. It works with NOOBS 1.8.0. Thank you very much for helping me. I was very frustrated.

@samjabrahams samjabrahams changed the title Building Bazel Building Bazel on NOOBS 1.9.0 Mar 24, 2016
@samjabrahams
Copy link
Owner

Glad to hear it! I'll have to figure out why it's broken on NOOBS 1.9.0- I'm just about to build Bazel on 1.9, so I'll toy around with it if/when it breaks.

@samjabrahams
Copy link
Owner

Very strange, the build worked fine for me with NOOBS 1.9.0. Perhaps all that was needed was a fresh reinstall?

Closing this issue.

@SangManLINUX
Copy link

Maybe i found solution.
I'm using Pi 2 Model B, and i have same issue.
All i have to do is setting heap size for javac in "bazel/scripts/bootstrap/compile.sh" before "./compile.sh".

Not sure about this is perfect solution,
but at least try it.

@samjabrahams
Copy link
Owner

Thanks for adding this- hopefully it'll help some people out.

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

No branches or pull requests

3 participants