Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Deepak-Sangle/TornadoVM/llms.txt

Use this file to discover all available pages before exploring further.

TornadoVM runs on any Linux-based cloud VM, including AWS instances equipped with NVIDIA or AMD GPUs. GPU-equipped instances unlock the full range of OpenCL and CUDA backends, while CPU-only instances can still execute kernels via the OpenCL CPU device.

Running on AWS for CPUs and GPUs

The installation and execution instructions for running TornadoVM on AWS CPU and GPU instances are identical to those for running locally. There is no cloud-specific build process or runtime configuration. Follow the standard installation guide to build TornadoVM on your cloud instance:

Installation Guide

Step-by-step instructions for cloning, building, and verifying TornadoVM on Linux — applicable to any AWS instance.

Quick-start on a fresh GPU instance

The steps below apply to a fresh Ubuntu 22.04 LTS EC2 instance with NVIDIA GPU. They mirror the local Linux setup exactly.
1

Connect to the instance

ssh -i ~/.ssh/my-key.pem ubuntu@<INSTANCE_PUBLIC_IP>
2

Install NVIDIA drivers (GPU instances)

If using a plain Ubuntu AMI, install the NVIDIA driver and reboot:
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install -y nvidia-driver-525
sudo reboot
After reboot, verify the driver is loaded:
nvidia-smi
AWS Deep Learning AMIs (DLAMIs) come with NVIDIA drivers and CUDA pre-installed. If you use a DLAMI, skip the driver installation step.
3

Install Java 21 and build dependencies

sudo apt-get install -y \
  openjdk-21-jdk \
  cmake \
  maven \
  python3 \
  git
4

Clone and build TornadoVM

git clone https://github.com/beehive-lab/TornadoVM.git
cd TornadoVM

# Build with CUDA + OpenCL backends (GPU instance)
make BACKEND=opencl,cuda

# Or OpenCL only (CPU-only instance)
make BACKEND=opencl
5

Load the TornadoVM environment

source setvars.sh
Add to ~/.bashrc for persistence across SSH sessions:
echo "source ~/TornadoVM/setvars.sh" >> ~/.bashrc
6

Verify the installation

# List detected devices
tornado --devices

# Run a quick sanity check
tornado -m tornado.examples/uk.ac.manchester.tornado.examples.VectorAddInt 1024

CPU-Only Cloud Instances

TornadoVM works on CPU-only instances through the OpenCL CPU device. This is useful for unit testing, debugging, and CI/CD pipelines where GPU availability is not guaranteed.
# Build with only the OpenCL backend (no CUDA needed)
make BACKEND=opencl

source setvars.sh

# List devices — you should see the CPU OpenCL device
tornado --devices

# Force execution on the CPU OpenCL device (device 0:0 is typically the first device)
tornado --jvm="-Ds0.t0.device=0:0" \
  -m tornado.examples/uk.ac.manchester.tornado.examples.compute.MatrixMultiplication2D 256
CPU OpenCL performance is generally lower than native Java for small data sizes due to kernel compilation and data-transfer overhead. Test with sufficiently large arrays to see meaningful speedups.

Environment Variables Reference

Set these in ~/.bashrc or your CI/CD environment configuration. Running source setvars.sh sets all of them automatically.
VariableDescriptionExample Value
JAVA_HOMEPoints to the JDK managed by TornadoVM$TORNADOVM_HOME/etc/dependencies/TornadoVM-graal-jdk-21/.../
TORNADOVM_HOMERoot of the TornadoVM checkout/home/ubuntu/TornadoVM
TORNADO_SDKPath to the compiled SDK$TORNADOVM_HOME/bin/sdk
PATHMust include $TORNADO_SDK/binManaged by setvars.sh
LD_LIBRARY_PATHNative library path for GPU backends$TORNADO_SDK/lib

Build docs developers (and LLMs) love