Multi Core and Multi Threading : How work this stuff ?

Tips on how to tweak Nexuiz for the best performance

Moderators: Nexuiz Moderators, Moderators


  • I started about this in this topic
    http://forums.alientrap.local/viewtopic.php?t=5483

    I quote the posts here:

    giuseppe wrote:I know few things about hardware but i can remember you these few things...

    Nexuiz dont support multicore CPU. So if u have for ex a p4 3.0Ghz, change that with a dual core 1.5Ghzx2 is the same to have a single core 1.5Ghz (bad for nexuiz if u want good graphic).
    I know help a lot performance have more RAM and maybe change graphic card with a lot of ram dedicated.


    tZork wrote:Not true, a single core system have to run everything including nexuiz on that core. a multi core setup has more cores to spread the system load (such as the gpu driver load, which can be substantial, etc) on. thus multi core can well be better (and are in fact recommended for any current generation gpu too) then a mono core for Nexuiz. That said i dont know of any gaming capable mono core cpus sold today :P


    giuseppe wrote:Nexuiz dont support multicore: not true?
    my example about running Nexuiz on dual 1.5Ghz instead a single core 3.0Ghz: not true?

    Well my experience is that. I have now a dual 1.6Ghz instead my previous p4 3.2Ghz and nexuiz run with half or less frame rate and now if i want have a decent frame rate i have to set graphics to low value. But i can render with Blender 5% faster now for ex. Is true!
    I have compared a single core and the 'equivalent' dual. I not said all dual core are bad for Nexuiz :)


    tZork wrote:Depends on what the current bottleneck of you system is giuseppe, however since nexuiz is not the only thing running on the system the other core/s of a multi core system is not idle. And thus more cores can still help performance even if nexuiz itself just uses the one thread. So no, 2x 1.5 ghz is not the same for nexuiz as 1x 1.5.

    Oh, and comparing Mhz to Mhz across different cpu architectures is pointless these days ;)

    if your new 1.6 ghz (c2d i assume) is running nexuiz at half fps compared to a (p4?) of 3.2 ghz at otherwise comparable hardware, theres proly something wrong with your puter (and +5% blender render speed sounds to little too). The c2d (and just abt every other modern performance directed cpu architecture) get much more done per mhz then the p4 arc does.


    giuseppe wrote:from here

    http://en.wikipedia.org/wiki/Dual-core

    The amount of performance gained by the use of a multi-core processor is strongly dependent on the software algorithms and implementation.
    ...
    In addition to operating system (OS) support, adjustments to existing software are required to maximize utilization of the computing resources provided by multi-core processors. Also, the ability of multi-core processors to increase application performance depends on the use of multiple threads within applications.
    ...
    Two processing cores sharing the same system bus and memory bandwidth limits the real-world performance advantage.


    So multi core tecnology is much better single core but needs appropriate 'software algorithms and implementation' that use 'multiple threads' and needs appropriate hw components.
    __________

    And from here
    http://compreviews.about.com/od/cpus/a/dualcore.htm

    Most of the early dual-core processors are going to be running at lower clock speeds compared to single core processors. The rational behind it is that a dual-core processor with each running at 1GHz should be equivalent to a single processor running at 2GBz. The problem is that this doesn't work in practice when the applications are not written to take advantage of the multiple processors. Until the software is written this way, unthreaded applications will run faster on a single processor than a dual-core CPU.


    So a dual core 2.50-3.00 Ghz x 2 is good for nexuiz but my 1.50 Ghz x 2 i dont think (sure with a good graphic card with a lot of ram yes). The fact is Nexuiz cant take the great advantage of multi thread. And is a pity.
    _________

    Sorry k0jak im OT


    [edit: i correct my info]
    -my old CPU was a pentium HT 3.20Ghz, my new is a pentium dual 1.60 Ghz x2
    -now i can have with blender render 50% faster (just controlled my old renders)


    tZork wrote:Hmm you either miss my point or ignore it ;) anyways, lets stop threadjacking.


    giuseppe wrote:simply maybe i cant understand :)
    i start a new topic to continue

    __________


    I want learn more about multi core tecnology and sw that support or not the multi threading.
    Ty
    User avatar
    giuseppe
    Alien
     
    Posts: 128
    Joined: Fri Mar 16, 2007 6:47 pm
    Location: italy

Sat Oct 03, 2009 3:17 pm

  • Well nexuiz itself does not benefit from multi core since its single threaded. But on a computers theres always a pile of other things running (each in its own process and thread/s). In the the mono core scenario, all of these are running on the same cpu, obviously. So if, lets say your AV scanner, suddenly needs a big chunk of cpu time to do something and your playing nexuiz, nexuiz will get starved for cpu time. In a multi core setup the system can shuffle threads around to the to the least bzy cpu and keep everything running smoother. Also things like the gpu driver may use more then one core even if the game itself is single thread. So what the article fails to mention is that every modern system is made up of many processes, and because of this multi cores does help even single threaded applications by making more cpu time available. The gain is of course never higher then the full speed of one of these cores/cpus in the single threaded applications case.

    If you had a case where you have one 3ghz mono core and one 1.5 ghz dual core _off precisely the same architecture_, the single core one would doubtlessly give you more nexuiz performance. but that scenario is unlikely to ever happen :P

    Also in the case of nexuiz, its more gpu then cpu bound (unless your running a server or a local game).
    HOF:
    <Diablo> the nex is a "game modification"
    <Diablo> quake1 never had a weapon like that.
    <Vordreller> there was no need for anything over 4GB untill Vista came along
    <Samua>]Idea: Fix it? :D
    <Samua>Lies, that only applies to other people.
    User avatar
    tZork
    tZite Admin
     
    Posts: 1337
    Joined: Tue Feb 28, 2006 6:16 pm
    Location: Halfway to somwhere else

Sat Oct 03, 2009 3:46 pm

Sat Oct 03, 2009 4:24 pm

  • tZork wrote:If you had a case where you have one 3ghz mono core and one 1.5 ghz dual core _off precisely the same architecture_, the single core one would doubtlessly give you more nexuiz performance.

    Is my case! :(
    ___________

    @vomit
    wait! but you compare a single core at 3.60Ghz with a dual core at 3.33Ghz (x2)? Its clear the second is the best anyway!

    instead this is similar to my case
    http://www.anandtech.com/bench/default.aspx?p=92&p2=69
    (single core have +1Mb cache)

    Intel Pentium 4 660 - 3.6GHz - 2MB L2
    vs. Intel Pentium Dual Core E2160 - 1.80GHz - 1MB L2

    Cinebench R10 - Single Threaded Benchmark
    Score in CBMarks - Higher is Better
    2245 - 1968
    single core win (only +277 but win)
    User avatar
    giuseppe
    Alien
     
    Posts: 128
    Joined: Fri Mar 16, 2007 6:47 pm
    Location: italy

Sat Oct 03, 2009 4:54 pm

  • The e2160 is about 2 years old and was a " low end cpu"
    And its almost as fast with a single threaded app as a "High end" P4 with twice the clock speed!


    Well I bet if you under-clocked a shiny new dual core to half the clock frequency of that of your p4 it would still be faster (Even on single threaded apps!) than your p4 and consume half the power and run much much cooler.
    User avatar
    Silica Gel: Do Not Eat
    Alien trapper
     
    Posts: 453
    Joined: Fri Jun 29, 2007 1:18 pm
    Location: Desiccantopia

Sat Oct 03, 2009 5:03 pm

Sat Oct 03, 2009 5:31 pm

  • giuseppe wrote:
    tZork wrote:If you had a case where you have one 3ghz mono core and one 1.5 ghz dual core _off precisely the same architecture_, the single core one would doubtlessly give you more nexuiz performance.

    Is my case! :(


    This actually is not your case. You are comparing only by clock speed, and you can only do that when the two CPUs are of the same architecture (P4 vs P4 or Core 2 Duo vs Core 2 Duo).

    When moving from P4 to Core 2 Duo, there is much more than just clock speed, but rather efficiency as well. The Core 2 Duo will blow the pants off of any P4 line period.

    Also, as far as mutli-threading, DP (the game engine itself) doesn't benefit directly from multicore, in the fact that it doesn't offload physics or sound or anything like that, but your graphics card drivers will still benefit from it as they can run on a seperate core/thread themselves.
    --Willis
    User avatar
    Willis
    Site Admin
     
    Posts: 168
    Joined: Tue Feb 28, 2006 7:00 pm
    Location: Wisconsin, USA


  • giuseppe wrote:Nexuiz dont support multicore: not true?
    my example about running Nexuiz on dual 1.5Ghz instead a single core 3.0Ghz: not true?

    Well my experience is that. I have now a dual 1.6Ghz instead my previous p4 3.2Ghz and nexuiz run with half or less frame rate and now if i want have a decent frame rate i have to set graphics to low value. But i can render with Blender 5% faster now for ex. Is true!
    I have compared a single core and the 'equivalent' dual. I not said all dual core are bad for Nexuiz :)


    I went from a P4 3.2 to an E2200 (2.2 X 2) and had noticed a modest improvemnt in nexuiz.
    Sounds like your experience was not related to CPU itself. What OS did you use?

    If i take a modern 3ghz dual core cpu and disable one core, it will still be faster and more efficient than a 3ghz P4.

    Anyways gigahertz is a silly thing to compare CPUs by. :P
    User avatar
    Silica Gel: Do Not Eat
    Alien trapper
     
    Posts: 453
    Joined: Fri Jun 29, 2007 1:18 pm
    Location: Desiccantopia

Sat Oct 03, 2009 7:46 pm

  • Ed wrote:If we're talking about Nexuiz performance...

    Not only. My request was:
    giuseppe wrote:I want learn more about multi core tecnology and sw that support or not the multi threading.
    Ty

    So the topic is not dedicated to Nexuiz performance!

    My topic take origin by this:
    k0jak wrote:Ok my pc is shocking, and every new version makes nexuiz harder for me to play, and I want to be able to play at a good level again.


    but now this topic in my intention is general about how multy thread tecnology works.
    Ty
    _________

    @vomit
    this is my pc ( i know is old :( )
    mainboard : Asus P5S-MX SE
    CPU : Intel Pentium dual cpu E2140 1.60 Ghz
    cache L1 : 64 Kb
    cache L2 : 1 Mb
    RAM : 2x512 Mb SDRAM
    VGA : Ati Radeon X600/X550 series - 256 MB ram
    HD : Maxtor 6L200M0 180 Gb
    OS : Windows xp sp2
    __________

    After tZork and Willis posts i understand that...
    about OS threads: 2 threads can be executed really at same time by a dual core; in a sinlge core this is not possible maybe is simulated in someway;
    than in dual core im oriented to think the work can be done in half time (single core speed = speed one of cores in a dual);
    Willis say there is more to consider than the only speed of cpu in multi core and so the performance can rise;
    about the work of graphic cards the drivers can take benefit form multi core cpu, so a graphic application that doesnt support multi threading can take benefit indirectly by that;

    but im confused a bit...
    a heavy graphic application that doesnt support multi threading run on a core and im oriented to think that core is very busy;
    so how OS threads can be executed? on the other core? on both the cores? How much the graphic card must be good to help in this case?
    User avatar
    giuseppe
    Alien
     
    Posts: 128
    Joined: Fri Mar 16, 2007 6:47 pm
    Location: italy

Sat Oct 03, 2009 8:43 pm

  • I already had a core2duo CPU quite early and in the first days I had to assign Nexuiz to one of the two cores manually via task manager to get reasonable performance. This wasn't changed by a new Nexuiz release but some Windows or driver update, I don't remember exactly.

    I'm not too much into CPU technologies or something, but I guess it's the OS and/or the chipset (drivers) that are able to handle the threads of even one process (application) on two or more cores.
    uncomfortable
    random
    mean
    embarrassing
    limited
    User avatar
    Urmel
    Forum addon
     
    Posts: 1744
    Joined: Fri Mar 03, 2006 10:06 am
    Location: Offline

Sat Oct 03, 2009 9:24 pm

  • With Windows XP if you upgrade from a single core to a dual core you may need to reinstall the OS to see both cores.
    When you do CTRL ALT Delete and Choose Performance do you see two graphs for CPU usage (one for each core?)
    User avatar
    Silica Gel: Do Not Eat
    Alien trapper
     
    Posts: 453
    Joined: Fri Jun 29, 2007 1:18 pm
    Location: Desiccantopia

Sun Oct 04, 2009 3:09 am

  • Nexuiz should use openmp to speed up on multi-core processors
    some-guy
    Member
     
    Posts: 25
    Joined: Tue May 12, 2009 1:28 am

Sun Oct 04, 2009 9:21 am

  • vomit wrote:With Windows XP if you upgrade from a single core to a dual core you may need to reinstall the OS to see both cores.
    When you do CTRL ALT Delete and Choose Performance do you see two graphs for CPU usage (one for each core?)

    For anyone working in a large organisation who has a dual/quad core CPU, try this. It's amazing the number of companies whose IT departments somehow justify buying more cores and then stick the same uniprocessor kernel on every system.
    Ed
    Forum addon
     
    Posts: 1172
    Joined: Wed Mar 01, 2006 12:32 am
    Location: UK

Sun Oct 04, 2009 12:08 pm

  • Urmel wrote:I already had a core2duo CPU quite early and in the first days I had to assign Nexuiz to one of the two cores manually via task manager to get reasonable performance.

    Thanks for the tips! I learn now this OS feature. I will try. But i have to do this all the time i run the thread? Or OS can remember.

    Ed wrote:
    vomit wrote:With Windows XP if you upgrade from a single core to a dual core you may need to reinstall the OS to see both cores.
    When you do CTRL ALT Delete and Choose Performance do you see two graphs for CPU usage (one for each core?)

    For anyone working in a large organisation who has a dual/quad core CPU, try this. It's amazing the number of companies whose IT departments somehow justify buying more cores and then stick the same uniprocessor kernel on every system.

    Yeah vomit i can see both cores and with firefox 3, norton internet security and task manager (and few autorun proces) running I see CPU are busy for 2-5 % and reading the two graphs seem the first core make almost all the work. This mean not all the sw running is really optimized to work on multi core? Reading Ed post the answer is yes?

    some-guy wrote:Nexuiz should use openmp to speed up on multi-core processors

    what's openmp?

    Ty all.
    User avatar
    giuseppe
    Alien
     
    Posts: 128
    Joined: Fri Mar 16, 2007 6:47 pm
    Location: italy

Sun Oct 04, 2009 4:43 pm

Mon Oct 05, 2009 3:03 am

  • giuseppe wrote:
    some-guy wrote:Nexuiz should use openmp to speed up on multi-core processors

    what's openmp?

    http://openmp.org/wp/about-openmp/

    Will *easily* allow darkplaces to start multi-proccessing
    some-guy
    Member
     
    Posts: 25
    Joined: Tue May 12, 2009 1:28 am

Mon Oct 05, 2009 4:39 pm

  • It must be assured however that a mp support wouldn't result in a disadvantage for all the single core users which I think is still the majority of the players.

    IMO Nexuiz runs fast enough on dual core rigs without this feature. Who needs more than 200fps on ultra settings?
    uncomfortable
    random
    mean
    embarrassing
    limited
    User avatar
    Urmel
    Forum addon
     
    Posts: 1744
    Joined: Fri Mar 03, 2006 10:06 am
    Location: Offline

Mon Oct 05, 2009 8:59 pm

  • Urmel wrote:It must be assured however that a mp support wouldn't result in a disadvantage for all the single core users which I think is still the majority of the players.

    Almost all Linux distros build for SMP (typically 8 cores) and it isn't often you see people complaining about that. You could however make it a compile time option to disable SMP, just like the kernel does.
    Ed
    Forum addon
     
    Posts: 1172
    Joined: Wed Mar 01, 2006 12:32 am
    Location: UK

Mon Oct 05, 2009 10:58 pm

  • Urmel wrote:It must be assured however that a mp support wouldn't result in a disadvantage for all the single core users which I think is still the majority of the players.

    IMO Nexuiz runs fast enough on dual core rigs without this feature. Who needs more than 200fps on ultra settings?

    Well I have a quad core at 3GHz, and can't use Ultimate (gefore 9800gt), and I want more fps :shock:
    some-guy
    Member
     
    Posts: 25
    Joined: Tue May 12, 2009 1:28 am

Tue Oct 06, 2009 7:21 am

  • Urmel wrote:It must be assured however that a mp support wouldn't result in a disadvantage for all the single core users which I think is still the majority of the players.


    I always thought that single core CPUs were phasing out, hell the last I checked most people had Core 2 Duos and half of everybody building a PC right now goes with a Phenom II or (if they have tons of money) the Core I7.
    I have left this website with the rest of the GPL Nexuiz community. You can find us at Xonotic.org
    User avatar
    Lee_Stricklin
    Alien trapper
     
    Posts: 404
    Joined: Sat Jun 21, 2008 8:42 pm
    Location: Midwest

Tue Oct 06, 2009 7:23 pm

Sun Nov 29, 2009 4:02 am

  • Silica Gel: Do Not Eat wrote:A modern dual core cpu is faster than an old p4 single core cpu even with one core tied behind its back.

    People seem to be forgetting the Gigahertz Myth: http://en.wikipedia.org/wiki/Megahertz_myth
    For instance, the ARM Cortex A8 at around 500MHz is faster than an ARM11 running at 1.0GHz. Clock speed means nothing unless you are comparing two identical chips with the only difference being the clock.Pentium 4 went all the way up to 3.6GHz, and then the (much faster) Intel Core line hit the market at 1.8GHz. What happened there? Oh, right. Intel woke up and designed more efficient chips rather than chips that could sustain higher clocks.

    My real problem with Nexuiz performance is, my video card has way more oomph than this game requires, but eventually CPU becomes a bottleneck and my frame rate suffers as a result.

    @Devs: Easy test case for your profiler:
    Step 1
    Set EKG, turn gib life to 100x normal.
    Step 2
    Let 10 bots loose and watch the CPU usage. Eventually, the gibs sitting on the floor use up enough CPU time that it squeezes render time out, killing performance.

    This happens everywhere, whether you're sitting in a sea of gibs or hiding in a corner of the map looking into the sky.
    Picture: Nexuiz, with HTOP in Konsole above it, showing the CPU usage of each core, as well as memory.
    Image

    At the very minimum rendering should go on another thread. I would consider this is a critical performance limitation of the Nexuiz darkplaces engine and try to prioritize some development in this area.
    If you consider the performance benefits for the dual and quad core users... easy decision, especially considering that you would actually have to go out of your way to find a single-core system nowadays.
    kazetsukai
    Newbie
     
    Posts: 1
    Joined: Sun Nov 29, 2009 3:34 am



Return to Nexuiz - Performance Tips




Information
  • Who is online
  • Users browsing this forum: No registered users and 0 guests