forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

OpenCL for Cell

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS3 Linux Development
View previous topic :: View next topic  
Author Message
carlosn



Joined: 10 Mar 2005
Posts: 38
Location: Orlando, Florida, US

PostPosted: Tue Nov 03, 2009 3:48 am    Post subject: OpenCL for Cell Reply with quote

This is great news! Cell now supports opencl. I installed the OpenCL Development Kit in my ps3. The Julia set sample outputs to the ps3 framebuffer with minor modifications to the Makefile.

Here is a link to the IBM website.

http://www.ibm.com/developerworks/forums/thread.jspa?threadID=281018&tstart=0
Back to top
View user's profile Send private message Visit poster's website
rapso



Joined: 28 Mar 2005
Posts: 148

PostPosted: Tue Nov 03, 2009 7:19 pm    Post subject: Reply with quote

thx for sharing that, that's frickin cool. now all major platforms are supported by opencl, easy to write code once and get all the power from all kind of hardware.
I wonder if that will be also part of the cell sdk for ps3, just seen IBM server support so far.
_________________
Sony stole my linux|amazon stole my PS3 :(
Back to top
View user's profile Send private message
carlosn



Joined: 10 Mar 2005
Posts: 38
Location: Orlando, Florida, US

PostPosted: Tue Nov 03, 2009 10:03 pm    Post subject: Reply with quote

rapso wrote:

I wonder if that will be also part of the cell sdk for ps3, just seen IBM server support so far.


The packages posted in the IBM website support the PS3 as well. The IBM BladeCenter QS22 has 2 cell processors inside. The software is compatible with the PS3. You have to install the cell sdk prior to installing the opencl sdk.
Back to top
View user's profile Send private message Visit poster's website
kengreen



Joined: 31 Jul 2008
Posts: 13

PostPosted: Thu Nov 05, 2009 3:55 am    Post subject: Reply with quote

I had some problems running the julia example, whether I use the --ps3 switch or not. I have IBM SDK 3.1 installed on YDL 6.2 with IBM XLC-SSC 0.9 from SDK 3.0. The julia example compiles without error but running it, it complains about an incompatible kernel in the src directory.
Back to top
View user's profile Send private message
carlosn



Joined: 10 Mar 2005
Posts: 38
Location: Orlando, Florida, US

PostPosted: Thu Nov 05, 2009 7:23 am    Post subject: Reply with quote

I am also running YDL 6.2 and cell sdk 3.1. The compiler I am using is good old reliable gcc/g++.

Besides installing the OpenCL Development Kit, did you also install the IBM XL Compiler for OpenCL, V0.1? Both downloads are provided by IBM.
Back to top
View user's profile Send private message Visit poster's website
KaL



Joined: 03 Apr 2005
Posts: 41

PostPosted: Fri Nov 06, 2009 1:10 am    Post subject: Reply with quote

Well...
I installed the OpenCL rpms succesfully on my system...
But when I try executing the samples I get the following errors :
Code:
[root@ramen ppc]# make clean
[root@ramen ppc]# make
gcc -I. -g -O3 -m32 -DPPM=0    -c -o julia_ocl.o ../src/julia_ocl.c
gcc -I. -g -O3 -m32 -DPPM=0    -c -o clock.o ../src/clock.c
gcc -I. -g -O3 -m32 -DPPM=0    -c -o ps3.o ../src/ps3.c
gcc -lCL -lnetpbm -m32 -lm -lstdc++  julia_ocl.o clock.o ps3.o ../src/ppm_util.h   -o julia_ocl
cp -f ../src/julia_kernel.cl .
[root@ramen ppc]# ./julia_ocl
Device: "ACCELERATOR CellBE processor"
Loading program source 'julia_kernel.cl'....
Error Log -- ERROR: no valid __kernel function found in source

[root@ramen ppc]#


I tried to tweak the .cl code, but still not working. Any idea of what's going wrong ? :/
Back to top
View user's profile Send private message
carlosn



Joined: 10 Mar 2005
Posts: 38
Location: Orlando, Florida, US

PostPosted: Fri Nov 06, 2009 2:26 am    Post subject: Reply with quote

I had similar issues at the beginning. I believe the IBM XL Compiler for OpenCL is not installed properly. Installing the rpms located in the iso is not enough. You have to run the xlc_install (bash script) for proper installation. The only problem is the script checks for Fedora 7 or Red Hat Enterprise 5 installations before running.

My work around was to copy all the files from the iso to the local hard drive. Edit xlc_install and change lines number 56 and 82 to the following:

56. local ($cmpFixVer) = "0.1.0-0";
82. local (%cmp_pkgs) = &get_package_names ($prod, "$cmpVer$cmpFixVer");

Run the local copy of xlc_install and you should get this output on the screen.
Code:

----------------------------------------------------------------------------
Starting IBM XL C for OpenCL for Multicore Acceleration for Linux
Installation Script

----------------------------------------------------------------------------
[Stage 1]  Validating ./images-ppc/rpms/ Directory
   INFORMATIONAL: -------- 0
   Checking "opencl-xlc-lic--.ppc64.rpm" in "./images-ppc/rpms" .. (FAILED)
   WARNING: opencl-xlc-lic ... OK to miss
[Stage 1]  Validating ./images-ppc/rpms/ Directory ----- (PASSED)
----------------------------------------------------------------------------

----------------------------------------------------------------------------
[Stage 2]  Checking System Pre-requisites
[Stage 2]  Checking System Pre-requisites ----- (PASSED)
----------------------------------------------------------------------------

----------------------------------------------------------------------------
[Stage 3]  Retrieving installed XL compiler(s) info
[Stage 3]  Retrieving installed XL compiler(s) info ----- (PASSED)
----------------------------------------------------------------------------

----------------------------------------------------------------------------
[Stage 4]  Confirming to proceed with this installation
[Stage 4]  Confirming to proceed with this installation ----- (PASSED)
----------------------------------------------------------------------------

----------------------------------------------------------------------------
[Stage 5]  Uninstalling previous installations
   No packages to be uninstalled.
[Stage 5]  Uninstalling previous installations ----- (PASSED)
----------------------------------------------------------------------------

----------------------------------------------------------------------------
[Stage 6]  Installing "XL C for OpenCL for Multicore Acceleration for Linux"
Version -0.1.0-0
   Preparing...         
   ##################################################
   opencl-xlc-cmp        
   ##################################################
   Warning:  already exists
   opencl-xlc-man        
   ##################################################
   opencl-xlc-rte        
   ##################################################
   opencl-xlc-lib        
   ##################################################
   opencl-xlc-help        
   ##################################################
   opencl-cell-xlc-lib        
   ##################################################
   opencl-cell-xlc-cmp        
   ##################################################
   opencl-xlc-rte-lnk        
   ##################################################
[Stage 6]  Installing "XL C for OpenCL for Multicore Acceleration for Linux"
Version -0.1.0-0 ----- (PASSED)
----------------------------------------------------------------------------

----------------------------------------------------------------------------
[Stage 7]  Configuring "XL C for OpenCL for Multicore Acceleration for Linux"
----- (PASSED)
----------------------------------------------------------------------------

----------------------------------------------------------------------------
[Stage 8]  Creating symbolic links to "/usr/bin"
   Do you want to create symbolic links for the "IBM XL C for OpenCL for
   Multicore Acceleration for Linux" compiler invocations in the "/usr/bin"
   location?
   By accepting to create the symbolic links, the links below will be
   created.  Any existing "IBM XL C for OpenCL for Multicore Acceleration for
   Linux" compiler invocations in the "/usr/bin" will be removed before the
   links are created.
   Link              Source
   ===============          ====================
   /usr/bin/xlcl          /opt/ibmcmp/xlc/opencl/0.1/bin/xlcl
   /usr/bin/ppu-xlcl          /opt/ibmcmp/xlc/opencl/0.1/bin/ppu-xlcl
   /usr/bin/spu-xlcl          /opt/ibmcmp/xlc/opencl/0.1/bin/spu-xlcl
   ===============          ====================
   Do you want to proceed with the symbolic links?   
   Please type "yes" or "no": 
   Symbolic links are created.
[Stage 8]  Creating symbolic links to "/usr/bin" ----- (PASSED)
----------------------------------------------------------------------------

----------------------------------------------------------------------------
"IBM XL C for OpenCL for Multicore Acceleration for Linux" Version -0.1.0-0
has been successfully installed.
To learn about setting up your environment with "IBM XL C for OpenCL for
Multicore Acceleration for Linux", refer to the Installation Guide.

Installation Completed.
Back to top
View user's profile Send private message Visit poster's website
KaL



Joined: 03 Apr 2005
Posts: 41

PostPosted: Fri Nov 06, 2009 3:30 am    Post subject: Reply with quote

Thanks a lot for the wrokaround !
It works now :)
Back to top
View user's profile Send private message
kengreen



Joined: 31 Jul 2008
Posts: 13

PostPosted: Fri Nov 06, 2009 5:41 am    Post subject: OpenCL Reply with quote

Applied edits to xlc_install file, which must be named xlc_install, and all the OpenCL examples worked. The julia_ocl --ps3 must have more than 4M of frame buffer memory.
BlackScholes and Perin-noise also worked using the default settings.
Back to top
View user's profile Send private message
rapso



Joined: 28 Mar 2005
Posts: 148

PostPosted: Tue Nov 10, 2009 12:36 am    Post subject: Reply with quote

allow me one stupid fanboy question, how is the performance?
anyone compared to pc builds?
_________________
Sony stole my linux|amazon stole my PS3 :(
Back to top
View user's profile Send private message
carlosn



Joined: 10 Mar 2005
Posts: 38
Location: Orlando, Florida, US

PostPosted: Tue Nov 10, 2009 2:25 am    Post subject: Reply with quote

Well, the Julia set example provided in the samples is a good reference. It generates 50 frames in 1.92 sec. The frames are 512x512 in size. So we’re talking roughly at about 26 frames per seconds. I consider this real time.

I believe one of the samples in Mac OS produces Julia sets as well. I don’t have a Mac. Someone with a Mac OS could post the performance under that platform.

Couple of tips under the PS3:
julia_ocl –-ps3 --accel -i 500 // will give you about 25 secs of animation
Julia_ocl –b –-ps3 accel –i 500 // loads from binary source (faster)
Back to top
View user's profile Send private message Visit poster's website
carlosn



Joined: 10 Mar 2005
Posts: 38
Location: Orlando, Florida, US

PostPosted: Tue Nov 10, 2009 3:12 pm    Post subject: Reply with quote

I wrote my first program in OpenCL. The program queries the OpenCL environment.

Here is a link to my website where you can download the program
http://home.earthlink.net/~carlos_neto/

Enjoy!

Carlos
Back to top
View user's profile Send private message Visit poster's website
rapso



Joined: 28 Mar 2005
Posts: 148

PostPosted: Tue Nov 10, 2009 9:13 pm    Post subject: Reply with quote

can you mail me the julia code ( I guess it's part of the opencl sdk from ibm?) I will try to get it running on the gtx260 here.

--removed email--

thx in advance
_________________
Sony stole my linux|amazon stole my PS3 :(


Last edited by rapso on Tue Dec 13, 2011 8:51 pm; edited 1 time in total
Back to top
View user's profile Send private message
rapso



Joined: 28 Mar 2005
Posts: 148

PostPosted: Tue Nov 10, 2009 10:25 pm    Post subject: Reply with quote

ok, i got the apple juliaset demo source and ported it to win32, i had to outcomment most of the opengl part, so i've no prove yet that everything works fine, but it was just a 20min lunch-time hack-port (and stepping through the loading, init and compute part does not show any obvious errors).

gfx card is gtx260:
framerate is between 250 and 280fps, most time around 260fps

edit:
could you tweak the kernel size and check if that affects the performance, please? from cuda I know this has usually quite a big impact. I've tested various "WorkGroupItems" and setting it to 64 gave ~330fps.
thx in advance!
_________________
Sony stole my linux|amazon stole my PS3 :(
Back to top
View user's profile Send private message
vandungto



Joined: 17 Nov 2009
Posts: 1

PostPosted: Tue Nov 17, 2009 3:20 am    Post subject: IBM OpenCL Forum Reply with quote

If you have questions about the IBM OpenCL Development Kit, you can post your questions to the IBM OpenCL forum

http://www.alphaworks.ibm.com/tech/opencl/forum

You should get your questions answered quicker.
Back to top
View user's profile Send private message
carlosn



Joined: 10 Mar 2005
Posts: 38
Location: Orlando, Florida, US

PostPosted: Sat Jan 02, 2010 12:50 pm    Post subject: Reply with quote

I noticed the IBM website has updated the OpenCL developoment kit for the cell processor. The newer version installs just fine in my PS3.
For those of you who followed this tread from the beginning, there is a minor change to the above instructions. When you edit the xlc_install script, use the following parameters for lines 56 and 82:

56.local ($cmpFixVer) = "0.1.1-0";
82. local (%cmp_pkgs) = &get_package_names ($prod, "$cmpVer$cmpFixVer");

The rest of the instructions are identical.

I run my opencl_info program on this version and I can see IBM is starting to implement device extensions.

I posted a copy of the generated output in my website.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS3 Linux Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group