Newbie PS3 development, all kinds of questions

Technical discussion on the newly released and hard to find PS3.

Moderators: cheriff, emoon

Post Reply
steelblood_relic
Posts: 8
Joined: Wed Jan 30, 2008 9:11 am

Newbie PS3 development, all kinds of questions

Post by steelblood_relic »

Hi all!

Here's my questions (I'm linux newbie):

PS3 firmware >= 2.10:

1. Am I still going to be able to develop for the six Cell SPE cores(I have 2.0 now)? Probably really lame question, but please, only answer yes to that question if you are 100% certain (because I sure aint). Or is there any way to fool the system that it has been updated, because I most of all want to use the Playstation Network feature, which I can't, unless I update...

2. Is there any way of drawing 3D graphics in software (for example software version of OpenGL, SDL/OpenGL or something similar...) easily (without access to RSX)? If yes, what core/hardware-thread is going to do the drawing work?

YDL 5 & Cell BS SDK 2.0/3.0:

3. Does Cell BS SDK 3.0 work on YDL 5 or is 2.0 the way to go?

4. Is really 10GB sufficient for either Cell BS SDK 2.0 (or 3.0) + YDL etc (without full simulation programs etc)?

5. Is everything in the Cell BS SDK compatible with the Cell? For example, performance measurement programs and so on.

PS3 hardware

6. Do I have full access to the 2 * PPU and 6 * SPU hardware threads, and all 256KB memory on each SPE-core?

Video output...

7. I have a Linux PS2 development kit, and I got a PS2 video output -> VGA contact included. Can I use this with my PS3? I want to connect my PS3 to my computer TFT monitor(which has VGA input) If yes, what ps3videomode-mode?

and finally...

How on earth do you debug eight simultaniously running threads (if that's how many you actually have access to), my previous (and tiny) experience with gdb is that it does not work so well on multithreaded applications, like most debuggers.

Thanks in advance!
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Re: Newbie PS3 development, all kinds of questions

Post by jimparis »

steelblood_relic wrote:1. Am I still going to be able to develop for the six Cell SPE cores(I have 2.0 now)? Probably really lame question, but please, only answer yes to that question if you are 100% certain (because I sure aint).
Yes
Or is there any way to fool the system that it has been updated, because I most of all want to use the Playstation Network feature, which I can't, unless I update...
Yes, there are some ways (search for other threads on this forum about it) but Sony could easily prevent them from working.
2. Is there any way of drawing 3D graphics in software (for example software version of OpenGL, SDL/OpenGL or something similar...) easily (without access to RSX)? If yes, what core/hardware-thread is going to do the drawing work?
Sure, normal mesa opengl software rendering, on the PPU (= slow).
3. Does Cell BS SDK 3.0 work on YDL 5 or is 2.0 the way to go?
Don't know, I don't use YDL
4. Is really 10GB sufficient for either Cell BS SDK 2.0 (or 3.0) + YDL etc (without full simulation programs etc)?
Should be
5. Is everything in the Cell BS SDK compatible with the Cell? For example, performance measurement programs and so on.
See this thread: http://ozlabs.org/pipermail/cbe-oss-dev ... 03670.html
6. Do I have full access to the 2 * PPU and 6 * SPU hardware threads, and all 256KB memory on each SPE-core?
Yeah, as far as I know
7. I have a Linux PS2 development kit, and I got a PS2 video output -> VGA contact included. Can I use this with my PS3? I want to connect my PS3 to my computer TFT monitor(which has VGA input) If yes, what ps3videomode-mode?
I don't think there is support for sync-on-green type output, but I think there was an earlier thread about it in these forums.
How on earth do you debug eight simultaniously running threads (if that's how many you actually have access to), my previous (and tiny) experience with gdb is that it does not work so well on multithreaded applications, like most debuggers.
http://google.com/search?q=cell+spu+debugging
IronAvatar
Posts: 23
Joined: Sat Nov 25, 2006 5:53 am

Re: Newbie PS3 development, all kinds of questions

Post by IronAvatar »

steelblood_relic wrote:Video output...

7. I have a Linux PS2 development kit, and I got a PS2 video output -> VGA contact included. Can I use this with my PS3? I want to connect my PS3 to my computer TFT monitor(which has VGA input) If yes, what ps3videomode-mode?
I've just installed ydl on my ps3, and I use the VGA adapter from the PS2 linux kit with my acer monitor. It works just fine. I've set my default to use the 60hz 720p mode (number 33 I think) in rgb colour space.

The default mode is 3 and you should end up with discoloured text (mines was green until I did a "ps3videomode -v3 -r".

Just do a type "ps3videomode --?" to see the mode list and check the number I've quoted for it, and then edit your boot config to set the video mode on startup.

The only problem I have is using XWindows, it just doesn't like my setup at all and it's pretty low res (not to mention slow). But that's not a problem, as I'm intending to code on my pc and just copy the elf to the kit to run and test on there.

As for debugging...I have no clue! Maybe printf or stdout are your best friends until you can get a hold of a remote gdb/insight for the PS3. As I'm just starting to code on the PS3 I'm kind of wondering about the same thing too....
User avatar
jbit
Site Admin
Posts: 293
Joined: Sat May 28, 2005 3:11 am
Location: København, Danmark
Contact:

Re: Newbie PS3 development, all kinds of questions

Post by jbit »

steelblood_relic wrote:6. Do I have full access to the 2 * PPU and 6 * SPU hardware threads, and all 256KB memory on each SPE-core?
There aren't two PPUs, there is one PPU and two hardware thread contexts (SMT).
steelblood_relic
Posts: 8
Joined: Wed Jan 30, 2008 9:11 am

Re: Newbie PS3 development, all kinds of questions

Post by steelblood_relic »

jbit wrote:
steelblood_relic wrote:6. Do I have full access to the 2 * PPU and 6 * SPU hardware threads, and all 256KB memory on each SPE-core?
There aren't two PPUs, there is one PPU and two hardware thread contexts (SMT).
I know, I meant "(2 * PPU and 6 * SPU) hardware threads", 2+6 hardware threads.

Thank you for your replies.

EDIT:

All your tips really helped me getting started, thank you very much for your help. =)
steelblood_relic
Posts: 8
Joined: Wed Jan 30, 2008 9:11 am

Re: Newbie PS3 development, all kinds of questions

Post by steelblood_relic »

jimparis wrote:
2. Is there any way of drawing 3D graphics in software (for example software version of OpenGL, SDL/OpenGL or something similar...) easily (without access to RSX)? If yes, what core/hardware-thread is going to do the drawing work?
Sure, normal mesa opengl software rendering, on the PPU (= slow).
I can't find any resources on mesa software rendering, I have tried to create a window with SDL to draw in, but I can't get that to work. Does anyone have any link to either any tutorial of mesa3d, or sample code that works with the PS3 (for software rendering)?

It don't have to include OpenGL rendering stuff, only how to create a window, and connect mesa3d to it.

I would really appreciate some help with this!
d-range
Posts: 60
Joined: Fri Oct 26, 2007 8:22 pm

Post by d-range »

The mesa sourcecode contains a lot of examples, just get the sources from www.mesa3d.org, unpack and check the examples directory. I think it was called Demos, but I'm not sure. If you have all the development headers installed you should be able to build and run them. It will use software rendering automatically because there is no hw acceleration.

I'm not sure if you can use Mesa with SDL, probably you can but by default it renders to Xlib on X, OpenGL/OpenGL+dri if you have hw accel or framebuffer on console. For windowing and other convenience functionality you can use glut, which I think is included with the mesa sourcecode.
cyberfix
Posts: 4
Joined: Mon Dec 31, 2007 3:53 am

Post by cyberfix »

d-range wrote: I'm not sure if you can use Mesa with SDL, probably you can but by default it renders to Xlib on X, OpenGL/OpenGL+dri if you have hw accel or framebuffer on console. For windowing and other convenience functionality you can use glut, which I think is included with the mesa sourcecode.
I just noticed the following when I went to their site:
The Mesa Cell driver is part of the Gallium3D architecture.

Tungsten Graphics is leading the project. Two phases are planned. First, to implement the framework for parallel rasterization using the Cell SPEs, including texture mapping. Second, to implement a full-featured OpenGL driver with support for GLSL, etc.

Source Code
The Cell driver source code is on the gallium-0.1 branch of the git repository. After you've cloned the repository, check out the branch with:

git-checkout -b gallium-0.1 origin/gallium-0.1

To build the driver you'll need the IBM Cell SDK (version 2.1 or 3.0). To use the driver you'll need a Cell system, such as a PS3 running Linux, or the Cell Simulator (untested, though).

If using Cell SDK 3.0, first edit configs/linux-cell and add -DSPU_MAIN_PARAM_LONG_LONG to the SPU_CFLAGS.

To compile the code, run make linux-cell.

To use the library, make sure LD_LIBRARY_PATH points the Mesa/lib/ directory that contains libGL.so.

Verify that the Cell driver is being used by running glxinfo and looking for:

OpenGL renderer string: Gallium 0.1, Cell on Xlib

Driver Implementation Summary
Rasterization is parallelized across the SPUs in a tiled-based manner. Batches of transformed triangles are sent to the SPUs (actually, pulled by from main memory by the SPUs). Each SPU loops over a set of 32x32-pixel screen tiles, rendering the triangles into each tile. Because of the limited SPU memory, framebuffer tiles are paged in/out of SPU local store as needed. Similarly, textures are tiled and brought into local store as needed.

More recently, vertex transformation has been parallelized across the SPUs as well.

Status
As of February 2008 the driver supports smooth/flat shaded triangle rendering with Z testing and simple texture mapping. Simple demos like gears run successfully. To test texture mapping, try progs/demos/texcyl (press right mouse button for rendering options).

Contributing
If you're interested in contributing to the effort, familiarize yourself with the code, join the mesa3d-dev mailing list, and describe what you'd like to do.

This seems to be great news. That we can now partially use accellerated graphics and more support is coming. Of course since I am somewhat new to linux, I really do not know what the real implications are of Mesa 3D. I will have to read some more on it.
steelblood_relic
Posts: 8
Joined: Wed Jan 30, 2008 9:11 am

Post by steelblood_relic »

d-range wrote:The mesa sourcecode contains a lot of examples, just get the sources from www.mesa3d.org, unpack and check the examples directory. I think it was called Demos, but I'm not sure. If you have all the development headers installed you should be able to build and run them. It will use software rendering automatically because there is no hw acceleration.

I'm not sure if you can use Mesa with SDL, probably you can but by default it renders to Xlib on X, OpenGL/OpenGL+dri if you have hw accel or framebuffer on console. For windowing and other convenience functionality you can use glut, which I think is included with the mesa sourcecode.
Thank you for your reply. Although glut doesn't seem to be included with mesa. And I sure can't find those examples that you're talking about. I only found a link to a page that had, like 3 examples, which was written for Win32...

I thought you had to use SDL to display the graphics, how else can you connect a rendering context to openGL?

I guess that my question really is; what is the "Mesa3D-version" of the wglCreateContext()-function that you use for win32-OpenGL for software rendering (that should work with all PS3 firmwares)? I only get black screen with SDL, etc, and cannot find any openGL-function to connect it to the rendering context in linux/PS3.

Sorry if my questions is very basic, but I have only coded OpenGL for windows before... :P
androvsky
Posts: 33
Joined: Sun Nov 11, 2007 5:59 am

Post by androvsky »

cyberfix wrote:
d-range wrote: I'm not sure if you can use Mesa with SDL, probably you can but by default it renders to Xlib on X, OpenGL/OpenGL+dri if you have hw accel or framebuffer on console. For windowing and other convenience functionality you can use glut, which I think is included with the mesa sourcecode.
I just noticed the following when I went to their site:
The Mesa Cell driver is part of the Gallium3D architecture.
snip
This seems to be great news. That we can now partially use accellerated graphics and more support is coming. Of course since I am somewhat new to linux, I really do not know what the real implications are of Mesa 3D. I will have to read some more on it.
Mesa3D is an open-source implementation of OpenGL. So yes, we're getting Cell accelerated OpenGL. At the moment, it's incredibly slow, very buggy, and a royal pain to compile (I haven't been successful yet). The good news is there's at least three people putting in solid hours every week with constant improvements. They're going to be experimenting around with llvm later, so the Cell section is going to get a major re-write once they get the basics working. If anybody's managed to get it compiled on Ubuntu I'd love to hear about it.

steelblood_relic: Try http://nehe.gamedev.net/, there's a ton of tutorials there and many of them will have source that compiles in linux without needing glut or SDL. However, if Mesa doesn't come with glut then check your linux distribution's repositories for it, it's gotta be in there somewhere.
d-range
Posts: 60
Joined: Fri Oct 26, 2007 8:22 pm

Post by d-range »

steelblood_relic wrote: Thank you for your reply. Although glut doesn't seem to be included with mesa. And I sure can't find those examples that you're talking about. I only found a link to a page that had, like 3 examples, which was written for Win32...

I thought you had to use SDL to display the graphics, how else can you connect a rendering context to openGL?

I guess that my question really is; what is the "Mesa3D-version" of the wglCreateContext()-function that you use for win32-OpenGL for software rendering (that should work with all PS3 firmwares)? I only get black screen with SDL, etc, and cannot find any openGL-function to connect it to the rendering context in linux/PS3.

Sorry if my questions is very basic, but I have only coded OpenGL for windows before... :P
You don't need SDL to create an OpenGL rendering context, there's all kinds of different ways, of which SDL is only one. If you just want to open a window and bind an OpenGL context to it to hack away at, glut is one of the easier ways.

http://www.opengl.org/resources/libraries/glut/
http://www.opengl.org/code/category/C19/

You might be able to install glut using yum or apt-get or whatever you're using. The NeHe site androvsky mentioned is great, it also has tutorials that use glut.

http://nehe.gamedev.net/counter.asp?fil ... l_glut.zip

Should contain more than enough to get you started.
korn16ftl
Posts: 21
Joined: Thu Jul 10, 2008 7:03 am

Re: Newbie PS3 development, all kinds of questions

Post by korn16ftl »

jimparis wrote:
steelblood_relic wrote:
7. I have a Linux PS2 development kit, and I got a PS2 video output -> VGA contact included. Can I use this with my PS3? I want to connect my PS3 to my computer TFT monitor(which has VGA input) If yes, what ps3videomode-mode?
I don't think there is support for sync-on-green type output, but I think there was an earlier thread about it in these forums.
have u tryed installin the ps2 linux kit using the ps2 data downloadable at the playstation store i think its called playstation2 system data or somrhing like that it makes it so you can install final fantasy 11 i know that much and any other HD related ps2 pariphal/games ect.
Post Reply