Bendr0id / xmrigCC

RandomX, CryptoNight, Argon2 and GhostRider CPU/GPU miner with Command&Control (CC) Server and Monitoring
GNU General Public License v3.0
312 stars 108 forks source link

Out of Memory #335

Closed tgwaste closed 3 years ago

tgwaste commented 3 years ago

Is there any way this can be fixed?

# make -j4
[  3%] Built target xmrigDaemon
[  5%] Built target argon2
[ 18%] Built target xmrigServer
[ 19%] Building CXX object CMakeFiles/xmrigMiner.dir/src/crypto/rx/RxDataset.cpp.o

cc1plus: out of memory allocating 5190462000 bytes after a total of 1040674816 bytes
make[2]: *** [CMakeFiles/xmrigMiner.dir/build.make:1662: CMakeFiles/xmrigMiner.dir/src/crypto/rx/RxDataset.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:154: CMakeFiles/xmrigMiner.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

Searching I found this

That happens when you try to compile a UTF-16 encoded file saved in Windows with gcc. Change encoding of your sources to UTF-8. See [related CPP documentation][1]

This issue prevents compiling on 4GB RAM servers (even with swap it seems)

Bendr0id commented 3 years ago

Did you try to compile with single thread? Make sure you use gcc+v7,v8 or v9. V10 seems to be buggy.

tgwaste commented 3 years ago

Ill try that. I'm currently using gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)

tgwaste commented 3 years ago

Unfortunately compiling it on a single thread gave the same results.

Bendr0id commented 3 years ago

Can you please retry with the latest master

tgwaste commented 3 years ago

This is working great now. Pretty clean to. The only 2 warnings I get are:

/usr/local/bin/test/xmrigCC/src/App.cpp: In member function ‘void xmrig::App::reboot()’:
/usr/local/bin/test/xmrigCC/src/App.cpp:185:15: warning: ignoring return value of ‘int system(const char*)’, declared with attribute warn_unused_result [-Wunused-result]
  185 |         system(rebootCmd);
      |         ~~~~~~^~~~~~~~~~~

/usr/local/bin/test/xmrigCC/src/crypto/randomx/panthera/yespower-opt.c:57:4: warning: #warning WARN_MESSAGE [-Wcpp]
   57 | #  warning WARN_MESSAGE
      |    ^~~~~~~
Bendr0id commented 3 years ago

That's fine. Will close the ticket.