Questions tagged [jcuda]

Java bindings for the CUDA runtime and driver API. The JCuda Runtime API is mainly intended for the interaction with the Java bindings of the the CUDA Runtime libraries, like JCublas and JCufft instead of creating own kernels. Own CUDA kernels can be launched in JCuda using the Driver API.

With JCuda it is possible to interact with the CUDA runtime and driver API from Java programs. JCuda is the common platform for libraries such as JCublas, JCufft, JCudpp, JCurand and JCusparse. The JCuda Runtime API is mainly intended for the interaction with the Java bindings of the the CUDA Runtime libraries as mentioned above instead of creating own kernels. Java program cannot be compiled using NVCC(NVIDIA CUDA Compiler), hence own CUDA kernels can be launched in JCuda using the Driver API.

For Jcuda to work the CUDA driver and toolkit has to be first installed from http://developer.nvidia.com/cuda-toolkit-archive based on the desired version that suits your GPU. Then Jcuda can be downloaded from http://www.jcuda.org/downloads/downloads.html. Set the jar files location to the CLASSPATH (either a path that is java.library.path for the JVM, or the root directory of project).

Useful links

78 questions
15
votes
1 answer

How to implement handles for a CUDA driver API library?

Note: The question has been updated to address the questions that have been raised in the comments, and to emphasize that the core of the question is about the interdependencies between the Runtime- and Driver API The CUDA runtime libraries (like…
Marco13
  • 53,703
  • 9
  • 80
  • 159
4
votes
1 answer

JIT in JCuda, loading multiple ptx modules

I said in this question that I had some problem loading ptx modules in JCuda and after @talonmies's idea, I implemented a JCuda version of his solution to load multiple ptx files and load them as a single module. Here is the related part of the…
AmirSojoodi
  • 1,080
  • 2
  • 12
  • 31
4
votes
1 answer

cuMemcpyDtoH yields CUDA_ERROR_INVALID_VALUE

I have a very simple scala jcuda program that adds a very large array. Everything compiles and runs just fine until I want to copy more than 4 bytes from my device to host. I am getting CUDA_ERROR_INVALID_VALUE when I try to copy more than 4…
Dr.Knowitall
  • 10,080
  • 23
  • 82
  • 133
4
votes
1 answer

Operations with complex matrices using jCUDA

What is the best way to operate with complex numbers using jCuda? Should I use cuComplex format or is there any other solution (like an array with real and imaginary parts going one after another)? I would really appreciate examples of java code…
4
votes
1 answer

Draw image from vertex buffer object generated with CUDA using OpenGL

I am using CUDA to generate this ABGR output image. The image in question is stored in a uchar4 array. Each element of the array represents the color of each pixel in the image. Obviously, this output array is a 2D image but it is allocated in CUDA…
Maghoumi
  • 3,295
  • 3
  • 33
  • 49
4
votes
2 answers

Debug JCuda program

I'd like to know what is the best debugger for a JCuda project (if exists). I know that for normal CUDA applications there are tools like cuda-gdb and cuda-memcheck and I wonder if I can use any of them or similar ones for a JCuda project. Thank…
Rorrim
  • 190
  • 2
  • 7
3
votes
1 answer

Convert cudaStream_t object to CUStream object

Is there any way to convert cudaStream_t object to CUStream? I found this hack but I don't think its safe to use. Or, is there any way to call cudaLaunchKernel in JCuda application using cudaStream_t object in CUDA 7.5 only?
sandeep.ganage
  • 1,409
  • 2
  • 21
  • 47
3
votes
1 answer

Loading multiple modules in JCuda is not working

In jCuda one can load cuda files as PTX or CUBIN format and call(launch) __global__ functions (kernels) from Java. With keeping that in mind, I want to develop a framework with JCuda that gets user's __device__ function in a .cu file at run-time,…
AmirSojoodi
  • 1,080
  • 2
  • 12
  • 31
3
votes
1 answer

How error handling is done in Jcuda?

In CUDA we can get to know about errors simply by checking return type of functions such as cudaMemcpy(), cudaMalloc() etc. which is cudaError_t with cudaSuccess. Is there any method available in JCuda to check error for functions such as…
krishna
  • 413
  • 2
  • 10
  • 25
2
votes
2 answers

Is it possible to send data to GPU memory which is defined as Union, from JCuda?

I have defined a new data type like this in GPU side (cuda): typedef union { int i; double d; long l; char s[16]; } data_unit; data_unit *d_array; And in Java, we have an array of one of the kinds available in the defined union.…
AmirSojoodi
  • 1,080
  • 2
  • 12
  • 31
2
votes
0 answers

How to get Mavenized JCuda, Eclipse, and Windows to work together?

NVidia does not distribute the NSight IDE for Windows (only Linux and MacOSX) I don't want to use Visual Studio because I'm not familiar with it; being a Java developer I prefer Eclipse. I want to use Maven, because well everyone should, and…
James Watkins
  • 4,806
  • 5
  • 32
  • 42
2
votes
1 answer

JCuda: copy multidimensional array from device to host

I've been working with JCuda for some months now and I can't copy a multidimensional array from device memory to host memory. The funny thing is that I have no problems in doing so in the opposite direction (I can invoke my kernel with…
Rorrim
  • 190
  • 2
  • 7
2
votes
1 answer

What is the easiest way to run working CUDA code in Java?

I have some CUDA code I made in C and it seems to be working fine (it's plain old C and not C++). I’m running a Hadoop cluster and wanted to consolidate my code so ideally I’m looking to run it within Java (long story short: system is too…
user1735075
  • 3,221
  • 4
  • 16
  • 16
2
votes
1 answer

Is it safe to call jcuda.driver.JCudaDriver/cuInit multiple times in a program?

I'm using a dynamic language (Clojure) to create CUDA contexts in a interactive development way using JCuda. Often I will call an initializer that includes the call to jcuda.driver.JCudaDriver/cuInit. Is it safe to call cuInit multiple times? In…
bmillare
  • 4,183
  • 2
  • 23
  • 42
2
votes
1 answer

JCuda Compiler Error

I have started using JCuda.When I compile the program I get "jcuda.cuda exception cuda_error_launch_failed" error.I have followed the steps given in the installation guide but doesn't work.Very few resources are available online.So,Please help…
user1633170
  • 11
  • 2
  • 13
1
2 3 4 5 6