GPU Programming with Java

16,676 views

Published on

Graphics processing unit or GPU (also occasionally called visual processing unit or VPU) is a specialized microprocessor that offloads and accelerates graphics rendering from the central (micro) processor. Modern GPUs are very efficient at manipulating computer graphics, and their highly parallel structure makes them more effective than general-purpose CPUs for a range of complex algorithms. In CPU, only a fraction of the chip does computations where as the GPU devotes more transistors to data processing.

GPGPU is a programming methodology based on modifying algorithms to run on existing GPU hardware for increased performance. Unfortunately, GPGPU programming is significantly more complex than traditional programming for several reasons.

Published in: Education, Technology
2 Comments
17 Likes
Statistics
Notes
  • I Use Intel not Nvdia or Amd. How to run GPU????? elmarrhex.gomez@gmail.com
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Excuse me sir do you have a project in Java about Human detection using GPU. pls send me to my email if you have . elmarrhex.gomez@gmail.com
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total views
16,676
On SlideShare
0
From Embeds
0
Number of Embeds
144
Actions
Shares
0
Downloads
196
Comments
2
Likes
17
Embeds 0
No embeds

No notes for slide

GPU Programming with Java

  1. 1. GPU programming with Java Pramuditha Aravinda. Kelum Senanayake.
  2. 2. Outline What is GPU. CPU vs. GPU Architecture. What is Stream processing. General Purpose GPU. CUDA. OpenCL Demo
  3. 3. What is GPU Graphics processing unit.  Specialized microprocessor. Very efficient at manipulating computer graphics. Offloads and accelerates graphics rendering from the CPU. Dedicated to calculating floating point operations. Highly parallel structure.  More effective for a range of complex algorithms. GPU can be present on,  Video card.  Motherboard  CPU die (certain Core Intel CPUs)
  4. 4. CPU vs. GPU Architecture The GPU devotes more transistors to data processing. GPU : A Highly Parallel, Multithreaded, Manycore Processor
  5. 5. CPU vs. GPU contd…
  6. 6. What is Stream processing Is a computer programming paradigm, related to SIMD. Allows applications to easily exploit a limited form of parallel processing. Terminology  Stream :- A set of data  Kernel functions :- A series of operations Uniform streaming :- One kernel function is applied to all elements in the stream. Stream processing is driven by a data-centric model  Image, video and digital signal processing Less efficient in general purpose processing with more randomized data access (such as databases)
  7. 7. General Purpose GPU The GPU is, by design, a stream processing system. GPGPU is a programming methodology.  Modifying algorithms to run on existing GPU hardware Capable of performing simple operations on a stream of input data with amazing speed. Allows software developers to use stream processing on non-graphics data.
  8. 8. How hard is it? The languages are not very easy to use. Most GPU cards still operate on assembly language. The process flow is unique. Typically simple branching statement, such as if statements, offer such a performance penalty that it is often faster to process both conditions. The unique Stream-In-Stream-Out design is not typically used in CPU programs. The need to work with geometric primitives in order to push mathematical inputs to the system. Rapidly growing community.
  9. 9. Programming GPUs! Plenty of interfaces  Compute Unified Device Architecture (CUDA)  OpenCL  OpenGL Shader Language (GLSL)  DirectX/DirectCompute/HLSL  ATI Stream
  10. 10. CUDA Compute Unified Device Architecture. Parallel computing architecture developed by NVIDIA. Programmers use C for CUDA.  C with NVIDIA extensions and certain restrictions. Third party wrappers are also available for Python, Perl, Fortran, Java, Ruby, Lua, MATLAB and IDL. Currently used in,  SETI@Home  Distributed Calculations, such as predicting the native conformation of proteins  Accelerated inter conversion of video file formats  Physical simulations, in particular in fluid dynamics
  11. 11. CUDA Processing Flow
  12. 12. OpenCL Open Computing Language. Managed by the non-profit technology consortium Khronos Group Framework for writing programs that execute across heterogeneous platforms consisting of CPUs, GPUs, and other processors. Includes a language (based on C99) for writing kernels. APIs to define and then control the platforms. Supports both AMD/ATI and NVIDIA.
  13. 13. Programming GPU with Java andOpenCL We need to program using a GPGPU driver However most GPGPU drivers are available as a native dll only. We need another layer to interface to Java runtime. Called Java Binding
  14. 14. Java Binding UserProgram.class Jocl.jar Jocl.dll OpenCL.dll
  15. 15. Prerequisites - Hardware OpenCL capable graphic card. nVidea – All CUDA enabled GPU have OpenCL support.  GeForce 8xxx or higher with 256MB minimum.  http://www.nvidia.com/object/cuda_gpus.html AMD ATI Radeon™ HD 5400 or higher, AMD Radeon™ HD 6800 series or higher.  AMD X86 CPU w/ SSE 2.x or later are also supported.  http://developer.amd.com/gpu/AMDAPPSDK/pages/DriverCom patibility.aspx
  16. 16. Prerequisites - Software OpenCL driver. – for nVidia GPUs, Usually OpenCL drivers are distributed with graphic card drivers.  http://developer.nvidia.com/object/opencl-download.html Java bindings for OpenCL. – Usually there are two parts  Platform dependent dll. e.g. jocl-windows-x86.dll  Platform independent jar file. Jocl.jar  There are few Implementations. http://jogamp.org/deployment/webstart/archive/jocl-0.9-b1- 20101213-windows-i586.zip JDK  http://www.oracle.com/technetwork/java/javase/downloads/ind ex.html
  17. 17. Demo Program Based on sample program available at http://jogamp.org/wiki/index.php/JOCL_Tutorial

×