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
1
vote
0 answers

Using SpringBoot with Nvidia GPU (CUDA)

I am working on how to offload some workload to GPU using CUDA in SpringBoot project. To help me explain my question better, let me suppose that we want to implement a REST API to do matrix-vector multiplication in SpringBoot application. We need to…
Frank Fang
  • 11
  • 1
1
vote
0 answers

JCuda example files errors

I am comletelly new to JAVA GPU thing (JCuda), trying to test and understand how JCuda works and if it can be any useful to my needs (JAVA renderer), so I downloaded JCuda examples and loaded them into NetBeans 8. But when I try to run any of the…
qraqatit
  • 492
  • 4
  • 14
1
vote
1 answer

Cannot use cuMemcpyHtoDAsync and cuMemcpyDtoHAsync at the same time

I have a rather strange observation on the following code snippet. When I do both - copy memory to device and copy results back to host the streams seem to be synronized - i.e. they execute the kernel sequentially. Once I remove the copy to host and…
eLe
  • 51
  • 5
1
vote
1 answer

Jcuda CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES (Too Many Parameters?)

When I call the function, cuLaunchKernel(), my program crashes with the error, CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES. Is this because I'm passing 29 parameters to my kernel? If so, is there any work around? I am pretty certain that I need these…
1
vote
1 answer

How to solve 'Maven cannot resolve dependencies' on ARM architecture?

My java project is working properly on classical architecture, i.e. Von Neumann architecture. However, maven is unable to resolve dependencies on my Jetson AGX, i.e. ARM architecture. What do I need to change to compile my project on the ARM…
Theophile Champion
  • 453
  • 1
  • 4
  • 20
1
vote
1 answer

CUDA (JCUDA) shared memory (?) problems / undefined behaviour

I'm working on my game project (tower defense) and I'm trying to compute the distance between all critters and a tower with JCuda using shared memory. For each tower I run 1 block with N threads, where N equals the number of critters on the map. I'm…
PeetP
  • 137
  • 4
  • 13
1
vote
1 answer

Exception in thread "main" java.lang.NoClassDefFoundError: jcuda/driver/JCudaDriver

I am trying to set up JCuda and execute a Sample addition kernel. When I try to execute JCudaVectorAdd after compiling JCudaVectorAdd.java, I am getting the following error: Exception in thread "main" java.lang.NoClassDefFoundError:…
Trever Wagenhals
  • 381
  • 5
  • 14
1
vote
1 answer

How to compile and run JCUDA in netbeans?

I want to compile and run my jcuda codes in an IDE (Netbeans) on ubuntu 16.04. I've already installed Netbeans, Maven, java and cuda 8.0. For example, I want to run sample of vector add that the java file is JCudaVectorAdd.java and the cuda kernel…
1
vote
1 answer

The specified procedure could not be found: for jcuda 9.2

I am attempting to load the dll for the JCudaDriver which I extracted with the jar.exe tool. System.loadLibrary("JCudaDriver-0.9.2-windows-x86_64") That driver is definitely in my java.libary.path because if I remove it manually, I get a not-found…
J.E.Tkaczyk
  • 557
  • 1
  • 8
  • 19
1
vote
1 answer

How do you get CUDA cores count in jcuda?

How do I get the CUDA cores count in jcuda? I've tried this but it doesn't produce the right output: int cudacount = cudaDeviceAttr.cudaDevAttrMultiProcessorCount; It returns 16 but I have 1 Nvidia GPU with 640 cudacores. The JavaDoc for the above…
1
vote
1 answer

JCuda's JCublas2.cublasSdot: failed to use a device Pointer for the result Pointer parameter

In the source code's comments of JCublas2.cublasSdot, it's commented that the 'result' parameter can be a 'host or device pointer'. public static int cublasSdot( cublasHandle handle, int n, Pointer x, int incx, Pointer y, …
Tom
  • 3,168
  • 5
  • 27
  • 36
1
vote
0 answers

Can't find the dependent library for mavenized JCUDA in Eclipse

I am trying to setup mavenized JCUDA for a project that I am working on and am running into issues with telling java where to locate the library files. Setting up and getting maven to build the .jar and .dll files has worked fine, I can see the…
Talvarion
  • 11
  • 1
  • 5
1
vote
1 answer

Cannot understand how jCuda cuLaunchKernel work?

I am trying to understand how to use Cuda in Java. I am using jCuda. Everything was fine until I came across an example containing the code: // Set up the kernel parameters: A pointer to an array // of pointers which point to the actual…
Makketronix
  • 1,389
  • 1
  • 11
  • 31
1
vote
1 answer

jcuda cuModuleLoad() cannot load file using the path of getClass().getResource().getPath()

I am trying to use cuModuleLoad() in JCuda to load a vectorAdd.ptx file from /src/main/resources. The code is as follows: cuModuleLoad(module, getClass.getResource("vectorAdd.ptx").getPath()) But the cuModuleLoad() doesn't pick up this file. It…
Xiangyu
  • 824
  • 9
  • 34
1
vote
1 answer

How can I create a struct of native pointers in JCuda

I have a CUDA kernel that takes a list of structs. kernel<<>>(MyStruct *structs); Each struct contains 3 pointers. typedef struct __align(16)__ { float* pointer1; float* pointer2; float* pointer3; } I have three…
Bam4d
  • 610
  • 3
  • 10