Frequently Asked Questions

1. What can TornadoVM do?

TornadoVM accelerates parts of your Java applications on heterogeneous hardware devices such as multicore CPUs and GPUs.

TornadoVM is currently being used to accelerate machine learning and deep learning applications, computer vision, physics simulations, financial applications, computational photography, natural language processing and signal processing.

2. Can I use TornadoVM in a commercial application?

Absolutely yes! TornadoVM is licensed under the Apache License, Version 2.0 — the API, runtime, compiler and drivers alike — so it can be freely used in any application.

3. How can I use it?

You can be running a TornadoVM example on a GPU in three commands:

# 1. Install with SDKMAN!
$ sdk install tornadovm

# 2. Verify devices
$ tornado --devices

# 3. Run an example
$ java @$TORNADOVM_HOME/tornado-argfile -cp $TORNADOVM_HOME/share/java/tornado/tornado-examples-5.0.0-jdk21.jar uk.ac.manchester.tornado.examples.compute.MatrixVectorRowMajor

See Quick Install (recommended) for all install options (SDKMAN!, the official downloads page, Maven Central, or Docker images), or Building from Source if you want to build TornadoVM yourself.

List of compatible JDKs

TornadoVM currently supports:

  • JDK 21 (e.g. OpenJDK 21, Red Hat Mandrel 21, Amazon Corretto 21, Azul Zulu JDK 21), via the jdk21 build profile.

  • JDK 22 and newer, including JDK 27, via the single jdk22plus build profile. TornadoVM no longer depends on JVMCI, so this SDK is built once and runs on any JDK from 22 upwards rather than being tied to one release.

  • Any JDK 21 distribution, GraalVM included, with the jdk21 build profile.

Windows

To run TornadoVM on Windows 10/11 OS, more information here: Windows 10/11.

ARM Mali GPUs and Linux

To run TornadoVM on ARM Mali, install TornadoVM with GraalVM and JDK 21. More information here: ARM Mali GPUs.

Usage

4. Which programming languages does TornadoVM support?

TornadoVM primarily supports Java (Polyglot support was removed after the 5.2.0 release; to call TornadoVM-compatible Java code from other programming languages via GraalVM’s polyglot runtime, e.g. Python, R, Ruby, Javascript, Node.js, use TornadoVM <= 5.2.0).

5. Is TornadoVM a Domain Specific Language (DSL)?

No, TornadoVM is not a DSL. It compiles a subset of Java code to OpenCL C, NVIDIA CUDA C, and Apple Metal.

To express parallelism, TornadoVM offers three APIs: the Loop Parallel API (@Parallel and @Reduce annotations), the lower-level KernelContext API (KernelContext, for explicit control over thread IDs, local memory and barriers), and the TileContext API (TileContext, NVIDIA CUDA backend only, where a tile of a tensor rather than a thread is the unit of work). In addition, TornadoVM offers an API to:

  1. Create and define task-graphs with the Task-Graph API (groups of Java methods to be accelerated by TornadoVM, and the data involved).

  2. Define execution plans.

6. Does it support the whole Java Language?

No, TornadoVM supports a subset of the Java programming language. A list of unsupported features along with the reasoning behind it can be found here: Unsupported Java Features.

7. Can TornadoVM degrade the performance of my application?

No, TornadoVM cannot degrade the performance of your application: if a particular code segment cannot be accelerated, execution falls back to the host JVM, which runs your code on the CPU exactly as it would without TornadoVM.

With Dynamic Reconfiguration opted into (see Dynamic Reconfiguration (Research Feature)), TornadoVM can also discover the fastest available device for a particular code segment.

8. Does TornadoVM support only OpenCL devices?

No. Currently, TornadoVM supports multiple compiler backends and therefore, it is able to generate OpenCL C, CUDA C (compiled to PTX via NVRTC), and Metal code depending on the hardware configuration.

9. Why is it called a VM?

The VM name is used because TornadoVM implements its own set of bytecodes for handling heterogeneous execution. These bytecodes are used for handling JIT compilation, device exploration, data management and live task-migration for heterogeneous devices (multi-core CPUs and GPUs). We sometimes refer to a VM inside a VM (nested VM). The main VM is the Java Virtual Machine, and TornadoVM sits on top of that.

You can find more information here: https://dl.acm.org/doi/10.1145/3313808.3313819.

10. How does it interact with OpenJDK?

TornadoVM runs on a standard JDK as a set of Java modules and uses no JDK-internal interfaces. At run time its own compiler, TC, reads the bytecode of the task methods and generates OpenCL C, NVIDIA CUDA C and Apple Metal source, which the device driver compiles.

11. How do I know which parts of my application are suitable for acceleration?

Workloads with for-loops that do not have dependencies between iterations are very good candidates to offload on accelerators. Examples of this pattern are NBody computation, Black-scholes, DFT, KMeans, etc.

Besides, matrix-type applications are good candidates, such as matrix-multiplication widely used in machine and deep learning.

12. How can I contribute to TornadoVM?

TornadoVM is an open-source project, and, as such, we welcome contributions from all levels.

  • Solve issues reported on the GitHub page.

  • Work on New Proposals: We welcome new proposals and ideas. To work on a new proposal, use the discussion page on GitHub. Alternatively, you can open a shared document (e.g., a shared Google doc) where we can discuss and analyse your proposal.

Here you can find more information about how to contribute, code conventions, and tasks. See also Developer Guidelines for how to build from source, configure your IDE, and set up code formatting and pre-commit hooks.

13. Does TornadoVM support calls to standard Java libraries?

Partially yes. TornadoVM currently supports calls to the Math library. However, invocations that imply I/O are not supported. Note that this restriction also applies to low-level parallel programming models such as OpenCL, SYCL, oneAPI and CUDA.

14. Do I need a GPU to run TornadoVM?

No. TornadoVM can also run on multi-core CPUs. What TornadoVM needs is a compatible driver/runtime installed in the machine. For example, to enable TornadoVM getting access to an Intel CPU, developers can use the Intel CPU Runtime for OpenCL (also part of the Intel oneAPI Base Toolkit).