Main Page | Report this Page
Computers Forum Index  »  Computer - Graphics - API (Opengl)  »  GPGPU example plus needed OpenGL and CG libraries for...
Page 1 of 1    

GPGPU example plus needed OpenGL and CG libraries for...

Author Message
Skybuck Flying...
Posted: Thu Sep 03, 2009 12:46 pm
Guest
Hello,

GPGPU example plus needed OpenGL and CG libraries for Delphi 2007 now
available !

I created the necessary OpenGL and CG (delphi) packages yesterday and
finished converting/translating/porting a C GPGPU OpenGL/CG example to
Delphi today and I would like to share it with you so that maybe some more
(delphi) people will look into gpgpu programming, especially with opengl 3.0
for (older) dx9 graphics cards.

Maybe somebody will create something interesting some day ! Wink :)

The C example is a bit wacky... (so the Delphi example is also a bit wacky
Smile) but it's a nice demonstration of the GPU's processing power and a nice
introduction to it.

(The Delphi example gets rid of glut... I don't like glut and it's not
needed, saves me from having to use an extra library Smile)

I created a WinRar file (compression utility) to store the packages source
code and the example source code (Delphi only) into it... with bpl's and
exe's too.

I simply moved the packages and the source code from my development folders
to a "distribution" folder but I think it will work if you just install the
packages first into delphi and then open the example. (Let me know if it
doesn't work for you or need help with that... then I will look into it...
but it should work ! Wink)

I put the WinRar file (GPGPUonDelphi2007.rar) on my "skydrive":

Link to skydrive/rar file:

http://cid-aedd0ea32d61bc86.skydrive.live.com/self.aspx/Delphi/Downloads/GPGPUonDelphi2007.rar

Link to skydrive delphi->downloads folder:

http://cid-aedd0ea32d61bc86.skydrive.live.com/browse.aspx/Delphi/Downloads

Link to skydrive:

http://cid-aedd0ea32d61bc86.skydrive.live.com/browse.aspx/Delphi

Link to C source code:

http://www.mathematik.uni-dortmund.de/~goeddeke/gpgpu/saxpy_cg.cpp

Link to tutorial/explanations:

http://www.mathematik.uni-dortmund.de/~goeddeke/gpgpu/tutorial.html

I hope you enjoy the example, have fun with it !

Bye,
Skybuck.
 
Skybuck Flying...
Posted: Thu Sep 24, 2009 12:12 pm
Guest
This example does not work when run from windows ms dos prompt... on windows
xp x64 pro.

Problem probably with setpixelformat... could be operating system bug or
driver bug.

To bad ! If so I can't help it, or maybe I can but I doubt it for now.. ;)

Too tired to investigate further now... os exception number was:

-1073283066

Take away the minus and only post on google that can be found is related to
setpixelformat...

and indeed the code does raise an os exception... kinda weird... why would
that be a problem ? Hmm..

This line probably culprit, not confirmed... but good guess:

opengl api version 0.03:

part of create render context routine:

if GetPixelFormat(DC) <> PixelFormat then
if not SetPixelFormat(DC, PixelFormat, at (no spam) PFDescriptor) then
RaiseLastOSError;

Bye,
Skybuck.
 
Skybuck Flying...
Posted: Mon Sep 28, 2009 10:14 am
Guest
Ok,

I just updated the example... it now uses the vcl/form/canvas for the hdc.

I also ran a little benchmark, problem size 16.000.000 iterations 200

Graphics card: GTX 7900.

Some formats didn't work... especially the R program seemed to hang or be
super slow... otherway, don't use those formats ;)

Conclusion: 16 bit floating point formats are twice as fast as 32 bit
floating point formats !

So use 16 bit floating point formats when possible ?!

Unfortunately this benchmark does not (yet?) include integers ?!?

I am curious how 16 bit integers in the shaders would perform ?! ;)

Updated source + batchfile will be available shortly ;)

Here are the results from benchmark.bat Wink:

// BEGIN OF RESULTS (slightly modified to compensate for program
hangs/crashes, see aborted):

program started
TEXRECT - float_ARB - RGBA - 32
, N=16000000, numIter=200
CreateDC successfull.
CreateRenderingContext successfull.
MFLOP/s for N=16000000: 5829
ReleaseDC successfull.
program finished


program started
TEXRECT - float_ARB - RGBA - 16
, N=16000000, numIter=200
CreateDC successfull.
CreateRenderingContext successfull.
MFLOP/s for N=16000000: 11172
ReleaseDC successfull.
program finished


program started
TEXRECT - float_ARB - R - 32
, N=16000000, numIter=200
CreateDC successfull.
CreateRenderingContext successf
ABORTED


program started
TEXRECT - float_ATI - RGBA - 32
, N=16000000, numIter=200
CreateDC successfull.
CreateRenderingContext successfull.
MFLOP/s for N=16000000: 5792
ReleaseDC successfull.
program finished


program started
TEXRECT - float_ATI - RGBA - 16
, N=16000000, numIter=200
CreateDC successfull.
CreateRenderingContext successfull.
MFLOP/s for N=16000000: 11189
ReleaseDC successfull.
program finished

program started
TEXRECT - float_ATI - R - 32
, N=16000000, numIter=200
CreateDC successfull.
CreateRenderingContext successf
ABORTED

program started
TEXRECT - float_NV - RGBA - 32
, N=16000000, numIter=200
CreateDC successfull.
CreateRenderingContext successfull.
MFLOP/s for N=16000000: 5795
ReleaseDC successfull.
program finished

program started
TEXRECT - float_NV - RGBA - 16
, N=16000000, numIter=200
CreateDC successfull.
CreateRenderingContext successfull.
MFLOP/s for N=16000000: 11092
ReleaseDC successfull.
program finished

program started
TEXRECT - float_NV - R - 32
, N=16000000, numIter=200
CreateDC successfull.
CreateRenderingContext successfull.
MFLOP/s for N=16000000: 5641
ReleaseDC successfull.
program finished

program started
tex2D - float_ARB - RGBA - 32
, N=16000000, numIter=200
CreateDC successfull.
CreateRenderingContext successfull.
MFLOP/s for N=16000000: 5801
ReleaseDC successfull.
program finished

program started
tex2D - float_ARB - RGBA - 16
, N=16000000, numIter=200
CreateDC successfull.
CreateRenderingContext successfull.
MFLOP/s for N=16000000: 11110
ReleaseDC successfull.
program finished

program started
tex2D - float_ARB - R - 32
, N=16000000, numIter=200
CreateDC successfull.
CreateRenderingContext successful
ABORTED

program started
tex2D - float_ATI - RGBA - 32
, N=16000000, numIter=200
CreateDC successfull.
CreateRenderingContext successfull.
MFLOP/s for N=16000000: 5801
ReleaseDC successfull.
program finished

program started
tex2D - float_ATI - RGBA - 16
, N=16000000, numIter=200
CreateDC successfull.
CreateRenderingContext successfull.
MFLOP/s for N=16000000: 11165
ReleaseDC successfull.
program finished

program started
tex2D - float_ATI - R - 32
, N=16000000, numIter=200
CreateDC successfull.
CreateRenderingContext successful
ABORTED

program started
tex2D - float_NV - RGBA - 32
, N=16000000, numIter=200
CreateDC successfull.
CreateRenderingContext successf
ABORTED

program started
tex2D - float_NV - RGBA - 16
, N=16000000, numIter=200
CreateDC successfull.
CreateRenderingContext successf
ABORTED

program started
tex2D - float_NV - R - 32
, N=16000000, numIter=200
CreateDC successfull.
CreateRenderingContext successfull
ABORTED

// END OF RESULTS

Bye,
Skybuck.
 
 
Page 1 of 1    
All times are GMT
The time now is Sun Nov 29, 2009 5:01 pm