GP2X Gpu940...how To Start, And Compiling For Pc


efegea

Active Member
Joined
Aug 8, 2005
Messages
636
Age
39
Location
GP32Spain, Spain
I've downloaded gpu940 from the cvs and got compiled it for my pc: a 64 bit gentoo linux. But does it work for it? I mean, can I dev for the pc using gpu940 or do I need an ARM940:so a GP2X. I want to test the games on the pc. It's possible?

I tried to run the samples on the gpu940 source tree but them give me a segfault.

And..

How do I start into programming with gpu940?

Where is the source of the egoboo2x? I mean the port, not the pc version. i can't find it. I want to take a look at it.

I _really_ want to develop something with gpu940 (I already have done some little apps with "plush", a little 3d software renderer) but don't know how to start :S
 
I've downloaded gpu940 from the cvs and got compiled it for my pc: a 64 bit gentoo linux. But does it work for it? I mean, can I dev for the pc using gpu940 or do I need an ARM940:so a GP2X. I want to test the games on the pc. It's possible?

I tried to run the samples on the gpu940 source tree but them give me a segfault.
gpu940 generates ARM code on the fly, that's why it is fast. And this means it can't run on your PC.
 
Last edited by a moderator:
It does work on PC. It uses shared memory and SDL instead of the 940T processor. Read the documentation it comes with and you would know that.
I stand corrected, sorry for the confusion :)

But then why it segfaults when I run the examples?
You should at least tell us where it segfaults on your PC!
Run it with gdb:

Code:
gdb test
run
where
Also you said you are running on x86_64. It may be possible there is a 32 vs 64 bit problem. If your distribution supports it, recompile the test and library with -m32.
 
Last edited by a moderator:
Sorry it not segfaults, I was confused. When I run the executables in the "sample" directory, this is the output (I've cutted half of it)

Code:
frajan@melee ~/cvs/gpu940/sample $ ./sample2
gpumm: new @0 [4096]
gpumm: new @4096 [128000]
gpumm: new @132096 [128000]
gpumm: new @260096 [128000]
gpumm: new @388096 [128000]
gpumm: new @516096 [128000]
gpumm: new @644096 [128000]
gpumm: new @772096 [128000]
gpumm: new @900096 [128000]
gpumm: new @1028096 [128000]
gpumm: new @1156096 [128000]
gpumm: new @1284096 [128000]
gpumm: new @1412096 [128000]
gpumm: new @1540096 [128000]
gpumm: new @1668096 [128000]
gpumm: new @1796096 [128000]
gpumm: new @1924096 [128000]
gpumm: new @2052096 [128000]
gpumm: new @2180096 [128000]
gpumm: new @2308096 [128000]
gpumm: new @2436096 [128000]
gpumm: new @2564096 [128000]
gpumm: new @2692096 [128000]
gpumm: new @2820096 [128000]

But it doesn't open any window and doesn't show anything.

The first time I ran it, it said something like "can't find gpu940". Then I tried running the executables in the "bin" dir and now it says the text in the quote BUT there is not any "gpu940" process running on memory (checked with "ps aux")

UPDATE: if I run the "gpu940" bin it shows a black 320x240 window :) BUT if at the same time I run "sample1" while it's running then "gpu940" segfaults.."sample1" still shows the text in the quote.. This is the gdb output:

Code:
frajan@melee ~/cvs/gpu940/bin $ gdb ./gpu940
GNU gdb 6.4
Copyright 2005 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".

(gdb) run
Starting program: /home/frajan/cvs/gpu940/bin/gpu940
[Thread debugging using libthread_db enabled]
[New Thread 47818292378336 (LWP 29240)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 47818292378336 (LWP 29240)]
raster_gen () at raster.c:154
154							 *w_ = color;
(gdb)
 
I could reproduce the problem with FC5 x86_64.
I can't compile in 32 bit mode (no SDL available).

I tried to locate the problem and it looks like this line in poly.c/draw_line produces a wrong pointer:

Code:
ctx.line.w = ctx.location.out_start + c_start + ((ctx.poly.nc_declived>>16)<<ctx.location.buffer_loc[gpuOutBuffer].width_log);
Can't say much more, don't know the code well enough.
rixed will have to take a look :)
 
Compiled in 32 bit mode....(thanks to gentoo 32bit emul libraries :D) and YES it's an arquitecture problem: in 32bits it runs :)

Don't know how to fix it.. so for now I will compile in 32bit :(




EDIT: but now I need to know how to code for gpu940...I don't know the API :unsure:
 
I have read and done a few opengl tutorials, but I can't see any similities between them and the samples of gpu940
 
The samples provided with gpu940 do not use the OpenGL layer that rixed has made. If you use the GL headers provided, then you should be able to use at least the common OpenGL functions.
 
The samples provided with gpu940 do not use the OpenGL layer that rixed has made. If you use the GL headers provided, then you should be able to use at least the common OpenGL functions.

Nice..I didn't know that :)

But..the tutorials I've seen use GLUT and I thought gpu940 doesn't...

Where is the source of the egoboo2x?
 
Last edited by a moderator:
The samples provided with gpu940 do not use the OpenGL layer that rixed has made. If you use the GL headers provided, then you should be able to use at least the common OpenGL functions.

Nice..I didn't know that :)

But..the tutorials I've seen use GLUT and I thought gpu940 doesn't...

Where is the source of the egoboo2x?

Glut is only for windowing and input... you don't need windowing functions on such a little screen and the only input worth worrying about (in many cases) is the GP2X joystick. You don't need to worry about glut or the lack thereof.
 
Last edited by a moderator:
I didn't see the "GL" dir, only the "gl" dir that was empty. "GL" dir has two opengl examples :)

But I'm getting only 50fps on gpugears on my athlon64 3400... :blink:
 
CVS = Concurrent Versions System, meaning code base manipulation and management through the internet. Code can be submitted or downloaded depending on what your authorised to do.
 
Hi !

I just uploaded egoboo2x source code in gna file directory :

http://download.gna.org/gpu940

For the bug on amd64 : ouch, Im going to have a look. Having no such machine at hand will not help.
Can someone post the relevant object file (poly.o I presume) so that I can have a look to the code generated ?

For the different between OpenGL API and what's supported by gpu940, there are many ! Most of opengl-es works as required, though.
For simplicity, I added glBegin/glEnd functions. Most of the float functions are just quick float to fixed converter. Blending is weird, as well as most texture modes (MODULATE, BLEND, etc). Most of exotic things are not, nor will ever be, implemented.

There are only two GL samples in GL/samples. gpugears is not very fast (have a look in raster.c to know why : the raster drawing routine on PC is awfully slow). But be confident that all samples will run even slower on the GP2X :p

As for GLU and GLUT : no, there are no such thing in gpu940. If you only need some no-GLX functions (like gluLookAt), you can simply port these libs to GP2X, commenting out all GLX related stuff.

Good luck !
 
I'm also trying the gpu940... right now trying to get the gears-demo to run.

However openGPU seems to hang on this line in the function gpuOpen()

Code:
while (shared->frame_count != 0);

this comes right after

Code:
static gpuCmdReset reset = { .opcode = gpuRESET };
gpuErr err = gpuWrite(&reset, sizeof(reset), true);
if (gpuOK != err) return err;

and idea what could cause this? or how I can find out what caused it?
I assume it's waiting for the second processor to do the gpu-reset-command ???

thanks for the info!

Ow never mind obviously I have to run the gpu940-process too :p lets see if I can make it happen ;)
 
Back
Top