Project Sumatra juices up Java performance via OpenCL graphics card acceleration

The OpenJDK-backed project is currently working to harness the parallel processing power of integrated and discrete graphics cards to speed up Java applications. GPU acceleration is not a new concept, but this project is interesting because of the way it works and the future implications of the research.

First revealed in August, Project Sumatra uses the features and libraries of Java 8’s Lambda Project as well as Oracle’s HotSpot for the Java Virtual Machine. (Lambda is a set of expressions for the Java programming language that is intended to improve multi-core support).

In order to take advantage of GPU acceleration, software developers will need to annotate their code to indicate which lambda expressions are suited to the parallel nature of GPUs. Then, when you run a Java application on a system with an OpenCL-compatible GPU installed, the HotSpot JIT (just-in-time) compiler will translate the annotated bits of code to OpenCL for processing on the GPU rather than the CPU.

This is an interesting method as it will require relatively simple updates to applications in order to take advantage of GPU hardware acceleration, and it will be invisible to the end user. Granted, not every application will see massive performance increases – if they can be parallelised at all – but many will be able to benefit from harnessing the GPU to some extent.

The developers behind the Sumatra project are currently focusing on developing OpenCL support with Java 8 technologies, but they expect the development research to influence GPU hardware acceleration with other JVM-hosted languages like JRuby and Scala.

The potential here is impressive, especially considering the proliferation of GPUs capable of running OpenCL code – a number that should continue to grow. AMD and Nvidia have fleets of discrete cards, AMD and Intel have graphics cores integrated into CPUs, and future ARM SoCs may support the technology as well.

Future Java versions integrating the technology should allow customers to put their hardware to use as efficiently as possible. AMD APU-based servers, and mobile smartphones and tablets, will benefit from GPU acceleration the most. AMD and the HSA Foundation have similar goals, and have demonstrated increased performance by harnessing the power of the GPU for parallel tasks. Project Sumatra is further making it easier for developers and end users of programs written in Java to realise those potential performance gains.

Oracle Vice President of Software Development for the Java Platform Group, Georges Saab, has stated that: “We expect our work with AMD and other OpenJDK participants in Project ‘Sumatra’ will eventually help provide Java developers with the ability to quickly leverage GPU acceleration for better performance.”

On the mobile side, we have tablet processors like AMD’s Z-60 APU and upcoming Valley View SoCs from Intel that would benefit from GPU accelerated Java by being able to process data faster and return to a lower-power idle state to conserve battery. And, of course, the user experience should improve by having applications run faster.

It will likely be at least another year before GPU acceleration is baked into the official Java Runtime Environment, but with Project Sumatra we are well on our way to speeding up Java!

To stay updated or get involved, hit up the Project Sumatra website or join the sumatra-dev mailing list.