Hi all,
Last week i succesfully built a 0.85 Spring multithreaded-version with OPENMP option on a Debian 6 Squeeze system on 64bit arch using all stable dependencies of Debian Squeeze (no backports, no Wheezy packages). I plan to show you the details when I can really be sure this works. Those instructions, whathever building a multithreaded version or not, could be used to make a "fully Squeeze" debian package instead of making people use those Wheezy packages and having and "partially overupdated" system.
Today I was able to test it for the first time on online game (2 matches) and i have, as instructions said i was able to suffer, unsync problems (on both matches).
I really want to use my multi-core CPU to run Spring but i dont really know the differences of:
- Using OPENMP option on cmake
- Building "spring-multithreaded" with make
Actually i used both on my build, but can anyone explain me the difference? What should I do to (try to) get Spring running on more than one CPU?
I hope you have some answers!
Thanks in advance
MrPresident
[Solved] Spring multithreaded-openmp Debian 6 Squeeze 64 bit
Moderator: Moderators
- MrPresident
- Posts: 28
- Joined: 08 Aug 2007, 23:57
[Solved] Spring multithreaded-openmp Debian 6 Squeeze 64 bit
Last edited by MrPresident on 15 Feb 2012, 23:48, edited 1 time in total.
Re: Spring multithreaded - openmp on Debian 6 Squeeze 64 bit
MT:
spring-multithread(ed?), aka GML spring, does the rendering related parts running on the CPU on an other thread.
OMP:
the OpenMP build-option is a minor thing, which optimizes some low level loops in the code, to run on multiple CPUs.
MT is a much much larger project, done and maintained by zerver. it is much more complex, and it is buggy in 85.0. it is hte reason why you are getting desyncs, most likely.
OMP is pretty safe to use, maintained by jk, and .. if i remember right, will not likely change much whne used, whether in performance gain nor in problems/stability of the engine.
none of the two, nor the two combined, as they are in spring as of these days, will be able to make really good use of even two cores/CPUs, not to speak of more then two. or say... it is still very likely, even if you use MT + OMP, that you will see one core at 100% usage, and the others at low percentages, and get a laggy game.
to change that, is a very, very difficult thing, and needs a lot of planning, decission making, and coding, and is not to come withing the next year or two.
spring-multithread(ed?), aka GML spring, does the rendering related parts running on the CPU on an other thread.
OMP:
the OpenMP build-option is a minor thing, which optimizes some low level loops in the code, to run on multiple CPUs.
MT is a much much larger project, done and maintained by zerver. it is much more complex, and it is buggy in 85.0. it is hte reason why you are getting desyncs, most likely.
OMP is pretty safe to use, maintained by jk, and .. if i remember right, will not likely change much whne used, whether in performance gain nor in problems/stability of the engine.
none of the two, nor the two combined, as they are in spring as of these days, will be able to make really good use of even two cores/CPUs, not to speak of more then two. or say... it is still very likely, even if you use MT + OMP, that you will see one core at 100% usage, and the others at low percentages, and get a laggy game.
to change that, is a very, very difficult thing, and needs a lot of planning, decission making, and coding, and is not to come withing the next year or two.
Re: Spring multithreaded - openmp on Debian 6 Squeeze 64 bit
The 0.85 release has a bug in MT. There is a patched version out there that works (85.0-2-gb951972). Check the git for that commit.
Re: Spring multithreaded - openmp on Debian 6 Squeeze 64 bit
spring-multithreaded is known for desync'ing in 85.0
OMP & spring-multithreaded are totally separated. OMP is a small scale multithreading, it multithreads single (huge) for-loops in the engine. And so it won't give you more FPS, but it will increase your minimal FPS (CPU-intensive code gets executed faster). But you will only reach like ~120% cpu usage with it. I use it for multiple months now and it seems to be sync-safe.
spring-multithreaded instead creates parallel threads for simulation & rendering. But both isn't strictly separated in the engine's code, so it does a lot mutex'ing and so it's neither ideal and even can (rarely) cause desyncs/crashes. Also some benchmarks even showed that this doesn't increase the FPS in late games (only tested with midrange pcs, might be different on lowend).
OMP & spring-multithreaded are totally separated. OMP is a small scale multithreading, it multithreads single (huge) for-loops in the engine. And so it won't give you more FPS, but it will increase your minimal FPS (CPU-intensive code gets executed faster). But you will only reach like ~120% cpu usage with it. I use it for multiple months now and it seems to be sync-safe.
spring-multithreaded instead creates parallel threads for simulation & rendering. But both isn't strictly separated in the engine's code, so it does a lot mutex'ing and so it's neither ideal and even can (rarely) cause desyncs/crashes. Also some benchmarks even showed that this doesn't increase the FPS in late games (only tested with midrange pcs, might be different on lowend).
Re: Spring multithreaded - openmp on Debian 6 Squeeze 64 bit
MT actually makes good use of two cores, but not so good use of remaining cores. You will usually see one core at 100%, which is the rendering thread, and in a large game with high Sim load, both cores will be maxed out. The additional cores are used for sound, rendering speedups etc, but you will not see anywhere near 100% load on those.hoijui wrote:none of the two, nor the two combined, as they are in spring as of these days, will be able to make really good use of even two cores/CPUs, not to speak of more then two. or say... it is still very likely, even if you use MT + OMP, that you will see one core at 100% usage, and the others at low percentages, and get a laggy game.
BTW Compile from the 85MT branch to fix your desync problem.
- MrPresident
- Posts: 28
- Joined: 08 Aug 2007, 23:57
Re: Spring multithreaded - openmp on Debian 6 Squeeze 64 bit
Thanks a lot all for your replies.
https://github.com/spring/spring/commit ... 18c623c3fd
Thanks in advance.
If i do that will I be able to play online? And please, can give you a more detailed explanation of how to use "git" to obtain that commit? I used git only once and I'm not good at it. I just had a look at the git repo (using HTTP version) and i didnt find anything except this:dansan wrote:The 0.85 release has a bug in MT. There is a patched version out there that works (85.0-2-gb951972). Check the git for that commit.
https://github.com/spring/spring/commit ... 18c623c3fd
Thanks in advance.
Re: Spring multithreaded - openmp on Debian 6 Squeeze 64 bit
If you have cloned spring already, as described here:
http://springrts.com/wiki/Building_Spring_on_Linux
git checkout --track -b 85MT origin/85MT
If you build the spring-multithreaded executable from this branch and copy it to your "regular" 85.0 installation folder, then online play will work.
http://springrts.com/wiki/Building_Spring_on_Linux
git checkout --track -b 85MT origin/85MT
If you build the spring-multithreaded executable from this branch and copy it to your "regular" 85.0 installation folder, then online play will work.
- MrPresident
- Posts: 28
- Joined: 08 Aug 2007, 23:57
Re: Spring multithreaded - openmp on Debian 6 Squeeze 64 bit
Hi
I hope I can test it this night in some online match.
Thanks a lot!
I just builded it succesfully following your instructions and I ran it on a singleplayer match. It shows the "gb951972" in the version release.zerver wrote:If you have cloned spring already, as described here:
http://springrts.com/wiki/Building_Spring_on_Linux
git checkout --track -b 85MT origin/85MT
If you build the spring-multithreaded executable from this branch and copy it to your "regular" 85.0 installation folder, then online play will work.
I hope I can test it this night in some online match.
Thanks a lot!
- MrPresident
- Posts: 28
- Joined: 08 Aug 2007, 23:57
Re: Spring multithreaded - openmp on Debian 6 Squeeze 64 bit
It runs perfectly!
Here are my annotations:
Here are my annotations:
Code: Select all
1.- Get the necessary packages (Debian 6 Squeeze stable repositories - no backports, no Wheezy packages)
build-essential
asciidoc
maven2
default-jdk
libboost-thread-dev
libboost-system-dev
libboost-signals-dev
libboost-regex-dev
libboost-test-dev
libboost-program-options-dev
libc6-dev
libdevil-dev
libfreetype6-dev
libgcc1
libgl1-mesa-dev
libglew1.5-dev
libglu1-mesa-dev
libogg-dev
libopenal-dev
libsdl1.2-dev
libstdc++6-4.4-dev
libvorbis-dev
libvorbisfile3
libx11-dev
libx11-6
libxcursor-dev
zlib1g-dev
otf-freefont
p7zip-full
2.- Get the source
git clone -b master git://github.com/spring/spring.git
3.- Cmake
cd spring/
cmake -DCMAKE_INSTALL_PREFIX:PATH=/opt/spring -DOPENMP:BOOL=TRUE .
4.- Compile and install spring-multithreaded
make spring-multithreaded
make install-spring-multithreaded
5.- Apply MT patch
git checkout --track -b 85MT origin/85MT
git checkout master
git merge 85MT
6.- Rebuild spring-multithreaded
make spring-multithreaded
7.- Just copy the "spring-multithreaded" bin to your "/opt/spring/bin" directory
Re: [Solved] Spring multithreaded-openmp Debian 6 Squeeze 64 bit
Good explanation of spring versions! I see OMP before and ask in lobby but nobody knows what is it :-D