Does JCUDA support multiple GPUs?

Help,

I’ve been trying to get JCUDA to use multiple GPUs simultaneously? Is this possible?

The best I’ve gotten is to specify which GPU to use by manipulating the environmental variable CUDA_VISIBLE_DEVICES, but I have not been able to run cuInit() with an index other than 0.

What should I do?

Thanks.

-David Tcheng
NCSA

Hello

It should, of course, support multiple GPUs - and basically everything else that CUDA supports (despite some limitations for asynchronous operations). But the value given as a parameter for cuInit is NOT the device index, but the initialization flags (and it must be 0 at the moment). If you have multiple devices, it should be possible to obtain a handle to the second device with

CUdevice secondDevice = new CUdevice();
cuDeviceGet(secondDevice, 1);

(also see cuDeviceGet vs. cuInit.

If you encounter any problems, I can try to run a test at my workplace next week, there I can occasionally use a 2-GPU PC.

bye
Marco

Marco,

Thanks, for your response. I am noW HAPPILY RUNNING JCUDA ON SIX GPUS USING A SINGLE JAVA THREAD TO CONTROL THEM!!!

-David Tcheng

P.S. Cuda 4.1 just came out… Will JCuda work with 4.1? :slight_smile:

Hey, sounds like fun :smiley:

I also just received the mail about CUDA 4.1. Of course, JCuda will support CUDA 4.1, but it will require a recompilation of the native libraries. I’m not sure when I will find the time for the update. Actually, it should not take too long, but considering the pending update to CUBLAS2 and the implementation of JNpp, and the fact that NVIDIA does not give a roadmap for the final release, I still have to see what’s the best „strategy“ for the release of the next version.

bye
Marco

Is JCUDA is a open source ?How to get the JCUDA software???

Hello

This forum is about JCuda from http://jcuda.org/

JCuda from http://jcuda.org/ is open source. The source code is available at the website.
jCUDA from http://www.cass-hpc.com/solutions/legacy/jcuda is not open source (and no longer maintained)
JCUDA from JCUDA: A Programmer-Friendly Interface for Accelerating Java Programs with CUDA is not open source, and as far as I know, not even the library itself is publicly available.

bye
Marco