Oberon Community Platform Forum
October 20, 2018, 02:24:11 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: Using OpenCL-GPU in WinAos, LinuxAos  (Read 17941 times)
fnecati
Jr. Member
**
Posts: 60


« 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.

Logged
sage
Full Member
***
Posts: 168



WWW
« Reply #1 on: February 19, 2011, 05:25:55 PM »

It's very interesting to has high level framework for OpenCL.
Logged
soren renner
Global Moderator
Full Member
*****
Posts: 216



« Reply #2 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. 
Logged
sage
Full Member
***
Posts: 168



WWW
« Reply #3 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.


* GPU CPU rate.png (20.68 KB, 503x503 - viewed 788 times.)
Logged
leledumbo
Jr. Member
**
Posts: 96



WWW
« Reply #4 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.
Logged
soren renner
Global Moderator
Full Member
*****
Posts: 216



« Reply #5 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.
Logged
fnecati
Jr. Member
**
Posts: 60


« Reply #6 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.








* OpenCLOberon.zip (35.32 KB - downloaded 352 times.)
Logged
soren renner
Global Moderator
Full Member
*****
Posts: 216



« Reply #7 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/
Logged
soren renner
Global Moderator
Full Member
*****
Posts: 216



« Reply #8 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$
Logged
soren renner
Global Moderator
Full Member
*****
Posts: 216



« Reply #9 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.
Logged
fnecati
Jr. Member
**
Posts: 60


« Reply #10 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 ?.

Logged
sage
Full Member
***
Posts: 168



WWW
« Reply #11 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.
Logged
sage
Full Member
***
Posts: 168



WWW
« Reply #12 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.


* A2.png (12.66 KB, 150x115 - viewed 729 times.)
« Last Edit: February 23, 2011, 05:41:26 PM by sage » Logged
soren renner
Global Moderator
Full Member
*****
Posts: 216



« Reply #13 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.
Logged
soren renner
Global Moderator
Full Member
*****
Posts: 216



« Reply #14 on: February 23, 2011, 05:51:04 PM »

TestOpenCLInfo.Info does NOT trap. It reports that "Error: Cannot get number of platforms!"
Logged
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!