CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Wiki > GPGPU

GPGPU

From CFD-Wiki

(Difference between revisions)
Jump to: navigation, search
(Began Cleaning Up & Updating the Page. Will be back. Have tried not to remove any information.)
Line 1: Line 1:
-
  This page is written by a non english speaker; please excuse the bad grammar (And correct it!).
+
==Introduction==
 +
GPGPU is an acronym for General Purpose Graphic Processor Unit.  A GPGPU is any graphics processor being used for general computing beyond graphics. [http://en.wikipedia.org/wiki/Graphics_processing_unit GPUs]are widely available, and often targeted at the computer gaming industry.  Graphics workloads are very parallel, and so GPUs developed as large-scale parallel computation machines.  Originally GPGPU processing was done by tricking the GPU by disguising computation loads as graphic loads.  In recent years, GPU manufacturers have been actively encouraging GPGPU computing with the release of specialized languages which support GPGPU commands.  GPUs incorporate many more computational cores than their equivalent CPUs, and so the performance of parallel operations can be greatly enhanced.  Programming in parallel on a GPU has the same justification given for [http://www.cfd-online.com/Wiki/Parallel_computing parallel computing] in general.
-
GPGPU also know as GP² is an acronym for General Purpose Graphic Processor Unit.
+
==Application to CFD==
-
 
+
GPGPU computing offers large amounts of compute power, which can be tapped for parallel components of CFD algorithms, while the CPU performs the serial portions of the algorithm.  GPGPU languages also support data-parallel computation, similar to vector processors.  In short, modern GPUs provide raw computational power orders of magnitude larger than a CPU and can fit inside a single computer case.
-
This simply means the use of graphics processors -GPUs in place of CPUs- for general purpose programming.
+
-
 
+
-
This article talks about commodity hardware, the video cards that are toys to play games, sold to common PC users, and his capabilities as math coprocessor for CFD.
+
-
 
+
-
Graphics processors have many orders of magnitude more power than PC chips. They equals the power of little MIMD/SIMD clusters (up to 10 PCs CPUs) in 2005. But in some applications they can gain up to 50x the power of PCs chips.
+
 +
==Graphics Architecture==
 +
  This section is written by a non english speaker; please excuse the bad grammar (And correct it!).
A graphic unit have a main memory (up to 256/512 Mb by card in 2005), and a graphic processor with many stages and parallel processors; each stage trow his output data on the next stage.
A graphic unit have a main memory (up to 256/512 Mb by card in 2005), and a graphic processor with many stages and parallel processors; each stage trow his output data on the next stage.
Line 23: Line 21:
The last stage, the more useful for CFD, is the fragment processor. Latest GPUs from 2005 have up to 24 parallel fragment processors, capable of process 4 IEEE floating point each one (24x4=96 parallel calculus!); here 2D matrix of four numbers are processed. They map to 2D screen pixels containing four numbers -Red, Green, Blue and Alpha components of pixels- Can be thought like a 4096x4096x4 matrix of 32 bits numbers/data.
The last stage, the more useful for CFD, is the fragment processor. Latest GPUs from 2005 have up to 24 parallel fragment processors, capable of process 4 IEEE floating point each one (24x4=96 parallel calculus!); here 2D matrix of four numbers are processed. They map to 2D screen pixels containing four numbers -Red, Green, Blue and Alpha components of pixels- Can be thought like a 4096x4096x4 matrix of 32 bits numbers/data.
-
Languages:
+
===Performance===
-
Is possible to program directly with OpenGL Shading Language -[http://oss.sgi.com/projects/ogl-sample/registry/ARB/GLSLangSpec.Full.1.10.59.pdf GLSL]-, his equivalent of Microsoft, DirectX shading language HLSL, or Nvidia CG [[http://developer.nvidia.com/object/cg_toolkit.html free CG toolkit]]; all in a format very similar to c/c++. OpenGL and CG are full portable to non Microsoft environments. Those 3 languages are almost identical.
+
-
Also exist languages like [http://graphics.stanford.edu/projects/brookgpu/ Brook GPU] and c/c++ libraries/wrappings.
+
-
Since representation of CFD data requires graphic drawing, learning OpenGl is extremely useful for CFD, and from here, programming GPUs is a very straight forward step to do.
+
-
 
+
-
To end of 2005 two manufacturers produce programmable video chips for PCs: ATI and Nvidia, but ATI have only 24 bits of precision meanwhile Nvidia reach 32 bits.
+
-
 
+
-
How much power?
+
In a Geforce 7800 have been measured 160 Gigaflops (not peak, but maintained performance). But expect half to 1/3 this power in a general purpose/novice program.
In a Geforce 7800 have been measured 160 Gigaflops (not peak, but maintained performance). But expect half to 1/3 this power in a general purpose/novice program.
There are at least double chips video cards, and PC motherboards that support up to 4 video cards. This mean 160x2x4=1.2 Teraflops (1.2/2=600 Gigaflops) on one PC with 512*4=2 Gb of 'video' RAM.
There are at least double chips video cards, and PC motherboards that support up to 4 video cards. This mean 160x2x4=1.2 Teraflops (1.2/2=600 Gigaflops) on one PC with 512*4=2 Gb of 'video' RAM.
But nvidia drivers support '''transparently''' only up to 2 chips running like one and without the double of memory. Then, for the novice there are only (160/3)x2=100 Gflops and 512 Mb of video RAM available on 2005 at cost of near 1000 U$S. In comparison, there is possible to put 2 x86 processors with double CPU on a motherboard, allowing up to a peak of 15/20*4=60/80 Gflops in a PC, that can be reached by programs that not fill the cache.
But nvidia drivers support '''transparently''' only up to 2 chips running like one and without the double of memory. Then, for the novice there are only (160/3)x2=100 Gflops and 512 Mb of video RAM available on 2005 at cost of near 1000 U$S. In comparison, there is possible to put 2 x86 processors with double CPU on a motherboard, allowing up to a peak of 15/20*4=60/80 Gflops in a PC, that can be reached by programs that not fill the cache.
-
To see an article on double chip video cards see this article: [http://www.tomshardware.com/2005/12/14/sneak_preview_of_the_nvidia_quad_gpu_setup/ Two's Company, Four's a WOW! Sneak Preview of NVIDIA Quad GPU SLI], and for a quadruple PCI express motherboard see this: [http://www.tomshardware.com/2005/10/04/one_gigabyte_motherboard/ One Gigabyte Motherboard, Four Graphics Cards].
+
===Languages===
 +
Is possible to program directly with OpenGL Shading Language --, his equivalent of Microsoft, DirectX shading language HLSL, or Nvidia CG ; all in a format very similar to c/c++. OpenGL and CG are full portable to non Microsoft environments. Those 3 languages are almost identical.
 +
Also exist languages like  and c/c++ libraries/wrappings.
 +
Since representation of CFD data requires graphic drawing, learning OpenGl is extremely useful for CFD, and from here, programming GPUs is a very straight forward step to do.
 +
 
 +
==References==
 +
===Guides and Information===
 +
[http://oss.sgi.com/projects/ogl-sample/registry/ARB/GLSLangSpec.Full.1.10.59.pdf GLSL]
 +
 
 +
[http://developer.nvidia.com/object/cg_toolkit.html free CG toolkit]
 +
 
 +
[http://graphics.stanford.edu/projects/brookgpu/ Brook GPU]
 +
 
 +
[http://www.gpgpu.org www.gpgpu.org]
 +
 
 +
[http://download.nvidia.com/developer/SDK/Individual_Samples/DEMOS/OpenGL/src/gpgpu_fluid/docs/GPU_Gems_Fluids_Chapter.pdf GPU Gems Fluid Chapter]
 +
 
 +
[http://www.opengl.org www.opengl.org]
 +
 
 +
[http://oss.sgi.com/projects/ogl-sample/registry/ARB/GLSLangSpec.Full.1.10.59.pdf GLSL]
 +
===Journalism===
 +
[http://www.tomshardware.com/2005/12/14/sneak_preview_of_the_nvidia_quad_gpu_setup/ Two's Company, Four's a WOW! Sneak Preview of NVIDIA Quad GPU SLI]
-
For more information see [http://www.gpgpu.org www.gpgpu.org]
 
-
For a tutorial on 2D fluid simulation on GPGPU see this PDF: [http://download.nvidia.com/developer/SDK/Individual_Samples/DEMOS/OpenGL/src/gpgpu_fluid/docs/GPU_Gems_Fluids_Chapter.pdf GPU Gems Fluid Chapter]
 
-
For free books on OpenGL download the red, blue, and orange books from [http://www.opengl.org www.opengl.org]
 
[[Category: Acronyms]]
[[Category: Acronyms]]
{{stub}}
{{stub}}

Revision as of 14:07, 17 March 2010

Contents

Introduction

GPGPU is an acronym for General Purpose Graphic Processor Unit. A GPGPU is any graphics processor being used for general computing beyond graphics. GPUsare widely available, and often targeted at the computer gaming industry. Graphics workloads are very parallel, and so GPUs developed as large-scale parallel computation machines. Originally GPGPU processing was done by tricking the GPU by disguising computation loads as graphic loads. In recent years, GPU manufacturers have been actively encouraging GPGPU computing with the release of specialized languages which support GPGPU commands. GPUs incorporate many more computational cores than their equivalent CPUs, and so the performance of parallel operations can be greatly enhanced. Programming in parallel on a GPU has the same justification given for parallel computing in general.

Application to CFD

GPGPU computing offers large amounts of compute power, which can be tapped for parallel components of CFD algorithms, while the CPU performs the serial portions of the algorithm. GPGPU languages also support data-parallel computation, similar to vector processors. In short, modern GPUs provide raw computational power orders of magnitude larger than a CPU and can fit inside a single computer case.

Graphics Architecture

 This section is written by a non english speaker; please excuse the bad grammar (And correct it!).

A graphic unit have a main memory (up to 256/512 Mb by card in 2005), and a graphic processor with many stages and parallel processors; each stage trow his output data on the next stage.

First stage: Commonly is the vertex processor. It have commonly less parallel processors than fragment stage. The vertex processor does calculations specialized in matrix transformations. Typically project 3D coordinates in 2D screen coordinates, but is not restricted to matrix products. It can be thought of as a vector -or quaternion- processor, since a vertex is one or two vector of 4 components representing a triangle vertex. It adapt well to Lagrangian frames.

Middle stage: Then, follow a (still non programmable) stage where linear interpolations, and other works are done. This stage has poor flexibility, but can be useful to specialized tasks.

Third stage: The last stage, the more useful for CFD, is the fragment processor. Latest GPUs from 2005 have up to 24 parallel fragment processors, capable of process 4 IEEE floating point each one (24x4=96 parallel calculus!); here 2D matrix of four numbers are processed. They map to 2D screen pixels containing four numbers -Red, Green, Blue and Alpha components of pixels- Can be thought like a 4096x4096x4 matrix of 32 bits numbers/data.

Performance

In a Geforce 7800 have been measured 160 Gigaflops (not peak, but maintained performance). But expect half to 1/3 this power in a general purpose/novice program. There are at least double chips video cards, and PC motherboards that support up to 4 video cards. This mean 160x2x4=1.2 Teraflops (1.2/2=600 Gigaflops) on one PC with 512*4=2 Gb of 'video' RAM. But nvidia drivers support transparently only up to 2 chips running like one and without the double of memory. Then, for the novice there are only (160/3)x2=100 Gflops and 512 Mb of video RAM available on 2005 at cost of near 1000 U$S. In comparison, there is possible to put 2 x86 processors with double CPU on a motherboard, allowing up to a peak of 15/20*4=60/80 Gflops in a PC, that can be reached by programs that not fill the cache.

Languages

Is possible to program directly with OpenGL Shading Language --, his equivalent of Microsoft, DirectX shading language HLSL, or Nvidia CG ; all in a format very similar to c/c++. OpenGL and CG are full portable to non Microsoft environments. Those 3 languages are almost identical. Also exist languages like and c/c++ libraries/wrappings. Since representation of CFD data requires graphic drawing, learning OpenGl is extremely useful for CFD, and from here, programming GPUs is a very straight forward step to do.

References

Guides and Information

GLSL

free CG toolkit

Brook GPU

www.gpgpu.org

GPU Gems Fluid Chapter

www.opengl.org

GLSL

Journalism

Two's Company, Four's a WOW! Sneak Preview of NVIDIA Quad GPU SLI


My wiki