Tremulous Forum

General => Troubleshooting => Topic started by: durand on April 21, 2007, 11:40:01 am

Title: Tremulous with Dual Core
Post by: durand 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!
Title: Re: Tremulous with Dual Core
Post by: Xonya 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.
Title: Tremulous with Dual Core
Post by: benmachine 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.
Title: Tremulous with Dual Core
Post by: durand 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
Title: Tremulous with Dual Core
Post by: TinMan 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
Title: Tremulous with Dual Core
Post by: durand on April 21, 2007, 08:31:36 pm
oh, thanks! Im compiling now.
Title: Tremulous with Dual Core
Post by: next_ghost 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 (https://bugzilla.icculus.org/attachment.cgi?id=1127). Then run `make USE_SDL=0 BUILD_CLIENT=1 BUILD_CLIENT_SMP=1`. Then you should get tremulous-smp.
Title: Tremulous with Dual Core
Post by: durand on April 21, 2007, 08:36:39 pm
Ty, two people saying the same thing. Thats always good :D
Title: Tremulous with Dual Core
Post by: durand 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.
Title: Tremulous with Dual Core
Post by: TinMan on April 21, 2007, 11:29:44 pm
Hm...do a "uname -a" and tell me what it says?
Title: Tremulous with Dual Core
Post by: benmachine 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.
Title: Tremulous with Dual Core
Post by: Odin on April 22, 2007, 01:30:28 am
Make sure you are also running an smp-enabled kernel.
Title: Tremulous with Dual Core
Post by: f0rqu3 on April 22, 2007, 02:04:24 am
you cant run trem on 2 cpus
Title: Tremulous with Dual Core
Post by: TinMan 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

(http://i17.tinypic.com/2ln7hu9.png)
Title: Tremulous with Dual Core
Post by: f0rqu3 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 ...
Title: Tremulous with Dual Core
Post by: TinMan 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.
Title: Tremulous with Dual Core
Post by: f0rqu3 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
Title: Tremulous with Dual Core
Post by: Caveman 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.
Title: Tremulous with Dual Core
Post by: TinMan on April 22, 2007, 06:29:07 am
Duh, it's not graphing just trem anyways, was just showing that it's two CPUs...
Title: Tremulous with Dual Core
Post by: Stof 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.
Title: Tremulous with Dual Core
Post by: next_ghost 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?
Title: Tremulous with Dual Core
Post by: f0rqu3 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
Title: Tremulous with Dual Core
Post by: next_ghost 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
Title: Tremulous with Dual Core
Post by: f0rqu3 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
Title: Tremulous with Dual Core
Post by: Caveman on April 22, 2007, 02:53:25 pm
Doesn't do jack here. Urban Legend?
Title: Tremulous with Dual Core
Post by: Odin 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.
Title: Tremulous with Dual Core
Post by: f0rqu3 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
Title: Tremulous with Dual Core
Post by: durand 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.
Title: Tremulous with Dual Core
Post by: next_ghost 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.
Title: Tremulous with Dual Core
Post by: durand 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?
Title: Tremulous with Dual Core
Post by: next_ghost on April 22, 2007, 06:30:54 pm
Quote from: "durand"
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?


SDL is enabled by default and blocks r_smp. You want to turn it off.
Title: Tremulous with Dual Core
Post by: durand on April 22, 2007, 06:34:34 pm
Quote from: "next_ghost"
Quote from: "durand"
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?


SDL is enabled by default and blocks r_smp. You want to turn it off.


Oh.
Title: Tremulous with Dual Core
Post by: durand on April 22, 2007, 06:58:22 pm
Is there any chance that one of you who has SMP working can send me your tremulous-smp.x86 binary so I can use that instead of compiling? Thanks!
Title: Tremulous with Dual Core
Post by: next_ghost on April 22, 2007, 07:17:23 pm
It won't work without that library and when you install it, you can as well just compile the client yourself.
Title: Tremulous with Dual Core
Post by: durand on April 22, 2007, 07:26:43 pm
Huh, I don't get it. When I compile it, I just copy over the tremulous-smp.x86 binary from the build folder so I don't think the library makes any difference as long as you have it installed on your computer and me on my computer.
Title: Tremulous with Dual Core
Post by: next_ghost on April 22, 2007, 07:40:26 pm
Why don't you compile it then? You're far enough to do it by a single command.
Title: Tremulous with Dual Core
Post by: durand on April 22, 2007, 07:44:42 pm
Havent you been reading the previous posts, I've been getting an error when I compile it.
Title: Tremulous with Dual Core
Post by: next_ghost on April 22, 2007, 07:48:30 pm
Quote from: "durand"
Havent you been reading the previous posts, I've been getting an error when I compile it.


Yes I have. The error means you do NOT have the library installed so binary from anybody else won't work until you install it. And when you do that, there'll be nothing keeping you from compiling it yourself.
Title: Tremulous with Dual Core
Post by: durand on April 22, 2007, 07:52:39 pm
yes but the error isn't because I haven't installed the library because now that I have, i still get the same error and SMP still doesn't work.
Title: Tremulous with Dual Core
Post by: next_ghost on April 22, 2007, 07:57:16 pm
Ok, run this command then and post here the output:
Code: [Select]
find /usr/lib/ -name libXxf86dga*.so*
Title: Tremulous with Dual Core
Post by: durand on April 22, 2007, 08:00:46 pm
Code: [Select]
durand@Electrostatic:~/Tremulous$ find /usr/lib/ -name libXxf86dga*.so*
/usr/lib/libXxf86dga.so.1.0.0
/usr/lib/libXxf86dga.so.1
/usr/lib/libXxf86dga.so
Title: Tremulous with Dual Core
Post by: next_ghost on April 22, 2007, 08:08:18 pm
Is it really
Code: [Select]
/usr/bin/ld: cannot find -lXxf86dga
Or is it something else this time?
Title: Tremulous with Dual Core
Post by: durand on April 22, 2007, 08:13:04 pm
Code: [Select]
-lopenal -ldl -lm -m32
/usr/bin/ld: cannot find -lXxf86vm
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


Oh, just realised, its vm now. Ill install that library and try again.
Title: Tremulous with Dual Core
Post by: durand on April 22, 2007, 08:28:08 pm
Nevermind what I said, I've installed libxxf86vm-dev which added a few other dependencies and recompiled it with:
Code: [Select]
make USE_SDL=0 BUILD_CLIENT=1 BUILD_CLIENT_SMP=1 and moved tremulous-smp.x86 to the tremulous directory and ran it and it finally worked!
Annoyingly enough though, sound has stopped working, maybe because of disabling sdl, Im not sure. Thanks next_ghost and everyone else for the SMP thing.
Title: Tremulous with Dual Core
Post by: rdizzle on April 23, 2007, 03:49:45 am
for us not so leet code gurus, who play on dual core macs, can you please upload a binary for us???

pretty please?
Title: Tremulous with Dual Core
Post by: durand on April 23, 2007, 05:13:36 pm
Well, apparently I don't think you can upload a binary because the binary is compiled just for your own system, for PCs anyway. I'm probably wrong here since Macs are usually quite similar to each other. It's not that hard to compile it yourself anyway.

You can try dual core if you want but the performance is pretty bad. It is faster, however, you get no sound which is really annoying to me. At the moment, there is no way to fix this but maybe later :D

Oh and http://tremulous.net/phpBB2/viewtopic.php?t=3442&highlight=timedemo has a timedemo with stats. If u scroll down about 26 posts to next_ghost's there is a comparison of SMP and non SMP

Quote from: "next_ghost"
Intel Core 1 Duo T2300 @ 1.66GHz
1GB RAM
ATi Mobility Radeon x1600
Gentoo Linux, kernel 2.6.19-gentoo-r4
X.org X11R7 v1.1.1-r4, ati-drivers-8.32.5

Video settings: 1280x800, highest in-game, no AA

SMP enabled (no SDL): 3067 frames, 56.8 seconds: 54.0 fps
SMP disabled (SDL): 3067 frames, 71.7 seconds: 42.7 fps

Note: SMP run might have some minor performance boost because Tremulous could not mmap /dev/dsp.


PS: If you play without sound, I would recommend that you try SMP. I've also compiled the tremulous-smp binary if anyone wants it though I'm not sure how well it will work, works for me tho. http://www.durand.zephyrhosting.net/dump/tremulous-smp.x86
Title: Tremulous with Dual Core
Post by: benmachine on April 23, 2007, 09:05:32 pm
Quote from: "rdizzle"
for us not so leet code gurus, who play on dual core macs, can you please upload a binary for us???

pretty please?

I've heard tjw's binaries come with SMP support, and I know mine do. So any popular Mac binary probably already has smp support.
Title: Tremulous with Dual Core
Post by: TinMan on April 23, 2007, 10:06:34 pm
http://neonpulse.net/linux/games/tremulous/release-linux-x86_64.tar.gz
Here's the build that I ended up with, 64-bit, SMP, and GUID.
 :wink:
Title: Tremulous with Dual Core
Post by: durand on April 24, 2007, 04:45:42 pm
isn't GUID compiled by default?
Title: Tremulous with Dual Core
Post by: TinMan on April 24, 2007, 09:50:13 pm
The GUID system is in TJW's patch for svn 755. If you install tremulous using the standard linux installer script on the files page then you will not have a GUID, many repositories for different linux distros also do not have a GUID binary. TJW didn't have a 64-bit one so I asked him what I needed to do to make one (posted as code earlier in this thread), and then I did it.