Jump to content
Sign in to follow this  
Dansasbu

0ad 0.0.23 on Jetson nano (ARM64)

Recommended Posts

Hi, I'm trying to install 0AD on my jetson-nano. I have ubuntu bionic installed, and an arm64 architecture. I'm using this ppa: ppa: wfg / 0ad, but seems to lack the package 0.0.23b (only appear 0.0.23) for 0ad, while for 0ad-data and 0ad-common there are 0.0.23b. because of that an unmet dependencies error raises. What I can do? I'm trying to download the 0.22 version, but I couldn't find it.

  • Like 2

Share this post


Link to post
Share on other sites

I tried to compile from source. I followed this guide https://trac.wildfiregames.com/wiki/BuildInstructions, I downloaded the code with svn: 

svn co https://svn.wildfiregames.com/public/ps/trunk/ 0ad

Building with this flags:

./update-workspaces.sh --with-system-nvtt

I'm getting this error (when is building spidermonkey)

In file included from /home/daniel/Downloads/0ad/libraries/source/spidermonkey/mozjs-45.0.2/js/src/build-debug/js/src/Unified_cpp_js_src13.cpp:2:0:
/home/daniel/Downloads/0ad/libraries/source/spidermonkey/mozjs-45.0.2/js/src/jit/IonCaches.cpp: In function ‘void CheckDOMProxyExpandoDoesNotShadow(JSContext*, js::jit::MacroAssembler&, JSObject*, jsid, js::jit::Register, js::jit::Label*)’:
/home/daniel/Downloads/0ad/libraries/source/spidermonkey/mozjs-45.0.2/js/src/jit/IonCaches.cpp:702:14: error: ‘class js::jit::MacroAssembler’ has no member named ‘branch64’; did you mean ‘branch32’?
         masm.branch64(Assembler::NotEqual,
              ^~~~~~~~
              branch32
/home/daniel/Downloads/0ad/libraries/source/spidermonkey/mozjs-45.0.2/config/rules.mk:956: recipe for target 'Unified_cpp_js_src13.o' failed
make[3]: *** [Unified_cpp_js_src13.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory '/home/daniel/Downloads/0ad/libraries/source/spidermonkey/mozjs-45.0.2/js/src/build-debug/js/src'
/home/daniel/Downloads/0ad/libraries/source/spidermonkey/mozjs-45.0.2/config/recurse.mk:71: recipe for target 'js/src/target' failed
make[2]: *** [js/src/target] Error 2
make[2]: Leaving directory '/home/daniel/Downloads/0ad/libraries/source/spidermonkey/mozjs-45.0.2/js/src/build-debug'
/home/daniel/Downloads/0ad/libraries/source/spidermonkey/mozjs-45.0.2/config/recurse.mk:32: recipe for target 'compile' failed
make[1]: *** [compile] Error 2
make[1]: Leaving directory '/home/daniel/Downloads/0ad/libraries/source/spidermonkey/mozjs-45.0.2/js/src/build-debug'
/home/daniel/Downloads/0ad/libraries/source/spidermonkey/mozjs-45.0.2/config/rules.mk:547: recipe for target 'default' failed
make: *** [default] Error 2
ERROR: SpiderMonkey build failed

 

I tried to install spidermonkey first and then use the flag: --with-system-mozjs45

./update-workspaces.sh --with-system-nvtt --with-system-mozjs45

but I had exactly the same problem when building spidermonkey. I couldn't find a solution on the web. 

There is a way of install the game without spidermonkey? Or maybe work with another version of spidermonkey?

Thanks!

 

Share this post


Link to post
Share on other sites

Spidermonkey is what the main engine uses to process the scripting language we use java script so no SM no game :( BTW if you have Firefox installed then that is the system mozjs as in Mozzila js not sure which version the current FF uses.

Enjoy the Choice :)

Share this post


Link to post
Share on other sites
15 minutes ago, Loki1950 said:

Spidermonkey is what the main engine uses to process the scripting language we use java script so no SM no game :( BTW if you have Firefox installed then that is the system mozjs as in Mozzila js not sure which version the current FF uses.

Enjoy the Choice :)

In Ubuntu (bionic) repos I found this versions of spidermonkey: libmozjs-38-dev, and libmozjs-52-dev. But the game seems to need the 45 version of spidermonkey. :( 

Share this post


Link to post
Share on other sites

Looks like nobody tested on ARM ( I plan on getting a raspberry pi 4 soonish) 

To play with other A23byou need to revert to rP21945 which will require SM38 :)

 

Share this post


Link to post
Share on other sites
16 hours ago, Stan` said:

Looks like nobody tested on ARM ( I plan on getting a raspberry pi 4 soonish) 

To play with other A23byou need to revert to rP21945 which will require SM38 :)

 

I'm sorry but I don't understand how to do that :(

 

Can you give me some guide? Thanks.

Share this post


Link to post
Share on other sites

The instruction set for ARM CPU's is different than that of Intel and AMD CPU's which is what the source code is primarily targeted to the differences are small but significant so that what will compile on one platform may not on the other which is exactly what is happening here.

Enjoy the Choice :)    

Share this post


Link to post
Share on other sites

Thanks Stan, I did what you say. I passed the step of update-workspaces, installed first libmozjs-38-dev and later using this flags:

./update-workspaces.sh --with-system-nvtt --with-system-mozjs38

However, running the makefile in gcc folder, I got this error

==== Building mocks_real (release) ====
==== Building network (release) ====
NetClient.cpp
In file included from ../../../source/scriptinterface/ScriptVal.h:21:0,
                 from ../../../source/network/NetClient.h:24,
                 from ../../../source/network/NetClient.cpp:20:
../../../source/scriptinterface/ScriptTypes.h:83:2: error: #error Your compiler is trying to use an untested minor version of the SpiderMonkey library. If you are a package maintainer, please make sure to check very carefully that this version does not change the behaviour of the code executed by SpiderMonkey. Different parts of the game (e.g. the multiplayer mode) rely on deterministic behaviour of the JavaScript engine. A simple way for testing this would be playing a network game with one player using the old version and one player using the new version. Another way for testing is running replays and comparing the final hash (check trac.wildfiregames.com/wiki/Debugging#Replaymode). For more information check this link: trac.wildfiregames.com/wiki/Debugging#Outofsync
 #error Your compiler is trying to use an untested minor version of the \
  ^~~~~
network.make:137: recipe for target 'obj/network_Release/NetClient.o' failed
make[1]: *** [obj/network_Release/NetClient.o] Error 1
Makefile:74: recipe for target 'network' failed
make: *** [network] Error 2

I found this on the web https://trac.wildfiregames.com/ticket/3039?cversion=0&cnum_hist=2

Since I don't know which MOZJS_MINOR_VERSION should I use, I removed that version check from the "source/scriptinterface/ScriptTypes.h" file. However I'm getting this error:

BinarySerializer.cpp
In file included from /usr/include/mozjs-38/jspubtd.h:19:0,
                 from ../../../source/scriptinterface/ScriptTypes.h:60,
                 from ../../../source/scriptinterface/ScriptVal.h:21,
                 from ../../../source/simulation2/serialization/ISerializer.h:23,
                 from ../../../source/simulation2/serialization/BinarySerializer.h:21,
                 from ../../../source/simulation2/serialization/BinarySerializer.cpp:20:
../../../source/simulation2/serialization/BinarySerializer.cpp: In member function ‘void CBinarySerializerScriptImpl::HandleScriptVal(JS::HandleValue)’:
../../../source/simulation2/serialization/BinarySerializer.cpp:150:36: error: ‘js::js’ has not been declared
 #define JSCLASS_CACHED_PROTO_WIDTH js::JSCLASS_CACHED_PROTO_WIDTH
                                    ^
/usr/include/mozjs-38/js/Class.h:442:56: note: in expansion of macro ‘JSCLASS_CACHED_PROTO_WIDTH’
 #define JSCLASS_CACHED_PROTO_MASK       JS_BITMASK(js::JSCLASS_CACHED_PROTO_WIDTH)
                                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~
simulation2.make:942: recipe for target 'obj/simulation2_Release/BinarySerializer.o' failed
make[1]: *** [obj/simulation2_Release/BinarySerializer.o] Error 1
Makefile:98: recipe for target 'simulation2' failed
make: *** [simulation2] Error 2

 

I don't know if all this checks are for play online, and there is another way to install the game to play against the AI only. 

Share this post


Link to post
Share on other sites

Whitout the flag --with-system-mozjs38, I got this error

                 from /home/daniel/Downloads/0ad/libraries/source/spidermonkey/mozjs-38.0.0/js/src/build-debug/js/src/Unified_cpp_js_src3.cpp:92:
/home/daniel/Downloads/0ad/libraries/source/spidermonkey/mozjs-38.0.0/js/src/jit/shared/CodeGenerator-shared-inl.h: In member function ‘void js::jit::CodeGeneratorShared::verifyHeapAccessDisassembly(uint32_t, uint32_t, bool, js::Scalar::Type, const js::jit::Operand&, js::jit::LAllocation)’:
/home/daniel/Downloads/0ad/libraries/source/spidermonkey/mozjs-38.0.0/js/src/jit/shared/CodeGenerator-shared-inl.h:232:10: error: ‘class js::jit::MacroAssembler’ has no member named ‘verifyHeapAccessDisassembly’
     masm.verifyHeapAccessDisassembly(begin, end,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~

 

Share this post


Link to post
Share on other sites

Hi! You seem to have hit this bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1266366

What is needed is to patch spidermonkey with it, and when it's committed, then you will be able to build SVN like you tried to do, with

On 8/22/2019 at 4:25 AM, Dansasbu said:

./update-workspaces.sh --with-system-nvtt

Ideally we would have downloaded the latest bundle from the esr branch, instead of the release candidate from the SpiderMonkey devs, but they are not available anymore for SM45. So it would be better if you could test the patch that I will make, in case we need to patch more bugs. Are you comfortable with using our patch review platform? Else I'll provide the patch here and will give you instructions to test it.

Thanks for the report :)

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
13 minutes ago, Dansasbu said:

I'm very sorry :sweatdrop:. I need to create a Diff? 

Yes only if you want to :)

Share this post


Link to post
Share on other sites

Here is a patch: https://code.wildfiregames.com/D2244

To apply it, you should use arcanist. If you are on Debian buster or later, just install it from the repository. Else follow these instructions: quick start.

Then, you can create an account on Phabricator (that will allow you to comment directly on the patch, to be pinged if we need some information, etc).

Then, in your terminal:

arc install-certificate

in order to use arcanist with your account, and then

arc patch D2244

in order to apply the patch. You can then build with

./update-workspaces.sh --with-system-nvtt
cd gcc
make

And please report here or on the patch directly if you discover other bugs :)

Thanks for the report, and in advance for testing and playing!

Share this post


Link to post
Share on other sites

I don't know how was the support for arm64 for SM38. Our version never worked there, but maybe it could be patched (it's too late for us though). We can help to find patches to bugs if they exist, but that will need some tinkering from Dansasbu. But this is a good opportunity to improve our arm support for A24!

Updating SVN is not needed to test the patch.

Share this post


Link to post
Share on other sites
17 minutes ago, Itms said:

I don't know how was the support for arm64 for SM38. Our version never worked there, but maybe it could be patched (it's too late for us though). We can help to find patches to bugs if they exist, but that will need some tinkering from Dansasbu. But this is a good opportunity to improve our arm support for A24!

Updating SVN is not needed to test the patch.

Well he reverted to A23b so it is :D

Yeah makes sense. I'll probably buy a RPI4 or a Jetson so we can test on those platforms :) before the end of the year.

Share this post


Link to post
Share on other sites

Hi, I have some news! First, I updated svn to r22827 (I checked it by:  svn info --show-item revision), then I followed the Itms instructions. The patch worked very well, no errors reported. Running the automated tests also don't show errors (binaries/system/test), however when I tried to run the game I got this

daniel@jetson-nano:~/Downloads/0AD/0ad$ binaries/system/pyrogenesis
TIMER| InitVfs: 618.079 us
Writing the mainlog at /home/daniel/.config/0ad/logs/mainlog.html
TIMER| CONFIG_Init: 7.06997 ms
Sound: AlcInit success, using OpenAL Soft
TIMER| shutdown ConfigDB: 0.677 us
TIMER| resource modules: 4.04244 ms
TIMER TOTALS (9 clients)
-----------------------------------------------------
  tc_pool_alloc: 0 us (0x)
  tc_png_decode: 0 us (0x)
  tc_dds_transform: 0 us (0x)
  tc_transform: 0 us (0x)
  tc_plain_transform: 0 us (0x)
  tc_ShaderGLSLLink: 0 us (0x)
  tc_ShaderGLSLCompile: 0 us (0x)
  tc_ShaderValidation: 0 us (0x)
  xml_validation: 0 us (0x)
-----------------------------------------------------
TIMER| shutdown misc: 479.744 us
TIMER| InitVfs: 2.67878 ms
Writing the mainlog at /home/daniel/.config/0ad/logs/mainlog.html
TIMER| CONFIG_Init: 10.0518 ms
Sound: AlcInit success, using OpenAL Soft
dbus[8198]: arguments to dbus_message_new_method_call() were incorrect, assertion "path != NULL" failed in file ../../../dbus/dbus-message.c line 1362.
This is normally a bug in some application using the D-Bus library.

  D-Bus not built with -rdynamic so unable to print a backtrace
Aborted (core dumped)

 

Seems to be a bug of SDL2: https://forum.odroid.com/viewtopic.php?t=30652

I run the following and the game works

sudo killall ibus-daemon

However the game runs a bit slowly, I disabled some graphics options but the enhancement is small. I will play a little more and see how it feels. Many many thanks! :) :) 

2063627605_Screenshotfrom2019-09-0117-48-58.thumb.png.82c41f75bf0f3d950f0f504d720439d6.png521082207_Screenshotfrom2019-09-0117-48-15.thumb.png.a9db4830ca3538c044fe2d7a929da194.png

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...