Author Topic: Tremulous with Dual Core  (Read 15642 times)

durand

  • Posts: 201
  • Turrets: +0/-0
Tremulous with Dual Core
« on: April 21, 2007, 11:40:01 am »
How do I enable smp in tremulous? I've looked through a few threads but none of them seem to give me the right answer. I've gathered that you need to recompile tremulous, patch the makefile and compile with SMP but it still doesnt compile the client, just tremded. This is using svn, btw. Oh and I've enabled r_smp in tjw's client.  Is there any way to test if it works? Thanks!

Xonya

  • Posts: 204
  • Turrets: +2/-1
    • http://tremulous.net/phpBB2/viewtopic.php?p=20830&highlight=#20830
Re: Tremulous with Dual Core
« Reply #1 on: April 21, 2007, 05:34:14 pm »
Quote from: "durand"
How do I enable smp in tremulous? I've looked through a few threads but none of them seem to give me the right answer. I've gathered that you need to recompile tremulous, patch the makefile and compile with SMP but it still doesnt compile the client, just tremded. This is using svn, btw. Oh and I've enabled r_smp in tjw's client.  Is there any way to test if it works? Thanks!


My brother has Dual Core win64 and he has original tremulous @ portable hard drive and it is working perfectly.
ap Zap || Thank you for the NEW shoes

benmachine

  • Posts: 915
  • Turrets: +99/-76
    • ben's machinery
Tremulous with Dual Core
« Reply #2 on: April 21, 2007, 06:08:58 pm »
First of all, I've heard symmetric multiprocessing will not work with SDL (or something, can't remember the details) except under Mac OS X. So if you are on a Linux/Windows machine, don't bother.
Secondly, go look to see if you have a Makefile.local and if it is specifying BUILD_CLIENT_SMP =0 or something (I can't remember the exact variable name) which would prevent the client from being made.
You can test if /r_smp 1 is working for you because on startup you should get this message popping up in your console somewhere:
Code: [Select]
...
...using GL_EXT_compiled_vertex_array
...ignoring GL_EXT_texture_filter_anisotropic
Trying SMP acceleration...
WARNING: You enable r_smp at your own risk!
Render thread starting
...succeeded.
...

Whether it is positively affecting your performance is something harder to ascertain.
benmachine

durand

  • Posts: 201
  • Turrets: +0/-0
Tremulous with Dual Core
« Reply #3 on: April 21, 2007, 07:33:44 pm »
Oh ok, thanks! Im on linux by the way.

Xonya, your brother's pc is windows so that won't help much, thanks anyway.

benmachine, there was no Makefile.local but I made one with that variable and the other 5 about building a client, server, etc. It still didn't compile the client for some reason, just tremded.x86 which I thought was strange...

I looked for the message you put there but found this:
Code: [Select]

Trying SMP acceleration...
^3ERROR: SMP support was disabled at compile time
...failed.


:(
I think it might be because I'm using tjw's client. I might compile a normal client using svn to see if it works.

Thanks, both of you

TinMan

  • Posts: 1019
  • Turrets: +49/-70
    • http://neonpulse.net
Tremulous with Dual Core
« Reply #4 on: April 21, 2007, 08:25:40 pm »
You don't need to use the normal client. :P

Code: [Select]
svn co -r 755 svn://svn.icculus.org/tremulous/trunk Tremulous
cd Tremulous/
wget http://trem.tjw.org/backport/tremulous-svn755.patch
patch -p0 < tremulous-svn755.patch
wget http://neonpulse.net/ubuntu/games/tremulous/smp.patch
patch -p0 < smp.patch
make


https://bugzilla.icculus.org/show_bug.cgi?id=2901

You will need libopenal-dev and subversion I know, other stuff I probably already had installed so didn't know what else you'd need installed.

I'm successfuly using a 64-bit client with SMP and a GUID (TJW patch) right now, so hit me up if you need any help.  :D
Code: [Select]
Linux: ~/.tremulous/base/
Mac: ~/Library/Application\ Support/Tremulous/base/
Windows: C:\Documents and Settings\username\Local Settings\Application Data\Tremulous\base\
NeonPulse
http://neonpulse.net/media/games/tremulous/base/autoexec.cfg

durand

  • Posts: 201
  • Turrets: +0/-0
Tremulous with Dual Core
« Reply #5 on: April 21, 2007, 08:31:36 pm »
oh, thanks! Im compiling now.

next_ghost

  • Posts: 892
  • Turrets: +3/-6
Tremulous with Dual Core
« Reply #6 on: April 21, 2007, 08:32:25 pm »
Get revision 755 from Tremulous SVN or unpack the sources from Tremulous installation pack. Patch them with TJW's backport patch and with Makefile patch from Bugzilla. Then run `make USE_SDL=0 BUILD_CLIENT=1 BUILD_CLIENT_SMP=1`. Then you should get tremulous-smp.
If my answer to your problem doesn't seem helpful, it means I won't help you until you show some effort to fix your problem yourself!
1.2.0 release's been delayed for 5:48:00 already because of stupid questions.

durand

  • Posts: 201
  • Turrets: +0/-0
Tremulous with Dual Core
« Reply #7 on: April 21, 2007, 08:36:39 pm »
Ty, two people saying the same thing. Thats always good :D

durand

  • Posts: 201
  • Turrets: +0/-0
Tremulous with Dual Core
« Reply #8 on: April 21, 2007, 08:43:24 pm »
Hmm, I've compiled it using TinMan's method and ran tremulous-smp.x86 in the trem dir. However, I got this error:
Code: [Select]

Trying SMP acceleration...
WARNING: You enable r_smp at your own risk!
...failed.

in place of what i previously got.

TinMan

  • Posts: 1019
  • Turrets: +49/-70
    • http://neonpulse.net
Tremulous with Dual Core
« Reply #9 on: April 21, 2007, 11:29:44 pm »
Hm...do a "uname -a" and tell me what it says?
Code: [Select]
Linux: ~/.tremulous/base/
Mac: ~/Library/Application\ Support/Tremulous/base/
Windows: C:\Documents and Settings\username\Local Settings\Application Data\Tremulous\base\
NeonPulse
http://neonpulse.net/media/games/tremulous/base/autoexec.cfg

benmachine

  • Posts: 915
  • Turrets: +99/-76
    • ben's machinery
Tremulous with Dual Core
« Reply #10 on: April 22, 2007, 12:56:42 am »
Quote from: "benmachine"
First of all, I've heard symmetric multiprocessing will not work with SDL (or something, can't remember the details) except under Mac OS X. So if you are on a Linux/Windows machine, don't bother.


I'm not totally sure of this, but it's worth looking into. You might be wasting your time.
benmachine

Odin

  • Spam Killer
  • *
  • Posts: 1767
  • Turrets: +113/-204
    • My Website
Tremulous with Dual Core
« Reply #11 on: April 22, 2007, 01:30:28 am »
Make sure you are also running an smp-enabled kernel.

f0rqu3

  • Guest
Tremulous with Dual Core
« Reply #12 on: April 22, 2007, 02:04:24 am »
you cant run trem on 2 cpus

TinMan

  • Posts: 1019
  • Turrets: +49/-70
    • http://neonpulse.net
Tremulous with Dual Core
« Reply #13 on: April 22, 2007, 02:34:10 am »
Actually, yes...you can and I currently am. Nice try but that jedi mind trick doesn't work on me.  :P

Code: [Select]
Linux: ~/.tremulous/base/
Mac: ~/Library/Application\ Support/Tremulous/base/
Windows: C:\Documents and Settings\username\Local Settings\Application Data\Tremulous\base\
NeonPulse
http://neonpulse.net/media/games/tremulous/base/autoexec.cfg

f0rqu3

  • Guest
Tremulous with Dual Core
« Reply #14 on: April 22, 2007, 02:44:09 am »
Quote from: "TinMan"
Actually, yes...you can and I currently am. Nice try but that jedi mind trick doesn't work on me.  :P

what I am saying is it will only use one cpu ...

TinMan

  • Posts: 1019
  • Turrets: +49/-70
    • http://neonpulse.net
Tremulous with Dual Core
« Reply #15 on: April 22, 2007, 03:01:42 am »
It balances the load, but the SMP code does work, try playing withoutout it and then with it and check the balance.
Code: [Select]
Linux: ~/.tremulous/base/
Mac: ~/Library/Application\ Support/Tremulous/base/
Windows: C:\Documents and Settings\username\Local Settings\Application Data\Tremulous\base\
NeonPulse
http://neonpulse.net/media/games/tremulous/base/autoexec.cfg

f0rqu3

  • Guest
Tremulous with Dual Core
« Reply #16 on: April 22, 2007, 03:06:13 am »
Quote from: "TinMan"
It balances the load, but the SMP code does work, try playing withoutout it and then with it and check the balance.

same

Caveman

  • Guest
Tremulous with Dual Core
« Reply #17 on: April 22, 2007, 03:07:44 am »
Tinman, check your pics again, it clearly states that Tremulous is running, nothing more.
The graph is nice but it proves jack.

TinMan

  • Posts: 1019
  • Turrets: +49/-70
    • http://neonpulse.net
Tremulous with Dual Core
« Reply #18 on: April 22, 2007, 06:29:07 am »
Duh, it's not graphing just trem anyways, was just showing that it's two CPUs...
Code: [Select]
Linux: ~/.tremulous/base/
Mac: ~/Library/Application\ Support/Tremulous/base/
Windows: C:\Documents and Settings\username\Local Settings\Application Data\Tremulous\base\
NeonPulse
http://neonpulse.net/media/games/tremulous/base/autoexec.cfg

Stof

  • Posts: 1343
  • Turrets: +1/-1
Tremulous with Dual Core
« Reply #19 on: April 22, 2007, 09:35:34 am »
It shows very clearly that it is NOT using both CPU at the same time :) When one CPU picks up charge, the other goes idle!

I've been doing some work with the SMP support and all I could get was causing the game to crash. My knowledge of OpenGL context switching and multithread support is too limited to get better results. To get to that point, you need to make a few modifications in the source code because a SMP build will still not allow you to active the crasing SMP support on Linux.
urphy's rules of combat
8 ) Teamwork is essential; it gives the enemy someone else to shoot at.
18 ) Make it too tough for the enemy to get in and you can't get out.

next_ghost

  • Posts: 892
  • Turrets: +3/-6
Tremulous with Dual Core
« Reply #20 on: April 22, 2007, 10:00:16 am »
Quote from: "f0rqu3"
what I am saying is it will only use one cpu ...


It'll use one CPU for client gamestate calculations and the other for rendering.

durand, are you sure you have disabled SDL support in compilation?
If my answer to your problem doesn't seem helpful, it means I won't help you until you show some effort to fix your problem yourself!
1.2.0 release's been delayed for 5:48:00 already because of stupid questions.

f0rqu3

  • Guest
Tremulous with Dual Core
« Reply #21 on: April 22, 2007, 12:29:48 pm »
Quote from: "next_ghost"
Quote from: "f0rqu3"
what I am saying is it will only use one cpu ...


It'll use one CPU for client gamestate calculations and the other for rendering.

durand, are you sure you have disabled SDL support in compilation?

client gamestate calculations do not use much cpu . what is the point of using it. and yes sdl disables multi threading. evil sdl

next_ghost

  • Posts: 892
  • Turrets: +3/-6
Tremulous with Dual Core
« Reply #22 on: April 22, 2007, 01:13:55 pm »
Quote from: "f0rqu3"
client gamestate calculations do not use much cpu . what is the point of using it. and yes sdl disables multi threading. evil sdl


You obviously don't read anything tech-related about Quake3 engine or Tremulous. The gamestate calculations include a damn lot of collision detection because client sometimes runs more collision passes than the server (movement prediction, particle system etc.). Then you simply take all you have calculated for current frame, send it to the renderer which runs on the other CPU and start over for the next frame while renderer displays what you have just calculated. In theory, it may give you up to 100% fps boost (assuming that rendering and gamestate calculations take exactly the same time and there's no measurable SMP overhead, which is not true). 30% is more realistic number for most systems.

A few examples of how client gamestate calculations "do not use much cpu" from the last few months:
- cg_bounceParticles (remove particles that touch wall instead of bouncing them from it) - up to 30% fps boost
- cg_optimizePrediction (optimized client-side movement prediction) - up to 20% fps boost
If my answer to your problem doesn't seem helpful, it means I won't help you until you show some effort to fix your problem yourself!
1.2.0 release's been delayed for 5:48:00 already because of stupid questions.

f0rqu3

  • Guest
Tremulous with Dual Core
« Reply #23 on: April 22, 2007, 02:11:00 pm »
yeah collision of small boxes too much computation ...

Quote from: "next_ghost"


A few examples of how client gamestate calculations "do not use much cpu" from the last few months:
- cg_bounceParticles (remove particles that touch wall instead of bouncing them from it) - up to 30% fps boost
- cg_optimizePrediction (optimized client-side movement prediction) - up to 20% fps boost


lol? get  a better system it is just %2 for me ... or maybe if you set max fps to 5

Caveman

  • Guest
Tremulous with Dual Core
« Reply #24 on: April 22, 2007, 02:53:25 pm »
Doesn't do jack here. Urban Legend?

Odin

  • Spam Killer
  • *
  • Posts: 1767
  • Turrets: +113/-204
    • My Website
Tremulous with Dual Core
« Reply #25 on: April 22, 2007, 04:02:15 pm »
Well, try a timedemo with it disabled, then try another with it enabled. If there's an increase in average FPS, then something improved when you did it.

f0rqu3

  • Guest
Tremulous with Dual Core
« Reply #26 on: April 22, 2007, 04:41:15 pm »
Quote from: "Odin"
Well, try a timedemo with it disabled, then try another with it enabled. If there's an increase in average FPS, then something improved when you did it.

:( nothing

durand

  • Posts: 201
  • Turrets: +0/-0
Tremulous with Dual Core
« Reply #27 on: April 22, 2007, 04:52:50 pm »
Quote from: "TinMan"
Hm...do a "uname -a" and tell me what it says?

Code: [Select]
durand@Electrostatic:~$ uname -a
Linux Electrostatic 2.6.20-15-generic #2 SMP Sun Apr 15 07:36:31 UTC 2007 i686 GNU/Linux

OH, forgot to mention, I'm on Ubuntu Feisty.
Quote from: "next_ghost"
durand, are you sure you have disabled SDL support in compilation?


Um, I did exactly what TinMan said. How do I check the SDL status. I'm pretty sure I've installed most SDL dev libraries from previous compiles of other programs. Oh and I also tried your method that you posted at the beginning, I got this error.

Code: [Select]
ient/linux_joystick.o build/release-linux-x86/client/linux_glimp.o build/release-linux-x86/client/sdl_glimp.o -L/usr/X11R6/lib -lX11 -lXext -lXxf86dga -lXxf86vm -lopenal -ldl -lm -m32
/usr/bin/ld: cannot find -lXxf86dga
collect2: ld returned 1 exit status
make[1]: *** [build/release-linux-x86/tremulous.x86] Error 1
make[1]: Leaving directory `/home/durand/Tremulous'
make: *** [build_release] Error 2

Any Ideas?
Thanks all of you, btw.

next_ghost

  • Posts: 892
  • Turrets: +3/-6
Tremulous with Dual Core
« Reply #28 on: April 22, 2007, 06:20:30 pm »
Quote from: "durand"
Um, I did exactly what TinMan said. How do I check the SDL status.


Run Tremulous from terminal, close it and look for "SDL" in the output.

Quote
I'm pretty sure I've installed most SDL dev libraries from previous compiles of other programs. Oh and I also tried your method that you posted at the beginning, I got this error.

Code: [Select]
ient/linux_joystick.o build/release-linux-x86/client/linux_glimp.o build/release-linux-x86/client/sdl_glimp.o -L/usr/X11R6/lib -lX11 -lXext -lXxf86dga -lXxf86vm -lopenal -ldl -lm -m32
/usr/bin/ld: cannot find -lXxf86dga
collect2: ld returned 1 exit status
make[1]: *** [build/release-linux-x86/tremulous.x86] Error 1
make[1]: Leaving directory `/home/durand/Tremulous'
make: *** [build_release] Error 2

Any Ideas?
Thanks all of you, btw.


Yes, you have disabled SDL this time but you need x11-libs/libXxf86dga (or whatever it's called in apt).

Quote from: "f0rqu3"
yeah collision of small boxes too much computation ...


Quake can handle about 100 collision traces per frame easily. But if a bunch of humans start lucispamming in a really big room with lots of geometry, you can easily get over 10 000 traces per frame for particles alone. And THAT is a big problem. It's no wonder you get no fps boost on empty server.
If my answer to your problem doesn't seem helpful, it means I won't help you until you show some effort to fix your problem yourself!
1.2.0 release's been delayed for 5:48:00 already because of stupid questions.

durand

  • Posts: 201
  • Turrets: +0/-0
Tremulous with Dual Core
« Reply #29 on: April 22, 2007, 06:29:01 pm »
Quote from: "next_ghost"
Quote from: "durand"
Um, I did exactly what TinMan said. How do I check the SDL status.


Run Tremulous from terminal, close it and look for "SDL" in the output.

Quote
I'm pretty sure I've installed most SDL dev libraries from previous compiles of other programs. Oh and I also tried your method that you posted at the beginning, I got this error.

Code: [Select]
ient/linux_joystick.o build/release-linux-x86/client/linux_glimp.o build/release-linux-x86/client/sdl_glimp.o -L/usr/X11R6/lib -lX11 -lXext -lXxf86dga -lXxf86vm -lopenal -ldl -lm -m32
/usr/bin/ld: cannot find -lXxf86dga
collect2: ld returned 1 exit status
make[1]: *** [build/release-linux-x86/tremulous.x86] Error 1
make[1]: Leaving directory `/home/durand/Tremulous'
make: *** [build_release] Error 2

Any Ideas?
Thanks all of you, btw.


Yes, you have disabled SDL this time but you need x11-libs/libXxf86dga (or whatever it's called in apt).


So, I've installed the libXxf86dga-dev package, and recompiled it. That command u gave me earlier (USE_SDL=0) shouldnt that be 1 instead to enable sdl?