4
votes

I've seen the use of Java to access CUDA api, however

  • Is there any implementation that runs the whole JVM in a GPU (perhaps using the CUDA API)?
  • Or, will there be any plans of doing this?
  • If so, will the performance be enough to run both client or server applications?
  • Most importantly what are the issues that will make the JVM impossible to run in a GPU?

The advantage I'm seeing here is that, I can buy a decent NVidia GPU and be able to run Java application without much processing on the CPU, thus saving the CPU for some other utilization.

However, if this would not be possible, is there any way to force the JVM to offload processing to the GPU with CUDA without the need to recompile a Java application to support CUDA? I mean like adding VM arguments?

2
To my knowledge there there is no JIT targetting CUDA. There is, however, several OpenGL bindings. Have you considered looking into OpenCL? - Thorbjørn Ravn Andersen
@ThorbjørnRavnAndersen: The LLVM have PTX backend ( pressroom.nvidia.com/easyir/… ). Also PTX is JITted into SASS inside driver. - Maciej Piechotka
@MaciejPiechotka no Java-JIT. - Thorbjørn Ravn Andersen

2 Answers

6
votes

The main problem you have is that CUDA is designed to do something simple many many times. E.g. it typically runs one method on every core. You can't have different cores running different code. This doesn't mean that some code couldn't be optimized to run on a CUDA processor. e.g. vector operations, but running the entire JVM on a GPU is not what it was designed for.

BTW: CUDA processors don't support IO which is where most servers spend a large portion of their time. e.g. reading/writing to disk and to the network.

0
votes

But we can have something like a graph traversal implemented in CUDA as the mutliple traversals can be done in multiple nodes. Here if jvm has support for incorporating CUDA we can have programs similiar to map-red within a single machines which can do parallel processing. This highly advantage for graph based databases which does SPARQL queries