Has anyone tried running GraalVM on the RoboRIO?

I have been tracking the progress of GraalVM because I am constantly paranoid about the resource load that is caused by my team’s on-rio processes.

I can confirm that the GraalVM profiler works with the GradleRIO/JVM setup when remote profiling from an external linux machine, but that is all the Graal-related testing I have done.

Things I am curious about:

  • AOT Java compilation should reduce overhead of JVM, as most of the work is already done, and there is just a stripped VM running inside of the compiled native binary
  • GraalVM allows Java and native libraries to mesh with eachother natively instead of through something like JNI. I am interested in this for two reasons (correct me if im wrong):
    • This should let us use some dependencies that are vital to the 5024 codebase like Eigen and Drake without needing to write a JNI wrapper
    • This should allow me to create Java -> C++ bindings of our team library without needing to embed a JVM in the C++ application (I have a few personal projects written in c-family languages, and using a completely separate buildsystem from the core library)
  • GraalVM should allow us to write high-level autonomous scripts through its Python3 interface. This may actually allow us to write a very high level library, and let our strategy team write the autonomous scripts instead of that being a pure software-dev task during build season.

I have seen some talk in the GraalVM and OpenJDK GitHub repos about getting the new VM to run on arm systems, and it seems that the OpenJDK-11 package for armv7l already has the core GraalVM compiler built in?

Anyways, I’m mostly just sharing something I have been thinking about in case anyone else wants something to play around with or knows something I don’t about the progress of GraalVM on arm 32 systems.

1 Like

Sounds neat. We discussed Graal in April of last year, but Graal didn’t support armv7 at the time. Has that changed? I don’t see a mention of armv7 on Graal’s website. Getting started with GraalVM says:

GraalVM is available as GraalVM Community and GraalVM Enterprise editions. GraalVM Community editions are based on OpenJDK version 1.8.262 and on OpenJDK version 11.0.8. GraalVM Enterprise editions are based on Oracle JDK version 1.8.0_261 and on Oracle JDK version 11.0.8. GraalVM distributions are available for Linux, macOS and Windows platforms on AMD64 systems and for the Linux platform on AARCH64 systems.


WPILib is standardizing on EJML for linear algebra in Java and has a JNI for Drake’s DARE solver already.

We’re merging some state-space Java classes that use it once we finish some subproject refactoring.

As @calcmogul pointed out, GraalVM doesn’t have armv7 support, and from this issue it doesn’t look like anyone is actively working on it: GraalVM on ARMv7 32 bits · Issue #1329 · oracle/graal · GitHub

In other words, if you want to run graal on armv7 you not only need an JVMCI-enabled OpenJDK runtime for armv7 to bootstrap it with (e.g. the jdk dev tree that Doug pointed you at) but you also need to implement from scratch armv7 equivalents of all the x86- or aarch64-specific code in the compiler and substratevm directories.

Sticking with the new WPILib stuff is probably the best idea tbh :laughing: , but I have been on a roll of implementing everything from scratch for my team’s core library. Mostly as a learning exercise.

I just enjoy dropping down as close to “the metal” as I can, and building a framework back up to a high level i guess.

I have lost the actual form post I am thinking of, but this was one of the pages I referenced. Seems that the compiler is built in to OpenJDK, but the actual VM is not arm32 supported because they use 64-bit ints internally. But someone had a patch for that irrc