CFD Online URL
[Sponsors]
Home > Wiki > GPGPU

GPGPU

From CFD-Wiki

(Difference between revisions)
Jump to: navigation, search
Line 17: Line 17:
Languages:
Languages:
-
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 enviroments. Those 3 languages are almost identicals.
+
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 enviroments. Those 3 languages are almost identicals.
Also exist languages like Brook GPU and c/c++ libraries/wrappings.
Also exist languages like Brook GPU and c/c++ libraries/wrappings.
Since representation of CFD data requires graphic drawing, learning OpenGl is extremly useful for CFD, and from here, programming GPUs is a very straighforward step to do.
Since representation of CFD data requires graphic drawing, learning OpenGl is extremly useful for CFD, and from here, programming GPUs is a very straighforward step to do.
Line 25: Line 25:
There are double chips video cards, and PC motherboards that support up to 4 video cards. This mean 160x2x4=1.2 Teraflops 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.
There are double chips video cards, and PC motherboards that support up to 4 video cards. This mean 160x2x4=1.2 Teraflops 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.
-
To see an article on double chip video cards see this: [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].
+
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].
For more information see [http://www.gpgpu.org www.gpgpu.org]
For more information see [http://www.gpgpu.org www.gpgpu.org]
Line 31: Line 31:
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 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 books on OpenGL download the red, blue, and orange books from [http://www.opengl.org www.opengl.org]
+
For free books on OpenGL download the red, blue, and orange books from [http://www.opengl.org www.opengl.org] (take nottice that this site offers both commercial and free versions of these books)

Revision as of 09:06, 29 December 2005

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

GPGPU also know as GP² are acronym of General Purpose Graphic Processor Unit.

This mean the use of graphics procesors -GPUs in place of CPUs- for general purpose programming.

Graphics processors have many orders of magnitude more power than PC chips. They equals 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

A graphic unit have a main memory (up to 256/512 Mb by card today), and a graphic processor with many stages and parallel procesors:

First stage commonly is the vertex processor. It have commonly less parallel procesors 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.

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

The last stage, the more useful for CFD, is the fragment processor: 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 thinked like a 4096x4096x4 matrix of 32 bits numbers/data.

Languages: Is possible to program directly with OpenGL Shading Language -GLSL-, his equivalent of Microsoft, DirectX shading language HLSL, or Nvidia CG [free CG toolkit]; all in a format very similar to c/c++. OpenGL and CG are full portable to non Microsoft enviroments. Those 3 languages are almost identicals. Also exist languages like Brook GPU and c/c++ libraries/wrappings. Since representation of CFD data requires graphic drawing, learning OpenGl is extremly useful for CFD, and from here, programming GPUs is a very straighforward step to do.

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. There are double chips video cards, and PC motherboards that support up to 4 video cards. This mean 160x2x4=1.2 Teraflops 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.

To see an article on double chip video cards see this article: Two's Company, Four's a WOW! Sneak Preview of NVIDIA Quad GPU SLI, and for a quadruple PCI express motherboard see this: One Gigabyte Motherboard, Four Graphics Cards.

For more information see www.gpgpu.org

For a tutorial on 2D fluid simulation on GPGPU see this PDF: GPU Gems Fluid Chapter

For free books on OpenGL download the red, blue, and orange books from www.opengl.org (take nottice that this site offers both commercial and free versions of these books)

My wiki