Spring is running in SMP - Page 19

Spring is running in SMP

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: Spring is running in SMP

Post by imbaczek »

well, those assumptions are what they are, if you want lupsmanager on GML, it'll be easier to change the widget than the engine. just saying.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Spring is running in SMP

Post by Beherith »

So the gl calls only need to be moved to non synced code for this to work?

nice :)

Code: Select all

  for i=1,#allPlayers do
    local playerName = Spring.GetPlayerInfo(allPlayers[i])
    if (playerName == "[LCC]jK") then
      local errorLog = Lups.GetErrorLog(1)
      if (errorLog~="") then
        local cmds = {
          "say ------------------------------------------------------",
          "say LUPS: jK is here! Sending error log (so he can fix your problems):",
        }
        --// the str length is limited with "say ...", so we split it
        for line in errorLog:gmatch("[^\r\n]+") do
          cmds[#cmds+1] = "say " .. line
        end
        cmds[#cmds+1] = "say ------------------------------------------------------"
        Spring.SendCommands(cmds)
      end
      break
    end
  end
zerver
Spring Developer
Posts: 1358
Joined: 16 Dec 2006, 20:59

Re: Spring is running in SMP

Post by zerver »

Yep, simple as that. No OpenGL in Sim plz.

That said, this problem with incompatible widgets is indeed fixable, but
* it would mean added complexity
* it might have negative effect on performance
* there is no "portable" way of doing it --> separate coding for linux/windows

So, as I see it, it is much better to fix the widgets than the engine. Relatively few widgets have a problem.
User avatar
ginekolog
Posts: 837
Joined: 27 Feb 2006, 13:49

Re: Spring is running in SMP

Post by ginekolog »

Beherith wrote:This smp build is made of pure and epic win!
The frame rate is no longer tied to the cpu for me, and I can move up to 3000 core vamps around on dsd while still maintaining 20 fps if they are all in full view. Also, if they are not in view, my fps pop back up to 80! This is with quite high gfx settings.

Oh rite, and turning off threaded optimization gave me another 50% boost. So turning that off is essential.
+1

I also tripled FPS with this multicore build.. from 7 to 21 with 1500 corvamp. Keep on good work :)

EDIT: how is triple gain even possible? From what i understand max theoretical gain should 2 times faster execution, not 3 times ?
User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Re: Spring is running in SMP

Post by very_bad_soldier »

ginekolog wrote: EDIT: how is triple gain even possible? From what i understand max theoretical gain should 2 times faster execution, not 3 times ?
Really only by replacing your EXE? LUPS still enabled? I should give it a try TODAY if so...
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Spring is running in SMP

Post by CarRepairer »

ginekolog wrote:
Beherith wrote:This smp build is made of pure and epic win!
The frame rate is no longer tied to the cpu for me, and I can move up to 3000 core vamps around on dsd while still maintaining 20 fps if they are all in full view. Also, if they are not in view, my fps pop back up to 80! This is with quite high gfx settings.

Oh rite, and turning off threaded optimization gave me another 50% boost. So turning that off is essential.
+1

I also tripled FPS with this multicore build.. from 7 to 21 with 1500 corvamp. Keep on good work :)

EDIT: how is triple gain even possible? From what i understand max theoretical gain should 2 times faster execution, not 3 times ?
Maybe you have three cores and you don't know it.
Auswaschbar
Spring Developer
Posts: 1254
Joined: 24 Jun 2007, 08:34

Re: Spring is running in SMP

Post by Auswaschbar »

ginekolog wrote:
Beherith wrote:This smp build is made of pure and epic win!
The frame rate is no longer tied to the cpu for me, and I can move up to 3000 core vamps around on dsd while still maintaining 20 fps if they are all in full view. Also, if they are not in view, my fps pop back up to 80! This is with quite high gfx settings.

Oh rite, and turning off threaded optimization gave me another 50% boost. So turning that off is essential.
+1

I also tripled FPS with this multicore build.. from 7 to 21 with 1500 corvamp. Keep on good work :)

EDIT: how is triple gain even possible? From what i understand max theoretical gain should 2 times faster execution, not 3 times ?
Maybe you disabled LUPS, which alone causes my fps to rise by a factor of 2 with 1500 corvamps.
User avatar
ginekolog
Posts: 837
Joined: 27 Feb 2006, 13:49

Re: Spring is running in SMP

Post by ginekolog »

Lups is disabled on both cases as behe suggested in this post:

http://springrts.com/phpbb/viewtopic.php?f=1&t=19338


I enabled lups now on MT with 1500 corvamp, but FPS droped to 12 (10-15) and speed reduced to 0.71. For now i wont use lups and will try to see what happens in real big games.

I still dont understaned why i get 3 times more fps 8) .. its same widgets as i have 2 exes (MT and ST) in same folder.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: Spring is running in SMP

Post by Kloot »

ginekolog wrote: EDIT: how is triple gain even possible? From what i understand max theoretical gain should 2 times faster execution, not 3 times ?
The theoretical maximum is equal to the highest framerate that the CPU core on which the rendering thread executes can produce (together with your GPU) given the scene. Since Spring is mostly CPU-limited, most of the CPU time is actually taken up by the simulation part in the ST builds when there are hundreds of units in play. That's why the jump is so large.
User avatar
ginekolog
Posts: 837
Joined: 27 Feb 2006, 13:49

Re: Spring is running in SMP

Post by ginekolog »

That makes sense. If simulation took 50% of single core before and rendering was left with 50% i got 7FPS. But now sim still takes 50% on single core but i get 50% + 2 x 50% because of dual core? ROX :)

I am not tocuhing ST version again if this works rockstable :lol:
User avatar
Das Bruce
Posts: 3544
Joined: 23 Nov 2005, 06:16

Re: Spring is running in SMP

Post by Das Bruce »

ginekolog wrote:I am not tocuhing ST version again if this works rockstable :lol:
Unfortunately not all mods/games are compatible yet.
reivanen
Posts: 180
Joined: 12 Feb 2008, 15:52

Re: Spring is running in SMP

Post by reivanen »

Das Bruce wrote:
ginekolog wrote:I am not tocuhing ST version again if this works rockstable :lol:
Unfortunately not all mods/games are compatible yet.
i say dump incompatible mods/games as the work to make em compatible is heaps easier the write the enginen to support olde bahaviour.

MT spring is sothng we have waitedsnethe era of HT/dulcore cpu:s and should be migrated to as soon as possible. This does not break backwards compatibility, it only needs a few coders looking thru lua code and make it non-gml calling.

Multithred/core has been here for ages, theres no reason to maintain pre atholn x2:s for sacrificing this much performance boost. MAKE SPRING MULTiTHREADED BY DEFAULT
User avatar
Das Bruce
Posts: 3544
Joined: 23 Nov 2005, 06:16

Re: Spring is running in SMP

Post by Das Bruce »

I wasn't making any suggestion to the contrary. It was just an observation.
User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Re: Spring is running in SMP

Post by very_bad_soldier »

I tried two games with MT. One worked flawlessly, the other one freezed after 5min ingame (no infolog sorry).

But I can freeze the MT-build reproducable by starting spring.exe, Commander-Script, Map Tropical (probably any other will "work" too). Then "/cheat" and "/give all". While spawning the stuff, spring completely locks up for me. Tested on two different machines (XP SP3 and Vista SP1).
User avatar
ginekolog
Posts: 837
Joined: 27 Feb 2006, 13:49

Re: Spring is running in SMP

Post by ginekolog »

widgets that spam error can cause freeze. Just got freeze for using iceui after 30 mins of spectating. I disabled it now and will test more.

ps: i hate freezes.
zerver
Spring Developer
Posts: 1358
Joined: 16 Dec 2006, 20:59

Re: Spring is running in SMP

Post by zerver »

Try the debug MT version. If it still freezes, make a bug report.

If it does not, you still have a bad widget - read the infolog.
User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Re: Spring is running in SMP

Post by very_bad_soldier »

Tried with debug version and figured out its LUPS' fault. No problems with disabled LUPS and LUPS Manager. Sorry, my fault. I guess thats the reason why Beherith said turn it off ;)

Will give it another try in real games soon...
User avatar
ginekolog
Posts: 837
Joined: 27 Feb 2006, 13:49

Re: Spring is running in SMP

Post by ginekolog »

zerver wrote:Try the debug MT version. If it still freezes, make a bug report.

If it does not, you still have a bad widget - read the infolog.
Debug version is good as it showed which widgets were failing. After disabling LUPS manager and ICEUI this MT ver works awsome.. tested in 4 mp games and many single.

thanx for effort.
DuGi
Posts: 10
Joined: 04 Jul 2009, 23:19

Re: Spring is running in SMP

Post by DuGi »

im tried this solution - http://springrts.com/phpbb/viewtopic.ph ... 35#p358435 - but i still have an error on build:

Code: Select all

[ 16%] Building CXX object rts/lib/CMakeFiles/gml.dir/gml/gml.cpp.o
In file included from /home/dugi/test/src/spring_0.79.1.2/rts/Rendering/GL/myGL.h:11,
                 from /home/dugi/test/src/spring_0.79.1.2/rts/Sim/Projectiles/Projectile.h:3,
                 from /home/dugi/test/src/spring_0.79.1.2/rts/Sim/Projectiles/FireProjectile.h:4,
                 from /home/dugi/test/src/spring_0.79.1.2/rts/lib/gml/gml.cpp:1118:
/home/dugi/test/src/spring_0.79.1.2/rts/lib/gml/gml.h:47: error: conflicting declaration 'gmlItemSequenceServer<unsigned int, int, GLuint (**)(GLsizei)> gmlListServer'
/home/dugi/test/src/spring_0.79.1.2/rts/lib/gml/gml.cpp:710: error: 'gmlListServer' has a previous declaration as 'gmlItemSequenceServer<unsigned int, int, GLuint (*)(GLsizei)> gmlListServer'
gcc 4.4.0

is there any chance to build smp client on linux?
zerver
Spring Developer
Posts: 1358
Joined: 16 Dec 2006, 20:59

Re: Spring is running in SMP

Post by zerver »

DuGi wrote:gcc 4.4.0
is there any chance to build smp client on linux?
Yeah, still a bug it seems.

Look for the declaraion
extern gmlItemSequenceServer<GLuint, GLsizei,GLuint (**)(GLsizei)> gmlListServer;
and change the double pointer "**" to a pointer "*"
Post Reply

Return to “Engine”