Oberon Community Platform Forum

Projects => Matrix => Topic started by: fnecati on February 19, 2011, 12:22:00 PM



Title: Using OpenCL-GPU in WinAos, LinuxAos
Post by: fnecati on February 19, 2011, 12:22:00 PM
Hello,

The open standard for parallel programming of heterogeneous systems is gaining popularity nowadays.
Nvidia (CUDA), ATI (Stream) and OpenCL (Open Computing Language) are supported by leading companies (see http://www.khronos.org/opencl/)

There are many bindings to OpenCL (C#, java, fortran, python, delphi, etc.) but no Oberon ones.
So, I made a raw Oberon binding to OpenCL dynamic library and able to use GPU computing power for simple examples.
There are many kernels on the internet, (FFT, matrix, image,..) which needs to be adapted to Oberon enviroment.

I adapted and tested a few examples on WinXP32 with Nvidia 8500GT (2 GPU, 16 stream processsor, latest CUDA toolkit and driver )
graphics card using latest WinAos from SVN and on Ubuntu 10.04(lucid),x86_64 using LinuxAos rel-0.94. Component Pascal (Blackbox) version also tested.
There are many examples in OpenCL-SDK which can also be translated to Oberon.

There is a Matrix project in this OCP page also, so, which is better; make a new project for OpenCL or append it to Matrix project.
It is also possible to make a high level framework for OpenCL.

Are there any interest to extend and embed into Oberon, volunteer?

What is your opinion?


best regards,

- Necati.



Title: Re: Using OpenCL-GPU in WinAos, LinuxAos
Post by: sage on February 19, 2011, 05:25:55 PM
It's very interesting to has high level framework for OpenCL.


Title: Re: Using OpenCL-GPU in WinAos, LinuxAos
Post by: soren renner on February 20, 2011, 03:44:28 AM
It's a VERY GOOD IDEA. I remember using "dlsym" to code an interface module for linux native oberon so it could use opengl (and glut) more than a decade ago. But I don't remember using it for anything -- probably I got distracted by ray tracing. If the project you suggest is begun I will test, I will contribute, and I will code demos. I suggest that we set up a repository at googlecode os such.

I would be even more interested in opengl than openCL. 


Title: Re: Using OpenCL-GPU in WinAos, LinuxAos
Post by: sage on February 20, 2011, 08:23:12 AM
I would be even more interested in opengl than openCL.
But openCL may bring more computing power for ray-tracing, because modern GPUs are 15-20 times faster then modern multicore CPUs.


Title: Re: Using OpenCL-GPU in WinAos, LinuxAos
Post by: leledumbo on February 21, 2011, 07:08:39 PM
I vote for OpenCL since it's standardized though I haven't really used it myself (a Modern Pascal wrapper is available, perhaps that's easier to translate to Oberon). I've taken parallel programming class which uses CUDA & MPI. CUDA really sucks: no host function call, difficult to debug, NVIDIA only technology (others MAY NOT implement it even though they can), requires specific hardware, etc. MPI is better but requires cluster computing environment.


Title: Re: Using OpenCL-GPU in WinAos, LinuxAos
Post by: soren renner on February 22, 2011, 01:47:08 AM
But openCL may bring more computing power for ray-tracing.

Not for the algorithm I use. But there are hybrid approaches that could be tried.


Title: Re: Using OpenCL-GPU in WinAos, LinuxAos
Post by: fnecati on February 22, 2011, 10:32:07 AM
Attached bindings for testing and extending.

OpenGL bindings can also be written, soren renner, sage, leledumbo and others..

If i can find time, I can also contribute.









Title: opencloberon repository
Post by: soren renner on February 22, 2011, 05:15:30 PM
a mercurial repository has been established at googlecode.

http://code.google.com/p/opencloberon/source/browse/

see also http://code.google.com/p/xenopus/source/browse/


Title: Re: Using OpenCL-GPU in WinAos, LinuxAos: Trap Report
Post by: soren renner on February 22, 2011, 07:52:53 PM

CPU[-Dual Intel Core2 Duo E4400 @ clocked at 600.000 Mhz-]  Kernel[-Linux 2.6.37-0.slh.18-aptosid-amd64 x86_64-]  Up[-4:17-]  Mem[-938.1/1507.4MB-]  HDD[-330GB(71%used)-]  Procs[-132-]  Client[Shell] graphics: nVidia Corporation G72 [GeForce 7300 SE/7200 GS]

sr@aptosidbox:~/dev/opencloberon$ aos
X11 Display depth = 24
Kernel: Initialized and started.
Default font installedOpenType 0.45 BBPort /3.12.2004  eos, pl
WindowManager: 16-bit color
WindowManager: Display resolution: 1264x992x192
DisplayRefresher installed.
Autostart: executing WMTrapWriter.Install
{P cpuid= 0, pid= -275326096 Events: System event log started.}
WMMacros: Macro file Macros.XML loaded.
Autostart: executing UpTime.Install
Uptime monitor started.
Autostart: executing StartMenu.Open
Autostart: executing SkinEngine.Unload
ZeroSkin already loaded
Autostart: executing WMRestorable.Load Auto.dsk
{P cpuid= 0, pid= -157451408 Starting logger}
WMRestorable: Loading desktop from Auto.dsk...
SyntaxHighlighter: Auto-loading SyntaxHighlighter.XML ... done.
/usr/lib32/libOpenCL.so loaded.
restarting thread/usr/lib32/libOpenCL.so unloaded.
Cleanup
{P cpuid= 0, pid= -241755280 Events: System event log shut down.}
WindowManager: Window manager closed
sr@aptosidbox:~/dev/opencloberon$ cat log.text

UnixAos (0.94/r3872) for Linux

Trap   11 (Segmentation violation)
SP = 00000000H, FP = EA7FD1E0H, PC = F76E6201H

Unknown PC=F76E6201H FP=EA7FD1E0H
MyMandelbrotCL.MBWindow.InitCL:317 pc=918 [00000396H] = 601 + 317
  @Self=E542E720H (MyMandelbrotCL.MBWindow)
  err=-32
  @hiddenVar4=00000000H (NIL)
MyMandelbrotCL.MBWindow.New:291 pc=308 [00000134H] = 17 + 291
  @Self=E542E720H (MyMandelbrotCL.MBWindow)
MyMandelbrotCL.Open:89 pc=2647 [00000A57H] = 2558 + 89
  @hiddenVar2=E542E720H (MyMandelbrotCL.MBWindow)
Commands.Runner.@Body:466 pc=1307 [0000051BH] = 841 + 466
  @Self=E53DF890H (Commands.Runner)
Objects.BodyStarter:415 pc=780 [0000030CH] = 365 + 415
  p=E53DF9B0H (Objects.Process)
  proc=Commands.Runner.@Body:0 pc=841 [00000349H] = 841 + 0
  id=-360719504
  res=0
  prevBP=-360721512
  type=-148674156
Unknown PC=0804AFF2H FP=EA7FD398H


----------------------------------------------------
sr@aptosidbox:~/dev/opencloberon$


Title: opencloberon logo
Post by: soren renner on February 23, 2011, 01:40:23 AM
Quick, fnecati or sage, give me an image file for a logo so I can upload it to our googlecode project.


Title: Re: Using OpenCL-GPU in WinAos, LinuxAos
Post by: fnecati on February 23, 2011, 09:11:04 AM


Quote
CPU[-Dual Intel Core2 Duo E4400 @ clocked at 600.000 Mhz-]  Kernel[-Linux 2.6.37-0.slh.18-aptosid-amd64 x86_64-]  Up[-4:17-]  Mem[-938.1/1507.4MB-]  HDD[-330GB(71%used)-]  Procs[-132-]  Client[Shell] graphics: nVidia Corporation G72 [GeForce 7300 SE/7200 GS]

http://www.nvidia.com/object/cuda_gpus.html shows  CUDA (OpenCL) enabled products for nvidia cards. Your GeoForce 7300 card is not listed there.

Quote
Trap   11 (Segmentation violation)
SP = 00000000H, FP = EA7FD1E0H, PC = F76E6201H

Unknown PC=F76E6201H FP=EA7FD1E0H
MyMandelbrotCL.MBWindow.InitCL:317 pc=918 [00000396H] = 601 + 317
  @Self=E542E720H (MyMandelbrotCL.MBWindow)
  err=-32   <<<<<<<<<<<<<<<<<<********************
  @hiddenVar4=00000000H (NIL)

** err = -32 means that "INVALID-PLATFORM", see error codes in OpenCL.Mod or OpenCLUtils.Mod

please look at the above page for installing and support.

Did you get any info for your platform using TestOpenCLInfo.Info, it think, it also traps ?.



Title: Re: Using OpenCL-GPU in WinAos, LinuxAos
Post by: sage on February 23, 2011, 02:08:03 PM
On GeForce 8600 GT all examples works fine. However updating of forceware driver to latest version was needed. Before driver update the OpenCL.dll was absent, and Win32.OpenCL.Mod trapped.


Title: Re: opencloberon logo
Post by: sage on February 23, 2011, 02:14:17 PM
give me an image file for a logo
Do you mean OpenCL logo or A2 logo? As for A2 logo, I don't know, are we able to use following picture freely. This picture exists also somewhere in vector (SVG) format.


Title: Re: Using OpenCL-GPU in WinAos, LinuxAos
Post by: soren renner on February 23, 2011, 05:06:32 PM
I meant an opencloberon logo for this page: http://code.google.com/p/opencloberon/ . Please join this project at once. I will assign both of you administrator status (if there can be more than one -- I am unsure). For the time being I will use the A2 logo.


Title: Re: Using OpenCL-GPU in WinAos, LinuxAos
Post by: soren renner on February 23, 2011, 05:51:04 PM
TestOpenCLInfo.Info does NOT trap. It reports that "Error: Cannot get number of platforms!"


Title: Re: Using OpenCL-GPU in WinAos, LinuxAos
Post by: soren renner on February 23, 2011, 05:52:09 PM
Probably the card is not sufficient for OpenCL.


Title: Re: Using OpenCL-GPU in WinAos, LinuxAos
Post by: sage on February 23, 2011, 06:14:08 PM
TestOpenCLInfo.Info does NOT trap. It reports that "Error: Cannot get number of platforms!"
Yep, it happens because drivers are fresh enough (OpenCL.dll present), but hardware not supported. The same situation on my home PC with GeForce 7800 GT. Hardware must be at least of 8xxx family.


Title: Re: Using OpenCL-GPU in WinAos, LinuxAos
Post by: leledumbo on February 23, 2011, 06:47:44 PM
Quote
Yep, it happens because drivers are fresh enough (OpenCL.dll present), but hardware not supported. The same situation on my home PC with GeForce 7800 GT. Hardware must be at least of 8xxx family.
Same situation here as well with GeForce 7200 GS/7300 SE, dammit.


Title: Re: Using OpenCL-GPU in WinAos, LinuxAos
Post by: soren renner on February 23, 2011, 09:41:34 PM
Installation of a new video card (nvidia 9500 GT) eliminated the trap. MyMandelbrotCL.Open results (19 ms later) in a pretty picture.


Title: Re: Using OpenCL-GPU in WinAos, LinuxAos
Post by: fnecati on February 24, 2011, 02:54:53 PM
The attached file is a utility for syntax testing of OpenCL programs, kernels.

I send it here instead of the project page, because, I don't know how to upload to that page.




Title: Re: Using OpenCL-GPU in WinAos, LinuxAos
Post by: soren renner on February 24, 2011, 05:58:24 PM
Please send me a message with your google account mail address. This need not be gmail: see https://www.google.com/accounts/NewAccount

I will add you to the project as a committer.

Install Mercurial.       http://mercurial.selenic.com/

Get a local copy of the opencloberon repository with this command:

hg clone https://opencloberon.googlecode.com/hg/ opencloberon

change directory to opencloberon.

move the file you wish to add to the project to this directory.

hg add file.Mod
hg commit
hg push


et voila






Title: Re: Using OpenCL-GPU in WinAos, LinuxAos
Post by: soren renner on February 24, 2011, 06:33:57 PM
http://www.youtube.com/watch?v=Tnc_IoXwH24&NR=1


Title: Using OpenCL-GPU in WinAos, LinuxAos 2015
Post by: Pat on September 11, 2015, 06:49:14 PM
Any update on this ?
Experience with current hardware ?
Running Demo in Oberon ?
I am interested in coupling OpenCL to the Matrix library.
Greetings
Pat


Title: Re: Using OpenCL-GPU in WinAos, LinuxAos 2015
Post by: fnecati on September 12, 2015, 01:11:09 PM
opencloberon, opengloberon and openaloberon binding libraries for oberon (LinuxAos and WinAos) are transferred to github:

OpenCL: https://github.com/fnec/opencloberon
OpenGL: https://github.com/fnec/opengloberon
OpenAL: https://github.com/fnec/openaloberon

No documentation yet, but, demos are available.

- Necati.