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
0
votes
0 answers

Resolve this function without recursion in order to use parallelism

I'm trying to optimize a process which is to calculate all possible combinations of players to form partitions. To understand my problem, I use the following example. For exampe we have a set of players N = {1,2,3,4,5} , this players are regrouped…
Sam Faith
  • 175
  • 5
0
votes
1 answer

how to debug kernels called by a java(jcuda) program

Is there any way to debug cuda functions called by java (jcuda) ? My program launch this exception: Exception in thread "main" jcuda.CudaException:CUDA_ERROR_ILLEGAL_ADDRESS at jcuda.driver.JCudaDriver.checkResult(JCudaDriver.java:288) at…
0
votes
3 answers

JNI libraries deallocate memory upon garbage collection?

I am using JCUDA and would like to know if the JNI objects are smart enough to deallocate when they are garbage collected? I can understand why this may not work in all situations, but I know it will work in my situation, so my followup question is:…
James Watkins
  • 4,806
  • 5
  • 32
  • 42
0
votes
1 answer

real-to-complex FFT with JCufft

I'm doing a real-to-complex FFT with the org.apache.commons.math3.transform library as following: private Complex[] fft(double[] values) { FastFourierTransformer ffTransformer = new FastFourierTransformer(DftNormalization.STANDARD); Complex[]…
René Winkler
  • 6,508
  • 7
  • 42
  • 69
0
votes
1 answer

Efficient way to perform radial average of matrix elements without using shared memory

I am trying to implement radial average of matrix element in CUDA, where I have to find and print average of all neighbouring elements (including itself) of every matrix element. Following is what I ended up with(for radius = 1): __global__ void…
sandeep.ganage
  • 1,409
  • 2
  • 21
  • 47
0
votes
1 answer

Error while compiling jCUDA sample from SDK in eclipse 'Input file not found: JCudaVectorAddKernel.cu'

I am new to jCUDA and java as well. I am trying to compile a vector addition program from NVIDIA samples using eclipse on Redhat Linux. Steps I followed: 1. Enter: nvcc -ptx JCudaVectorAddKernel.cu -> It generates JCudaVectorAddKernel.ptx file 2.…
sandeep.ganage
  • 1,409
  • 2
  • 21
  • 47
0
votes
1 answer

Error in the function cuMemcpyHtoD in jCUDA

I am NEW to java programming and trying to code a matrix multiplication program in jCUDA. While transferring the data from host to device and vice versa I use: cuMemcpyHtoD(devMatrixA, Pointer.to(hostMatrixA), numRows * numCols *…
sandeep.ganage
  • 1,409
  • 2
  • 21
  • 47
0
votes
1 answer

Packaging of JCUDA 0.6.0 on Mac OSX 10.9.3

I was able to compile the native 0.6.0 libraries of JCuda on a Mac OSX 10.9.3 64-bit system (http://www.jcuda.org/downloads/downloads.html). Unfortunately Im not smart enough to package everything into a jar. Can someone help me to do so? I created…
RayDeeA
  • 271
  • 3
  • 12
0
votes
1 answer

How to free the GPU memory in JCuda as free function provided in JCuda is not releasing the GPU memory in real time applications?

CUdeviceptr deviceInputA = new CUdeviceptr(); cuMemAlloc(deviceInputA, size * Sizeof.DOUBLE); cuMemcpyHtoD(deviceInputA, Pointer.to(inputfingerprint), size * Sizeof.DOUBLE); cuMemFree(deviceInputA); Here cuMemFree is not releasing the GPU memory…
Indiano
  • 76
  • 6
0
votes
1 answer

Indexing in jCuda Pointer function

How does one index in, lets say a 1D "Result" array, using the function pointer.to(int[ ]) in jCuda. I want to write a chunk of data into the first n locations of "Result" and the next chunk of data into Result[0 + chunk] onwards, and so on. Unlike…
pyridot
  • 5
  • 1
  • 7
0
votes
1 answer

Need help adding OpenCL(GPU Usage)

Well I decided I prefer to use GPU over CPU especially since I'm working on a game and FPS will increase I expect. The thing is i'm not sure where to start. I can easily implement JOCL or JCUDA but after that I wouldnt know where to replace it from…
stdio.h
  • 3
  • 1
0
votes
2 answers

Allocation of large pinned memory chunk using CUDA with Java

I'm implementing GPU calculation in a program already written in Java. For that purpose I'm using jcuda bindings. I need a fast host to device memory transfer of, sometimes, relatively large arrays. If I want to use streams, I have to use pinned…
0
votes
1 answer

best way to do large number of vector computations with gpgpu?

I have a matrix of 1 million columns x 1 million rows. My algoritm needs to do: Matrix m = Matrix(rows,cols) for (colB: cols){ vector currColA = m.getcolumn(colA) for (colB: cols){ vector currColB = m.getcolumn(colB) result =…
seinecle
  • 10,118
  • 14
  • 61
  • 120
0
votes
1 answer

JCuda. Reusing already used pointer

I have a trouble working with JCUDA. I have a task to make 1D FFT using CUFFT library, but the result should be multiply on 2. So I decided to make 1D FFT with type CUFFT_R2C. Class responsible for this going next: public class FFTTransformer { …
-1
votes
1 answer

Calculate Skintone using JCuda is not giving the right percentage

Im calculting skintone of an image in java. convert the pixel of Image in yCbCR. check if image pixel is in specific range, then its a skin color. calculate percentage by dividing it by total pixel. Its working fine in CPU code, but when i…
Aqeel Haider
  • 603
  • 7
  • 24