status-im / nimbus-eth2

Nim implementation of the Ethereum Beacon Chain
https://nimbus.guide
Other
503 stars 210 forks source link

Bug: Error build with cmd "make -jX nimbus_beacon_node" #6324

Closed tranphuocanh0207 closed 22 hours ago

tranphuocanh0207 commented 1 month ago

Describe the bug I'm try to build the process with 'make -jX nimbus_beacon_node' but I get error

  1. Platform details (OS, architecture): Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Address sizes: 48 bits physical, 48 bits virtual Byte Order: Little Endian CPU(s): 24 On-line CPU(s) list: 0-23 Vendor ID: AuthenticAMD Model name: AMD Ryzen 9 7900 12-Core Processor
Screenshot 2024-06-01 at 23 11 17

your problem.

Installed dependencies : build-essential is already the newest version (12.9ubuntu3). cmake is already the newest version (3.22.1-1ubuntu1.22.04.2). git-lfs is already the newest version (3.0.2-1ubuntu0.2). gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0

tersec commented 1 month ago

Related issues:

tersec commented 1 month ago

@tranphuocanh0207 if you run gcc -march=native -Q --help=target and look for march, mcpu, and mtune values, what does it show in your case? e.g.

$ gcc -march=native -Q --help=target | grep -E '(march|mcpu|mtune)='
  -march=                           znver3
  -mcpu=                            
  -mtune=                           znver3

Testing gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 it does not support znver4; this must come in gcc 12/13/14:

cc1: note: valid arguments to '-march=' switch are: nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 cannonlake icelake-client rocketlake icelake-server cascadelake tigerlake cooperlake sapphirerapids alderlake bonnell atom silvermont slm goldmont goldmont-plus tremont knl knm x86-64 x86-64-v2 x86-64-v3 x86-64-v4 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 znver2 znver3 btver1 btver2 native

it should be one of those listed valid arguments in each case.

Furthermore, if you then substitute in place of native in: https://github.com/status-im/nimbus-eth2/blob/d2a07514541ffe6ee02a2ec7272ce7a315131e04/config.nims#L124-L125 e.g.

 switch("passC", "-march=znver3") 
 switch("passL", "-march=znver3") 

(or whatever it shows)

does it still reproduce this issue?

tranphuocanh0207 commented 1 month ago

Oh, command "gcc -march=native -Q --help=target" is the same as your e.g. And the solution of replacing "native" with "znver3" in config.nims worked. Thanks for your help.

tersec commented 1 month ago

That's strange, but, glad you were able to built it by specifying -march=znver3 directly. It should work regardless, but this is a potential workaround until a root cause is discovered.

tranphuocanh0207 commented 1 month ago

Yes, I hope it doesn't encounter any unexpected errors. Thanks you!!!

tranphuocanh0207 commented 1 month ago

@tersec It's working, but it's not stable because of this error. image

tersec commented 1 month ago

That stack trace looks like the symbol non-demangling one gets using Nim 2.0. What version of Nim is being used to compile this?

tranphuocanh0207 commented 1 month ago

@tersec I'm not sure, but with these errors it's quite dangerous during validator operation. I decided to switch to another device with an Intel CPU, hopefully it will be more stable.

arnetheduck commented 4 weeks ago

Nim 2.0

it's also backported to 1.6.20

tersec commented 2 days ago

Another workaround -- https://nimbus.guide/developers.html#makefile-tips-and-tricks-for-developers

make NIMFLAGS="-d:disableMarchNative" nimbus_beacon_node
tersec commented 22 hours ago

https://github.com/status-im/nimbus-eth2/pull/6402