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

> Invalid NativePlatform: linux_aarch64 #2202

Closed
alexryan opened this issue Aug 25, 2016 · 11 comments
Closed

> Invalid NativePlatform: linux_aarch64 #2202

alexryan opened this issue Aug 25, 2016 · 11 comments
Milestone

Comments

@alexryan
Copy link

I am trying to build on an arm 64 bit platform.
Following these instructions .

I have successfully built grpc-java
but only by adding skipCodegen=true to gradle.properties.

I have succesfully build protobuf on the platform as well
by following the instructions on the same page.

however, after building protobuf, when I go back I try to build grpc-java without the gradle properties file, I get this error ...

ubuntu@tegra-ubuntu:~/grpc-java3/grpc-java$ ./gradlew build
*** Building codegen requires Protobuf version 3.0.0
*** Please refer to https://github.com/grpc/grpc-java/blob/master/COMPILING.md#how-to-build-code-generation-plugin

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':grpc-compiler'.
> Exception thrown while executing model rule: NativeComponentModelPlugin.Rules#createBinaries(TargetedNativeComponentInternal, PlatformResolvers, BuildTypeContainer, FlavorContainer, ServiceRegistry)
   > Invalid NativePlatform: linux_aarch64

It appears that this code generation plugin is a necessary component to tensorflow.
I need to get tensorflow installed on this machine [nvidia jetson tk1], so I need to find a way to build this plugin.
Any suggestions?

ubuntu@tegra-ubuntu:~/grpc-java3/grpc-java$ java -version
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

ubuntu@tegra-ubuntu:~/grpc-java3/grpc-java$ uname -a
Linux tegra-ubuntu 3.10.96-tegra #1 SMP PREEMPT Tue May 17 16:29:05 PDT 2016 aarch64 aarch64 aarch64 GNU/Linux

ubuntu@tegra-ubuntu:~/grpc-java3/grpc-java$ lsb_release -d
Description:    Ubuntu 14.04.5 LTS
ubuntu@tegra-ubuntu:~/grpc-java3/grpc-java$ 

the hardware is
nvidia jetson tk1 dev kit.
this has a GPU
but the CPU is one of these ...
NVIDIA 4-Plus-1™ Quad-Core ARM® Cortex™-A15 CPU

@ejona86
Copy link
Member

ejona86 commented Aug 25, 2016

Take a look at this thread on grpc-io mailing list (which references another thread).

@ghost
Copy link

ghost commented Sep 6, 2016

It's not at all clear from that thread what to add to the config. As far as I can tell, gradle currently doesn't support e.g. arm-v7. Given that Bazel is now available, and it can (in earlier versions, pre 0.3.x) be bootstrapped on arm-v7 fairly easily, why not use Bazel to build grpc as well? Because of this issue it is currently not possible to build Bazel 0.3.x -- it wants GRPC Java, and GRPC Java can't be built on arm-v7. Checkmate.

@ejona86 ejona86 added this to the Next milestone Sep 15, 2016
@ejona86
Copy link
Member

ejona86 commented Sep 30, 2016

I got this working on my odroid-c2 (aarch64):

diff --git a/compiler/build.gradle b/compiler/build.gradle
index c0ffd4a..ff7c87d 100644
--- a/compiler/build.gradle
+++ b/compiler/build.gradle
@@ -47,6 +47,7 @@ model {
       }
     }
     gcc(Gcc) {
+      target("unknown")
     }
     clang(Clang) {
     }
@@ -59,6 +60,7 @@ model {
     x86_64 {
       architecture "x86_64"
     }
+    unknown {}
   }

   components {
@@ -67,6 +69,8 @@ model {
         // If arch is not within the defined platforms, we do not specify the
         // targetPlatform so that Gradle will choose what is appropriate.
         targetPlatform arch
+      } else {
+        targetPlatform "unknown"
       }
       baseName "$protocPluginBaseName"
     }

I also stumbled upon @alexryan's gradle thread that also has a solution. I'd like to tweak my solution slightly so that it is obvious the arch variable was ignored before sending out a PR.

@ejona86
Copy link
Member

ejona86 commented Sep 30, 2016

Also note: ./gradlew build is a bit more annoying now-a-days for arm because it can't locate protoc-gen-javalite. You can do ./gradlew assemble to avoid the tests and that dependency. Otherwise you'd need to build the javalite protobuf branch. I did do that when I was testing, so I know it works, but it adds yet another step.

@alexryan
Copy link
Author

This solution works as well ...
https://www.neotitans.net/install-tensorflow-on-odroid-c2.html

@ejona86
Copy link
Member

ejona86 commented Sep 30, 2016

@alexryan, where is the grpc-java.v0.15.0.patch referenced in that guide?

@alexryan
Copy link
Author

@xzy256
Copy link

xzy256 commented May 18, 2017

@alexryan @ejona86 @Variac When i build grpc-java for mips64el, i get error. part of outputs as follow.

10:43:58.176 [INFO] [com.google.gradle.osdetector.OsDetector] ------------------------------------------------------------------------
10:43:58.179 [INFO] [com.google.gradle.osdetector.OsDetector] Detecting the operating system and CPU architecture
10:43:58.180 [INFO] [com.google.gradle.osdetector.OsDetector] ------------------------------------------------------------------------
10:43:58.181 [INFO] [com.google.gradle.osdetector.OsDetector] os.detected.name=linux
10:43:58.182 [INFO] [com.google.gradle.osdetector.OsDetector] os.detected.arch=unknown
10:43:58.184 [DEBUG] [org.gradle.configuration.project.BuildScriptProcessor] Timing: Running the build script took 0.487 secs
10:43:58.188 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
10:43:58.189 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
10:43:58.189 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
10:43:58.190 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Where:
10:43:58.190 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Build file '/home/xzy/grpc-java/build.gradle' line: 85
10:43:58.190 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
10:43:58.191 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
10:43:58.191 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] A problem occurred evaluating root project 'grpc'.
10:43:58.192 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > unknown os.arch: mips64el
10:43:58.192 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
10:43:58.193 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
10:43:58.193 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --stacktrace option to get the stack trace. 
10:43:58.194 [LIFECYCLE] [org.gradle.internal.buildevents.BuildResultLogger] 
10:43:58.194 [LIFECYCLE] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED
10:43:58.195 [LIFECYCLE] [org.gradle.internal.buildevents.BuildResultLogger] 
10:43:58.195 [LIFECYCLE] [org.gradle.internal.buildevents.BuildResultLogger] Total time: 4.834 secs

our environment:

arch :mips64el
protocbuf:3.2.0(build github source by myself)
java:openJDK1.8.0_25

'/home/xzy/grpc-java/build.gradle' 85 rows

 84     ext {
 85         def exeSuffix = osdetector.os == 'windows' ? ".exe" : ""

osdetector.os occur the error, should i build osdetector-java-plugin? could you give me any ideas?

@xzy256
Copy link

xzy256 commented Jun 6, 2017

I have solved my build error. Build os-maven-plugin for mips64 arch support, then osdetector.os and osdetector.name can be recognized. Building os-maven-plugin for mips64 infers os-maven-plugin-mips64.patch

@ejona86
Copy link
Member

ejona86 commented Jun 22, 2017

Bazel build support was just added in #2975. I'd be interested if that makes life easier here. Yes, we still don't have official binaries for ARM, but Bazel users might not care any more.

@ejona86
Copy link
Member

ejona86 commented May 3, 2021

This was fixed by #6441

@ejona86 ejona86 closed this as completed May 3, 2021
@ejona86 ejona86 modified the milestones: Next, 1.27 May 3, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants