Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support ARMv7? #216

Closed
gennadicho opened this issue Nov 22, 2017 · 32 comments
Closed

support ARMv7? #216

gennadicho opened this issue Nov 22, 2017 · 32 comments

Comments

@gennadicho
Copy link

Hi. Will there be support armv7? old phones, cubieboards, and other things.

@semeion
Copy link

semeion commented Nov 22, 2017

I tried to compile on a raspberry pi 3 B and got an error, could be nice have xmrig running on my RPi3 but i have no idea if it is possible.

$ make
Scanning dependencies of target cpuid
[  2%] Building C object src/3rdparty/libcpuid/CMakeFiles/cpuid.dir/cpuid_main.c.o
cc: error: unrecognized command line option '-maes'; did you mean '-mapcs'?
make[2]: *** [src/3rdparty/libcpuid/CMakeFiles/cpuid.dir/build.make:63: src/3rdparty/libcpuid/CMakeFiles/cpuid.dir/cpuid_main.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:123: src/3rdparty/libcpuid/CMakeFiles/cpuid.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

@gennadicho
Copy link
Author

@semeion you not switch to the arm branch. Look "-maes" gcc flags? You try to compile x86 sources. Try git fetch origin arm ; git checkout arm on xmrig directory.

@gennadicho
Copy link
Author

@semeion but another problem is xmrig not support armv7, you can find this info in roadmap(only aarch64 aka armv8)

@xmrig
Copy link
Owner

xmrig commented Nov 23, 2017

I got idea where I can get some ARMv7 hardware, I will check it tomorrow, hopefully only cmake changes required, until CPU supports NEON extensions.
But as I know hardware AES supported only in ARMv8.

@gennadicho
Copy link
Author

@xmrig, nice, thanks! You may buy random china android phone, and set up debian chroot on this :-) if you can not find armv7 hardware - i have many of them, and may to get you ssh to one of this "machine". But my phone is bit a slow and have bad internet connection.

@gennadicho
Copy link
Author

@xmrig Yep, AES only on ARMv8. :(

/proc/cpuinfo from one my phone:
`root@localhost:~# cat /proc/cpuinfo
Processor : ARMv7 Processor rev 5 (v7l)
processor : 0
model name : ARMv7 Processor rev 5 (v7l)
BogoMIPS : 2413.36
Features : swp half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xc07
CPU revision : 5

processor : 1
model name : ARMv7 Processor rev 5 (v7l)
BogoMIPS : 2413.36
Features : swp half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xc07
CPU revision : 5

processor : 2
model name : ARMv7 Processor rev 5 (v7l)
BogoMIPS : 2413.36
Features : swp half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xc07
CPU revision : 5

processor : 3
model name : ARMv7 Processor rev 5 (v7l)
BogoMIPS : 2413.36
Features : swp half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xc07
CPU revision : 5

Hardware : sc8830
Revision : 0000
Serial : 0000000000000000
`

@gennadicho
Copy link
Author

I make many dumb editing in code, only CryptoNight.cpp not compile :(

In file included from /tmp/xmrig/src/crypto/CryptoNight_arm64.h:33:0,
from /tmp/xmrig/src/crypto/CryptoNight.cpp:27:
/tmp/xmrig/src/crypto/soft_aes.h: In function ‘__m128i soft_aeskeygenassist(__m128i)’:
/tmp/xmrig/src/crypto/soft_aes.h:122:37: error: there are no arguments to ‘_rotr’ that depend on a template parameter, so a declaration of ‘_rotr’ must be available [-fpermissive]
return _mm_set_epi32(_rotr(X3, 8) ^ rcon, X3, _rotr(X1, 8) ^ rcon, X1);
^
/tmp/xmrig/src/crypto/soft_aes.h:122:37: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
/tmp/xmrig/src/crypto/soft_aes.h:122:62: error: there are no arguments to ‘_rotr’ that depend on a template parameter, so a declaration of ‘_rotr’ must be available [-fpermissive]
return _mm_set_epi32(_rotr(X3, 8) ^ rcon, X3, _rotr(X1, 8) ^ rcon, X1);
^
In file included from /tmp/xmrig/src/crypto/CryptoNight.cpp:27:0:
/tmp/xmrig/src/crypto/CryptoNight_arm64.h: In function ‘__m128i _mm_set_epi64x(uint64_t, uint64_t)’:
/tmp/xmrig/src/crypto/CryptoNight_arm64.h:71:55: note: use -flax-vector-conversions to permit conversions between vectors with differing element types or numbers of subparts
return vcombine_u64(vcreate_u64(b), vcreate_u64(a));
^
/tmp/xmrig/src/crypto/CryptoNight_arm64.h:71:55: error: cannot convert ‘uint64x2_t {aka __vector(2) __builtin_neon_udi}’ to ‘__m128i {aka __vector(4) __builtin_neon_si}’ in return
/tmp/xmrig/src/crypto/CryptoNight_arm64.h: In function ‘uint64_t _mm_cvtsi128_si64(__m128i)’:
/tmp/xmrig/src/crypto/CryptoNight_arm64.h:78:31: error: cannot convert ‘__m128i {aka __vector(4) __builtin_neon_si}’ to ‘uint64x2_t {aka __vector(2) __builtin_neon_udi}’ for argument ‘1’ to ‘uint64_t vgetq_lane_u6
4(uint64x2_t, int)’
return vgetq_lane_u64(a, 0);

@xmrig xmrig mentioned this issue Nov 24, 2017
22 tasks
xmrig added a commit that referenced this issue Nov 26, 2017
@xmrig
Copy link
Owner

xmrig commented Nov 26, 2017

I added ARMv7 support. It slow, need emulate 64 bit multiplication (same as 32bit x86) and AES as well.
Thank you.

@gennadicho
Copy link
Author

@xmrig big-big thanks! Ha-ha. I try it today :-)

@gennadicho
Copy link
Author

nice, everything works. :) thanks again

@xmrig xmrig added this to the v2.4.3 milestone Nov 27, 2017
cmarshall108 added a commit to cmarshall108/xmrig-old that referenced this issue Nov 27, 2017
@demian2g
Copy link

Does anybody have compiled armv7 version? Trying to make on OrangePi (rasp-like) - only errors. Thanks

@semeion
Copy link

semeion commented Dec 17, 2017

@demian2g yes i did. it is working fine.

I am using Raspberry pi 3B with ArchLinux ARM 32bits, to compile i used:

CFLAGS="-march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 -O2 -pipe -fstack-protector-strong -fno-plt" CXXFLAGS="-march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 -O2 -pipe -fstack-protector-strong -fno-plt" cmake .. -DWITH_HTTPD=OFF && make VERBOSE=1

@demian2g
Copy link

@semeion thanks, but still MHD_LIBRARY (ADVANCED) error. I'm using OrangePi Plus 2 with Ubuntu Vivid and not sure that have correctly installed all compilers and libraries. Just wanted to see how much h/s can it generate

@semeion
Copy link

semeion commented Dec 18, 2017

I have no idea how to help you. I never used Ubuntu and/or OrangePi.

@SergeyStaroletov
Copy link

@demian2g just delete all the files in directory and rerun the compilation again. hashrate on rpi3 is 6h/s max :)))

@jgillich
Copy link

My hashrate on a RPi3 is ~7.4 (running Fedora aarch64).

@SergeyStaroletov
Copy link

@jgillich Can it use something like -x64 -AES-NI extensions in aarch64 mode?

@jgillich
Copy link

I don't think so, I have to use --av 3 because it segfaults otherwise. Haven't really figured out why though.

@supercodechen
Copy link

I have build successful on armv7l ,application could get job,but the rate is n/a H/s,I try to change config,like av : 4;algo : cyptonight-lite; But the rate is still n/a H/s,So, I need your help,@xmring

@supercodechen
Copy link

oh~ps: when I change av to 2,the application return a err:"cryptonight-lite" hash self-test failed.

@supercodechen
Copy link

@xmrig

@rainmo
Copy link

rainmo commented Jan 17, 2018

@semeion Hi, buddy. I met same problem when i complied xmrig used in RPI-3B-centos. can u tell me how to use "cmake .. && make". Thanks.

@jgrabenstein
Copy link

I’m able to get 9.3h/s on raspbian/cpuminer-multi with my pi 3. Heard aarch64 and xmrig was supposed to be faster but from the above comments that doesn’t seem to be the case. Anyone else achieve better? (Different compiliarion flags etc...)

@gennadicho
Copy link
Author

@rainmo what the problem? Paste some logs

@gennadicho
Copy link
Author

@jgrabenstein off course aarch64 with huge pages faster. I have phone wileyfox spark, cpuminer-multi = 9-10h/s, xmrig = 15-20 h/s

@jgrabenstein
Copy link

@gennadicho thanks for confirming. Above comments made me apprehensive to try. Have 2 more boards coming tomorrow will give aarch64/xmrig a shot.

@BlackMulch
Copy link

The instructions for building on Ubuntu work for my build, but I'd like to try tuning for my architecture by setting different values for CFLAGS and CXXFLAGS... Is this possible?

@xmrig
Copy link
Owner

xmrig commented Mar 8, 2018

@BlackMulch
Copy link

BlackMulch commented Mar 8, 2018

I guess i should have mentioned that I'm new to linux and cmake... So, I see the various flags from the *.cmake files above, but I'm not clear on how they are applied at build-time. Where in the build process can I see which flags are applied and also set my own?

Also, thanks for the quick reply! I love the project!

@xmrig
Copy link
Owner

xmrig commented Mar 8, 2018

You need change CMAKE_C_FLAGS and CMAKE_CXX_FLAGS and run make.
To determinate what line need change need know what compiler you use: gcc/clang and CPU arch: ARMv8/ARMv7.
Thank you.

Bendr0id referenced this issue in Bendr0id/xmrigCC Apr 16, 2018
@SlastikhinNikita
Copy link

Can I download build releases somewhere?

@James-yaoshenglong
Copy link

I clone the source code from GitHub and compile and make it on a raspberry pi 4B with a pi os and it shows the below errors,I can not solve it .
It wellly run through the compile stage and in the link stage it shows these errors

collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/xmrig.dir/build.make:3029: xmrig] Error 1
make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/xmrig.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests