mesa-cell driver

YDL running on the Sony Playstation 3

Moderator: billb

mesa-cell driver

Postby billb » 21 Sep 2008, 17:03

I finally managed to compile the mesa-cell driver and check it out ...

http://www.mesa3d.org/cell.html

This is not a detailed guide of every step, but here's some info on what I did:

First, you need git to fetch the development code, so if you don't have that use yum install git (you'll need third party repos -- it's in fedora-extras).

Get an initial local copy of the repository with:
(source will be downloaded to your current working directory, so you might want to create a source folder first as shown here)

Code: Select all
mkdir ~/source

Code: Select all
cd ~/source

Code: Select all
git clone git://anongit.freedesktop.org/git/mesa/mesa


Change to the mesa folder and check out the gallium-0.2 branch with:

Code: Select all
cd mesa

Code: Select all
git-checkout -b gallium-0.2 origin/gallium-0.2


Compile it with:

Code: Select all
make linux-cell


This is where I ran into trouble at first ... you'll need ppu-gcc32 installed -- to get all the ppu and spu packages I used yum install *ppu* *spu*. Also I had an error regarding a missing libmisc.h which is from the Cell SDK (/opt/cell/sdk/usr/include/libmisc.h), so I followed this post for installing IBM's Cell SDK). After that I was able to compile with no errors.

With compiling finished, the driver is located in the lib folder, and example programs are in the progs folder. To run the examples without actually installing the driver on your system, you can set the LD_LIBRARY_PATH in your terminal window before running the examples. For example:
Code: Select all
LD_LIBRARY_PATH=/home/bill/source/mesa/lib

Code: Select all
export LD_LIBRARY_PATH

(replace /home/bill/source/mesa/lib with the correct location on your system)

Then try some of the example programs, for example:

Code: Select all
cd progs/xdemos

Code: Select all
./glxinfo


If it's working you should see:

OpenGL vendor string: Tungsten Graphics, Inc.
OpenGL renderer string: Gallium 0.2, Cell on Xlib
OpenGL version string: 1.3 Mesa 7.3-devel


Some things to try:

./glxgears
./glxheads

Other demos:

cd ../demos
./texcyl
(right click in the window for options)

Screenshot of texcyl running with the "textured" option:

http://pleasantfiction.com/Gallery/albu ... ll_0_2.png

Also, you can try:

CELL_DEBUG=checker
export CELL_DEBUG

which "lets you see which SPU is rendering which screen tiles" as shown here:

./gears

http://pleasantfiction.com/Gallery/albu ... ell0_2.png

I haven't been able to get any non-demo programs running properly with it yet, and some of the demos don't work either. Anyway, it was interesting to see it working and hopefully we'll see continued development that will eventually lead to the ability to run OpenGL applications like foobillard, celestia, 3d chess, etc. Or maybe even Quake 3 could be playable one day? :D
PS3 60GB [CECHA01], FW 3.15, YDL 6.2, Samsung T260HD @ 1920x1200
Powermac G4 1.25 GHz x2, 2 GB RAM, YDL 6.2
User avatar
billb
Site Admin
Site Admin
 
Posts: 5522
Joined: 24 May 2007, 20:30
Location: Eastern NC, USA

Re: mesa-cell driver

Postby Efaustus9 » 21 Sep 2008, 18:16

nice post billb. its nice to see some opengl prospects for ps3 linux coming to fruition.
SKU: CECHB01 PS3 (20GB) upgraded to 60GB HD.
YDL Killed by Firmware 3.30 but linux on my HDTV lives on!
http://tinyurl.com/2dcujby
Samsung LN-S4041D 40"
User avatar
Efaustus9
Moderator
Moderator
 
Posts: 185
Joined: 18 Apr 2008, 06:49
Location: MA USA

Re: HELP!! I cant login anymore (in YDL 6)

Postby CronoCloud » 21 Sep 2008, 18:19

billb wrote:
The glxgears demo runs smoothly fullscreen, and also the one I showed in the screenshot. With the regular mesa driver it crawls and you can see each individual frame drawn. Some of the demos don't run properly at this point, though, and I haven't found an application that's able to run with it (tried celestia, foobillard, and will try the 3d chess game). Maybe foobillard would work if I disabled some of the OpenGL features ... haven't tried yet. I hope they continue working to improve it -- this gives me some hope!


You might need to compile applications from source to get them to work with it.

Ron Rogers Jr. (CronoCloud)
CECHE01 PS3 (MGS4 80GB Bundle) without OtherOS and with an upgraded 320GB HD
Running Fedora 23 on a Compaq Presario CQ5320F upgraded with a Phenom X4 and GT640
Vizio E221A1 22" 1080P TV with HDMI, using 1080P over HDMI
PSN ID: CronoCloudAuron
User avatar
CronoCloud
Moderator
Moderator
 
Posts: 523
Joined: 21 Oct 2006, 05:48
Location: Central Illinois, USA

Re: mesa-cell driver

Postby billb » 21 Sep 2008, 18:45

One thing I've noticed -- the SPE scaler tool application doesn't play well with mesa-cell. If you run the scaler tool while the glxgears demo is running it becomes choppy and slow.
PS3 60GB [CECHA01], FW 3.15, YDL 6.2, Samsung T260HD @ 1920x1200
Powermac G4 1.25 GHz x2, 2 GB RAM, YDL 6.2
User avatar
billb
Site Admin
Site Admin
 
Posts: 5522
Joined: 24 May 2007, 20:30
Location: Eastern NC, USA

Re: HELP!! I cant login anymore (in YDL 6)

Postby billb » 21 Sep 2008, 18:46

CronoCloud wrote:You might need to compile applications from source to get them to work with it.


I think it is due to problems with the mesa-cell driver or features not implemented yet, but will look into it.
PS3 60GB [CECHA01], FW 3.15, YDL 6.2, Samsung T260HD @ 1920x1200
Powermac G4 1.25 GHz x2, 2 GB RAM, YDL 6.2
User avatar
billb
Site Admin
Site Admin
 
Posts: 5522
Joined: 24 May 2007, 20:30
Location: Eastern NC, USA

Re: mesa-cell driver

Postby CronoCloud » 22 Sep 2008, 02:01

For fun, try running the GL based xscreensavers directly a la:
Code: Select all
/usr/libexec/xscreensaver/glmatrix

glschool is impressive.

Or just install the libs in /usr/local/lib run ldconfig and try out xscreensaver-demo


Ron Rogers Jr. (CronoCloud)
CECHE01 PS3 (MGS4 80GB Bundle) without OtherOS and with an upgraded 320GB HD
Running Fedora 23 on a Compaq Presario CQ5320F upgraded with a Phenom X4 and GT640
Vizio E221A1 22" 1080P TV with HDMI, using 1080P over HDMI
PSN ID: CronoCloudAuron
User avatar
CronoCloud
Moderator
Moderator
 
Posts: 523
Joined: 21 Oct 2006, 05:48
Location: Central Illinois, USA

Re: mesa-cell driver

Postby billb » 22 Sep 2008, 03:33

Hadn't thought of that -- will give the GL screensavers a try! :)
PS3 60GB [CECHA01], FW 3.15, YDL 6.2, Samsung T260HD @ 1920x1200
Powermac G4 1.25 GHz x2, 2 GB RAM, YDL 6.2
User avatar
billb
Site Admin
Site Admin
 
Posts: 5522
Joined: 24 May 2007, 20:30
Location: Eastern NC, USA

Re: mesa-cell driver

Postby billb » 25 Sep 2008, 15:27

CronoCloud wrote:For fun, try running the GL based xscreensavers directly a la:
Code: Select all
/usr/libexec/xscreensaver/glmatrix

glschool is impressive.

Or just install the libs in /usr/local/lib run ldconfig and try out xscreensaver-demo


I tried the GL based xscrensavers (installed from repo -- didn't compile them myself) and some of them work well. When I run the glschool one it appears fine in the preview window, but my entire screen "flashes" when I run it full screen. The effect is similar to a computer screen with a different vsync when viewed with a video camera, if you know what I mean. Some of them either don't display at all or don't display properly. Limitations of the current version of the mesa-cell driver, I guess.
PS3 60GB [CECHA01], FW 3.15, YDL 6.2, Samsung T260HD @ 1920x1200
Powermac G4 1.25 GHz x2, 2 GB RAM, YDL 6.2
User avatar
billb
Site Admin
Site Admin
 
Posts: 5522
Joined: 24 May 2007, 20:30
Location: Eastern NC, USA

Re: mesa-cell driver

Postby zerojay » 30 Sep 2008, 19:18

billb wrote:One thing I've noticed -- the SPE scaler tool application doesn't play well with mesa-cell. If you run the scaler tool while the glxgears demo is running it becomes choppy and slow.


Probably because suddenly the SPE that is used by the scaler is being shared with mesa.
zerojay
ydl addict
ydl addict
 
Posts: 151
Joined: 09 May 2008, 20:32
Location: Quebec City, Canada

Re: mesa-cell driver

Postby billb » 30 Sep 2008, 20:06

I wonder if I start the scaler first, then try an OpenGL application ... hmm ... anyway, no real use for it yet, unless I try writing something simple in Python + PyOpenGL.
PS3 60GB [CECHA01], FW 3.15, YDL 6.2, Samsung T260HD @ 1920x1200
Powermac G4 1.25 GHz x2, 2 GB RAM, YDL 6.2
User avatar
billb
Site Admin
Site Admin
 
Posts: 5522
Joined: 24 May 2007, 20:30
Location: Eastern NC, USA

Re: mesa-cell driver

Postby juanito » 01 Oct 2008, 15:30

I followed the instructions, but when I try to install mesa I get:
Code: Select all
$ make linux-cell
(cd configs && rm -f current && ln -s linux-cell current)
make default
make[1]: Entering directory `/home/jack/source/mesa'
make[2]: Entering directory `/home/jack/source/mesa/src'
Making sources for linux-cell
make[3]: Entering directory `/home/jack/source/mesa/src/gallium'
make[4]: Entering directory `/home/jack/source/mesa/src/gallium/auxiliary'
make[5]: Entering directory `/home/jack/source/mesa/src/gallium/auxiliary/draw'
../../Makefile.template:64: depend: No such file or directory
rm -f depend
touch depend
makedepend -fdepend -Y  -I. -I../../../../src/gallium/include -I../../../../src/gallium/auxiliary -I../../../../src/gallium/drivers -I../../../../include  draw_context.c draw_pipe.c draw_pipe_aaline.c draw_pipe_aapoint.c draw_pipe_clip.c draw_pipe_cull.c draw_pipe_flatshade.c draw_pipe_offset.c draw_pipe_pstipple.c draw_pipe_stipple.c draw_pipe_twoside.c draw_pipe_unfilled.c draw_pipe_util.c draw_pipe_validate.c draw_pipe_vbuf.c draw_pipe_wide_line.c draw_pipe_wide_point.c draw_pt.c draw_pt_elts.c draw_pt_emit.c draw_pt_fetch.c draw_pt_fetch_emit.c draw_pt_fetch_shade_emit.c draw_pt_fetch_shade_pipeline.c draw_pt_post_vs.c draw_pt_util.c draw_pt_varray.c draw_pt_vcache.c draw_vertex.c draw_vs.c draw_vs_varient.c draw_vs_aos.c draw_vs_aos_io.c draw_vs_aos_machine.c draw_vs_exec.c draw_vs_llvm.c draw_vs_sse.c   \
                 2> /dev/null
make[5]: *** [depend] Error 127
make[5]: Leaving directory `/home/jack/source/mesa/src/gallium/auxiliary/draw'
make[4]: *** [subdirs] Error 1
make[4]: Leaving directory `/home/jack/source/mesa/src/gallium/auxiliary'
make[3]: *** [subdirs] Error 1
make[3]: Leaving directory `/home/jack/source/mesa/src/gallium'
make[2]: *** [subdirs] Error 1
make[2]: Leaving directory `/home/jack/source/mesa/src'
make[1]: *** [default] Error 1
make[1]: Leaving directory `/home/jack/source/mesa'
make: *** [linux-cell] Error 2

*ppc*, *spu* (where do the binaries get installed to?) and the ibm sdk all installed OK - any ideas?
juanito
ydl guru
ydl guru
 
Posts: 300
Joined: 30 Jul 2008, 05:30
Location: Dubai, U.A.E.

Re: mesa-cell driver

Postby billb » 02 Oct 2008, 01:23

Binaries from RPMs generally get installed to /usr/bin unless they're shared objects which go in /usr/lib.

When I have a chance I'll build it again and post the log for comparison.
PS3 60GB [CECHA01], FW 3.15, YDL 6.2, Samsung T260HD @ 1920x1200
Powermac G4 1.25 GHz x2, 2 GB RAM, YDL 6.2
User avatar
billb
Site Admin
Site Admin
 
Posts: 5522
Joined: 24 May 2007, 20:30
Location: Eastern NC, USA

Re: mesa-cell driver

Postby juanito » 02 Oct 2008, 09:58

Binaries from RPMs generally get installed to /usr/bin unless they're shared objects which go in /usr/lib

...sure, I was thinking the binaries would be called gcc-ppu, etc - in fact they're called ppu-gcc etc, and I'd forgotten files from git need autogen :oops:

So, here's where I am at the moment:
Code: Select all
# yum install autoconf automake libdrm-devel
$ ./autogen.sh
checking pkg-config files for X11 are available... yes
checking for LIBDRM... configure: error: Package requirements (libdrm >= 2.3.1) were not met:
Requested 'libdrm >= 2.3.1' but version of libdrm is 2.0.2

..so, after installing libdrm-2.3.1.from source:
Code: Select all
$ ./autogen.sh
checking for LIBDRM... yes
checking for DRI2PROTO... configure: error: Package requirements (dri2proto >= 1.99.1) were not met:

..and, although I can find references to dri2proto-1.99.1.tar.bz2, I cannot [url]find the file - where did you get it from, cvs? (if so, what cvs command was used?)

Edit: I patched dri2proto-1.1 with the diff http://lists.freedesktop.org/archives/xorg-commit/2008-August/017806.html and it seemed to work - I also needed to install libspe2-2.2.80-132 from source

...and finally:
Code: Select all
$ LD_LIBRARY_PATH=/home/jack/source/mesa/lib ./glxinfo

OpenGL vendor string: Tungsten Graphics, Inc.
OpenGL renderer string: Gallium 0.2, Cell on Xlib
OpenGL version string: 2.0 Mesa 7.3-devel

$ LD_LIBRARY_PATH=/home/jack/source/mesa/lib ./glxgears
Cell: unimplemented TGSI instruction 52!
Cell: unimplemented TGSI instruction 52!
298 frames in 5.0 seconds = 59.590 FPS
306 frames in 5.0 seconds = 61.110 FPS


..about the same as my 5-year old laptop :?
ps3 60gb, cechc04, fw-3.15, ydl-6.2/cblfs multi-lib dual boot
dell 2009w monitor, logitech mediaboard (usb)
juanito
ydl guru
ydl guru
 
Posts: 300
Joined: 30 Jul 2008, 05:30
Location: Dubai, U.A.E.

Re: mesa-cell driver

Postby zerojay » 02 Oct 2008, 20:58

This is one of those "bear skateboards badly" situations. It's amazing it works at all at this point. Optimization comes second.
zerojay
ydl addict
ydl addict
 
Posts: 151
Joined: 09 May 2008, 20:32
Location: Quebec City, Canada

Re: mesa-cell driver

Postby billb » 02 Oct 2008, 21:22

@juanito -- yes, even the developers say it is rather slow at this point:

http://www.mesa3d.org/cell.html
"In general, however, the driver is rather slow because all vertex transformation is being done by an interpreter running on the PPU. Programs with many vertices or complex vertex shaders will run especially slow. This will be addressed in the future."

But it's good to see it working even if it's slow and doesn't run much right now.
PS3 60GB [CECHA01], FW 3.15, YDL 6.2, Samsung T260HD @ 1920x1200
Powermac G4 1.25 GHz x2, 2 GB RAM, YDL 6.2
User avatar
billb
Site Admin
Site Admin
 
Posts: 5522
Joined: 24 May 2007, 20:30
Location: Eastern NC, USA

Next

Return to Playstation 3

Who is online

Users browsing this forum: No registered users and 10 guests

cron