Click here to Skip to main content
15,897,704 members
Articles / Programming Languages / CUDA

GPU Computing Using CUDA, Eclipse, and Java with JCuda

Rate me:
Please Sign up or sign in to vote.
4.71/5 (8 votes)
21 Sep 2013CPOL18 min read 103.2K   804   25  
Tutorial: GPU computing with JCuda and Nsight (Eclipse)
From Eclipse you make a runnable jar from

From Project Explorer > Export > Java > Runnable Jar file > Next

Set the launch configuration, pick a destination, and extract the libraries into the jar.
Click finish, acknowledge your actions with reguard to licenses, address errors, and review warnings.

To run a jar that uses native libraries, you can point to the native binary folder with the -DJava.library.path switch when you run the jar. 

Syntax java -Djava.library.path=<the exact path to the native library> -jar your.jar

For example, I have an executable jar with filespec: '/home/max/CodeProjectMBishop/javaFFT.jar'

It uses native libraries located in the folder: '/home/max/Cuda/JCuda-All-0.5.0-bin-linux-x86_32 -jar'

I run:


java -Djava.library.path=/home/max/Cuda/JCuda-All-0.5.0-bin-linux-x86_32 -jar '/home/max/CodeProjectMBishop/javaFFT.jar'

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Founder PEI Watershed Alliance, Inc.
United States United States
I am an analytical chemist and an educator. I program primarily to perform matrix computations for regression analysis, process signals, acquire data from sensors, and to control devices.

I participate in many open source development communities and Linux user forums. I do contract work for an environmental analytical laboratory, where I am primarily focused on LIMS programming and network administration.

I am a member of several community-interest groups such as the Prince Edward Island Watershed Alliance, the Lot 11 and Area Watershed Management Group, and the Petersham Historic Commission.

Comments and Discussions