What JVM can run on CPU and GPU?

Viewed 1410

What JVM runs on a CPU + GPU?

I know JVM like Oracle, Zulu, OpenJDK but none is designed to offload processing to GPU.

2 Answers

AFAIK, no JVM can automagically off-load work to a GPU (apart from cases where the GPU is used for graphics ...)

But there are various ways to use GPUs from Java. This Q&A has a good summary:

There is one, https://www.tornadovm.org/ but not sure how mature.

TornadoVM can currently execute on multi-core CPUs, dedicated GPUs (Nvidia, AMD), integrated GPUs (Intel HD Graphics and ARM Mali), and FPGAs (Intel and Xilinx).

Backend wise (not all OSes support all these):
--opencl: Enables the OpenCL backend (requires OpenCL drivers)
--ptx: Enables the PTX backend (requires NVIDIA CUDA drivers)
--spirv: Enables the SPIRV backend (requires Intel Level Zero drivers)
Related