Getting Started with TornadoVM Using SDKMAN!

Share this on social media…

This blog is cross-posted from tornadovm.org

Installing and configuring tools for heterogeneous computing can often be complicated. TornadoVM simplifies this process by allowing Java developers to automatically accelerate Java programs on CPUs, GPUs, and other accelerators — using standard Java.

In this guide, we show how to start with TornadoVM from scratch using SDKMAN!, the recommended way to install and manage TornadoVM and its dependencies.


Start using TornadoVM via SDKMAN!

TornadoVM is distributed through our official website and SDKMAN!. Install a version that matches your OS, architecture, and accelerator backend.

ree

To install TornadoVM via SDKMAN! you can follow the steps below.

  • Step 1: Install TornadoVM with SDKMAN!

All TornadoVM SDKs are available on the SDKMAN! TornadoVM page.

You can choose a backend-specific build:

BackendSDKMAN! Latest Version
OpenCL2.2.0-opencl (default)
PTX2.2.0-ptx
SPIR-V2.2.0-spirv
All Backends2.2.0-full

To install TornadoVM, open a terminal and run:

sdk install tornadovm 2.2.0-opencl

After installation, SDKMAN! automatically sets the TORNADOVM_HOME environment variable.

  • Step 2: Install Java (Only If Needed)

TornadoVM runs on JDK 21.

If Java is already installed on your system and JAVA_HOME is set, you can skip this step.

Otherwise, install and configure Java using SDKMAN!:

sdk install java 21.0.9-tem

SDKMAN! will automatically set JAVA_HOME and make the JDK available to TornadoVM.

  • Step 3: Verify Available Devices

Once TornadoVM is installed, verify that your system detects the available hardware accelerators.

Run the following command:

tornado --devices

This command lists all devices recognized by TornadoVM, including CPUs and GPUs. If your accelerator appears in the output, your system is ready.

  • Step 4: Run Your First TornadoVM Program

TornadoVM includes example applications that demonstrate how Java programs can be accelerated transparently.

A simple starting point is a Matrix-Vector multiplication example.

Linux / macOS

java @$TORNADOVM_HOME/tornado-argfile -cp $TORNADOVM_HOME/share/java/tornado/tornado-examples-2.2.0.jar uk.ac.manchester.tornado.examples.compute.MatrixVectorRowMajor

Windows (10+)

java @%TORNADOVM_HOME%\tornado-argfile -cp %TORNADOVM_HOME%\share\java\tornado\tornado-examples-2.2.0.jar uk.ac.manchester.tornado.examples.compute.MatrixVectorRowMajoruk.ac.manchester.tornado.examples.compute.MatrixVectorRowMajor

This program runs a Java application that TornadoVM automatically offloads to available accelerators.

What’s Next?

After running your first program, you can:

  • Explore more TornadoVM examples
  • Integrate TornadoVM into your own Java projects
  • Learn the Loop Parallel API and Kernel API

Full documentation is available here:https://tornadovm.readthedocs.io/en/latest/

Final Thoughts

Using SDKMAN!, getting started with TornadoVM takes only a few commands. Once installed, TornadoVM allows Java developers to take advantage of heterogeneous hardware without rewriting applications in specialized languages.

If you know Java, you are ready to start accelerating your applications with TornadoVM.

Happy accelerating 🚀

Share this on social media…