Page 1 of 1

Lua crash when running multithreaded spring

Posted: 12 Oct 2011, 00:00
by Salamander
Hey

I can't play multiplayer games using non-multithreaded spring because fps drops to 3 later on in the game when there are hundreds of units. I have a quad-core CPU, so I need multithreading. I recompiled spring with gml support (Gentoo 64) so I have spring-multithreaded, but during zero-k games (the only mod I tested using spring-multithreaded so far) the lua interface keeps crashing. I get many of these errors in infolog.txt

Code: Select all

(...)
[f=0000299] GML error: Sim thread called gmlDeleteLists (LUA)
[f=0000299] LuaUI::RunCallIn: error = 2, AddConsoleLine, [string "LuaUI/Widgets/chili/Controls/control.lua"]:122: Invalid call
[f=0000301] 5 errors deep in LuaUI, disabling...
(...)
or

Code: Select all

(...)
[f=0003172] GML error: Sim thread called gmlDeleteLists (LUA)
[f=0003172] 5 errors deep in LuaUI, disabling...
[f=0003172] LuaUI::RunCallIn: error = 2, AddConsoleLine, [string "LuaUI/Widgets/chili/Controls/control.lua"]:130: Invalid call
[f=0003172] Type '/luaui reload' in the chat to re-enable LuaUI.
[f=0003172] ===>>>  Please report this error to the forum or mantis with your infolog.txt
(...)
Is there anything I can do to have a playable multithreaded spring game?

----------------------------------------------
Specs:
Gentoo 64
spring-0.82.7.1
i7 CPU Q 820 @ 1.73GHz GenuineIntel (quadcore)
8GB RAM
nvidia-drivers-275.09.07
lua-5.1.4-r4 (this is my system lua, I don't know if Spring uses it, or its own)

Re: Lua crash when running multithreaded spring

Posted: 12 Oct 2011, 00:26
by Beherith
Dont use any widget that draws on screen with MT spring.

Re: Lua crash when running multithreaded spring

Posted: 12 Oct 2011, 07:46
by Salamander
So how can I have those useful buttons like placing mexes over an area, and other useful displays?

Re: Lua crash when running multithreaded spring

Posted: 12 Oct 2011, 10:50
by hoijui
there is a reason why the multi-threaded build of spring is not the default build. and if you figure that most gamers will have multi-core CPUs these days, you know that it can not be that it runs slower on single core CPUs.
making spring run well, and well distributed over multiple threads is a very hard thing to do, and we are just on the way there.
i guess you have seen the MT related warning in your infolog.txt.
BA should work much better with MT then ZK.

Re: Lua crash when running multithreaded spring

Posted: 12 Oct 2011, 11:17
by zerver
For zero-k I recommend that you wait with MT until the next version of spring. Even if you would get it to run, there are some bugs that could make it perform worse than single thread.

Re: Lua crash when running multithreaded spring

Posted: 12 Oct 2011, 22:10
by Salamander
hoijui wrote:(...) and if you figure that most gamers will have multi-core CPUs these days, you know that it can not be that it runs slower on single core CPUs.
I figure that most gamers have dual-core CPUs where the speed of a single core is on average higher than that of a core in a quad-core CPU. I also notice that only one of my CPU cores is maxed out when performance drops.

Another point of interest is that SpringLobby reports most people as having a CPU speed of 6.7GHz. Why that is I do not know, obviously that is not what they have, but I am curious why it does that. My CPU speed is correctly reported as 1.7GHz.

The low fps issue is not related to my GPU, as I presume my GPU is better than the average Spring gamer's one, and, more importantly, the low fps is not correlated to the number of units visible on screen. It drops when the number of units on the whole map is high, even if they're all off the screen, and therefore not rendered.

The only conclusion that makes sense to me is that this is a CPU issue - the processor is the bottleneck in my case. If you have a better idea, then please do share it.
zerver wrote:For zero-k I recommend that you wait with MT until the next version of spring
Specifically the next one, or some future one? If the former, are you referring to a major or minor new version?
Is there a roadmap I can read?

Re: Lua crash when running multithreaded spring

Posted: 12 Oct 2011, 23:53
by luckywaldo7
Salamander wrote:Another point of interest is that SpringLobby reports most people as having a CPU speed of 6.7GHz. Why that is I do not know, obviously that is not what they have, but I am curious why it does that. My CPU speed is correctly reported as 1.7GHz.
Mostly unrelated to OP but FYI, that is what Zero-K Lobby reports as CPU speed instead of actual CPU speed, to help the devs identify who is using it.

Re: Lua crash when running multithreaded spring

Posted: 14 Oct 2011, 12:17
by zerver
Salamander wrote:Specifically the next one, or some future one? If the former, are you referring to a major or minor new version?
Is there a roadmap I can read?
The next major is supposed to work. If it does not, you should mantis it immediately.