JayDDee / cpuminer-opt

Optimized multi algo CPU miner
Other
770 stars 544 forks source link

inlining failed in call to always_inline #70

Closed Freccia closed 6 years ago

Freccia commented 6 years ago

Hello, I'm trying to compile your project on Debian buster (alfa 2), but I've got a bunch of errors I cannot get rid of. They are all the same (I am not including the full log as it is so long and repetitive):

In file included from algo/echo/aes_ni/vperm.h:20:0,
                 from algo/echo/aes_ni/hash.c:21:
algo/echo/aes_ni/hash.c: In function ‘Compress’:
/usr/lib/gcc/x86_64-linux-gnu/7/include/tmmintrin.h:136:1: error: inlining failed in call to always_inline ‘_mm_shuffle_epi8’: target specific option mismatch
 _mm_shuffle_epi8 (__m128i __X, __m128i __Y)
 ^~~~~~~~~~~~~~~~
In file included from algo/echo/aes_ni/hash.c:21:0:
algo/echo/aes_ni/vperm.h:53:7: note: called from here
  x  = _mm_shuffle_epi8(*((__m128i*)table + 0), x);\
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
algo/echo/aes_ni/hash.c:263:4: note: in expansion of macro ‘TRANSFORM’
    TRANSFORM(_state[i][j], _k_ipt, t1, t2);
    ^~~~~~~~~

I've tryied to solve the issue compiling with the option -msse3 as pointed out here: https://stackoverflow.com/questions/38674236/botanautoseeded-rng-m128i-mm-shuffle-epi8-target-specific-option-mismatch

But still I've got (similar) errors:

In file included from /usr/lib/gcc/x86_64-linux-gnu/7/include/immintrin.h:35:0,
                 from ./avxdefs.h:19,
                 from algo/luffa/sse2/luffa_for_sse2.c:23:
/usr/lib/gcc/x86_64-linux-gnu/7/include/tmmintrin.h:136:1: error: inlining failed in call to always_inline ‘_mm_shuffle_epi8’: target specific option mismatch
 _mm_shuffle_epi8 (__m128i __X, __m128i __Y)
 ^~~~~~~~~~~~~~~~
In file included from algo/luffa/sse2/luffa_for_sse2.c:23:0:
./avxdefs.h:303:10: note: called from here
   return _mm_shuffle_epi8( x, _mm_set_epi8(
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                            0x0c, 0x0d, 0x0e, 0x0f, 0x08, 0x09, 0x0a, 0x0b,
                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                            0x04, 0x05, 0x06, 0x07, 0x00, 0x01, 0x02, 0x03 ) );
                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Makefile:3200: recipe for target 'algo/luffa/sse2/cpuminer-luffa_for_sse2.o' failed

gcc (Debian 7.2.0-19) 7.2.0 g++ (Debian 7.2.0-19) 7.2.0

Any idea how to fix this?

Freccia commented 6 years ago

Actually I've managed to compile adding -msse3 -msse4.1 to the Makefile, but I don't know why should this work and if it may cause any trouble? I also had to add -lcurl to the Makefile (cpuminer_LDADD)

Oh and I'm compiling the last release, 3.7.10

JayDDee commented 6 years ago

Does the previous release work? Also please provide your CPU info.

Freccia commented 6 years ago

I tried to compile older commits (older 710c852f05d220601) but I've got the same errors. I'm using an x86_64 (amd).

JayDDee commented 6 years ago

I asked for CPU info, all you gave me was amd. Cpuminer is very sensitive to CPU architecture, it should be obvious, yet you didn't provide that info. The bottom line is it's your CPU. Refer to the tips about AMD in RELEAESE_NOTES.

If you can get it working (use 3.7.9 until new 3.7.11 is released) and can provide detailed info to help other users of old AMD CPUs it would be welcome. However, you should not have to edit the Makefile. That could be a different issue.

The intrinsic function in the error you posted is part os SSS3e according to https://software.intel.com/sites/landingpage/IntrinsicsGuide/

If you do pursue this please provide details. I hate having to ask.

Freccia commented 6 years ago

Sorry about that, here's the cpu infos:

# cat /proc/cpuinfo
...
processor   : 15
vendor_id   : AuthenticAMD
cpu family  : 23
model       : 1
model name  : AMD Ryzen 7 1800X Eight-Core Processor
stepping    : 1
microcode   : 0x8001126
cpu MHz     : 1891.276
cache size  : 512 KB
physical id : 0
siblings    : 16
core id     : 7
cpu cores   : 8
apicid      : 15
initial apicid  : 15
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb hw_pstate sme vmmcall fsgsbase bmi1 avx2 smep bmi2 rdseed adx smap clflushopt sha_ni xsaveopt xsavec xgetbv1 xsaves clzero irperf xsaveerptr arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif overflow_recov succor smca
bugs        : sysret_ss_attrs null_seg
bogomips    : 7185.99
TLB size    : 2560 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 43 bits physical, 48 bits virtual
power management: ts ttp tm hwpstate eff_freq_ro [13] [14]

Finally I managed to compile correctly as it's written on the RELEASE_NOTE, I didn't see the file so I compiled in the standard way (./autogen ; ./configure; make) and it didn't work. I managed to compile correctly with:

./autogen
CFLAGS="-O3 -march=native -DUSE_SPH_SHA -DFOUR_WAY  -Wall" CXXFLAGS="$CFLAGS -std=gnu++11" ./configure --with-curl
make -j8

Actually the hashrate has literally doubled. Thanks JayDDee, you're the man!

qanon1111 commented 6 years ago

In file included from /usr/lib/gcc/x86_64-linux-gnu/7/include/immintrin.h:35:0, from ./avxdefs.h:42, from algo/luffa/luffa_for_sse2.c:23: ./avxdefs.h: In function ‘mm_bswap_32’: /usr/lib/gcc/x86_64-linux-gnu/7/include/tmmintrin.h:136:1: error: inlining failed in call to always_inline ‘_mm_shuffle_epi8’: target specific option mismatch _mm_shuffle_epi8 (m128i X, m128i Y) ^~~~ In file included from algo/luffa/luffa_for_sse2.c:23:0: ./avxdefs.h:538:11: note: called from here { return _mm_shuffle_epi8( v, _mm_set_epi8( ^~~~~~~~~~ 0x0c, 0x0d, 0x0e, 0x0f, 0x08, 0x09, 0x0a, 0x0b,

                            0x04, 0x05, 0x06, 0x07, 0x00, 0x01, 0x02, 0x03 ) );

In file included from /usr/lib/gcc/x86_64-linux-gnu/7/include/immintrin.h:35:0, from ./avxdefs.h:42, from algo/luffa/luffa_for_sse2.c:23: /usr/lib/gcc/x86_64-linux-gnu/7/include/tmmintrin.h:136:1: error: inlining failed in call to always_inline ‘_mm_shuffle_epi8’: target specific option mismatch _mm_shuffle_epi8 (m128i X, m128i Y) ^~~~ In file included from algo/luffa/luffa_for_sse2.c:23:0: ./avxdefs.h:538:11: note: called from here { return _mm_shuffle_epi8( v, _mm_set_epi8( ^~~~~~~~~~ 0x0c, 0x0d, 0x0e, 0x0f, 0x08, 0x09, 0x0a, 0x0b,

                            0x04, 0x05, 0x06, 0x07, 0x00, 0x01, 0x02, 0x03 ) );

Makefile:3670: recipe for target 'algo/luffa/cpuminer-luffa_for_sse2.o' failed make[2]: [algo/luffa/cpuminer-luffa_for_sse2.o] Error 1 make[2]: Waiting for unfinished jobs.... mv -f algo/luffa/.deps/cpuminer-luffa-hash-2way.Tpo algo/luffa/.deps/cpuminer-luffa-hash-2way.Po mv -f algo/luffa/.deps/cpuminer-sph_luffa.Tpo algo/luffa/.deps/cpuminer-sph_luffa.Po mv -f algo/haval/.deps/cpuminer-haval.Tpo algo/haval/.deps/cpuminer-haval.Po make[2]: Leaving directory '/usr/src/cpuminer-opt-master' Makefile:5723: recipe for target 'all-recursive' failed make[1]: [all-recursive] Error 1 make[1]: Leaving directory '/usr/src/cpuminer-opt-master' Makefile:1111: recipe for target 'all' failed make: [all] Error 2 strip: 'cpuminer': No such file

qanon1111 commented 6 years ago

HELP

qanon1111 commented 6 years ago

n file included from /usr/lib/gcc/x86_64-linux-gnu/7/include/immintrin.h:35:0, from ./avxdefs.h:42, from algo/luffa/luffa_for_sse2.c:23: ./avxdefs.h: In function ‘mm_bswap_32’: /usr/lib/gcc/x86_64-linux-gnu/7/include/tmmintrin.h:136:1: error: inlining failed in call to always_inline ‘_mm_shuffle_epi8’: target specific option mismatch _mm_shuffle_epi8 (m128i X, m128i Y) ^~~~ In file included from algo/luffa/luffa_for_sse2.c:23:0: ./avxdefs.h:538:11: note: called from here { return _mm_shuffle_epi8( v, _mm_set_epi8( ^~~~~~~~~~ 0x0c, 0x0d, 0x0e, 0x0f, 0x08, 0x09, 0x0a, 0x0b,

                            0x04, 0x05, 0x06, 0x07, 0x00, 0x01, 0x02, 0x03 ) );

In file included from /usr/lib/gcc/x86_64-linux-gnu/7/include/immintrin.h:35:0, from ./avxdefs.h:42, from algo/luffa/luffa_for_sse2.c:23: /usr/lib/gcc/x86_64-linux-gnu/7/include/tmmintrin.h:136:1: error: inlining failed in call to always_inline ‘_mm_shuffle_epi8’: target specific option mismatch _mm_shuffle_epi8 (m128i X, m128i Y) ^~~~ In file included from algo/luffa/luffa_for_sse2.c:23:0: ./avxdefs.h:538:11: note: called from here { return _mm_shuffle_epi8( v, _mm_set_epi8( ^~~~~~~~~~ 0x0c, 0x0d, 0x0e, 0x0f, 0x08, 0x09, 0x0a, 0x0b,

                            0x04, 0x05, 0x06, 0x07, 0x00, 0x01, 0x02, 0x03 ) );

gcc -DHAVE_CONFIG_H -I. -Iyes/include -fno-strict-aliasing -I./compat/jansson -I. -Iyes/include -Wno-pointer-sign -Wno-pointer-to-int-cast -O3 -march=native -Wall -Iyes/include -MT algo/luffa/cpuminer-luffa-hash-2way.o -MD -MP -MF algo/luffa/.deps/cpuminer-luffa-hash-2way.Tpo -c -o algo/luffa/cpuminer-luffa-hash-2way.o test -f 'algo/luffa/luffa-hash-2way.c' || echo './'algo/luffa/luffa-hash-2way.c Makefile:3670: recipe for target 'algo/luffa/cpuminer-luffa_for_sse2.o' failed make[2]: [algo/luffa/cpuminer-luffa_for_sse2.o] Error 1 make[2]: Waiting for unfinished jobs.... mv -f algo/luffa/.deps/cpuminer-sph_luffa.Tpo algo/luffa/.deps/cpuminer-sph_luffa.Po mv -f algo/luffa/.deps/cpuminer-luffa-hash-2way.Tpo algo/luffa/.deps/cpuminer-luffa-hash-2way.Po mv -f algo/haval/.deps/cpuminer-haval.Tpo algo/haval/.deps/cpuminer-haval.Po make[2]: Leaving directory '/usr/src/cpuminer-opt-master' Makefile:5723: recipe for target 'all-recursive' failed make[1]: [all-recursive] Error 1 make[1]: Leaving directory '/usr/src/cpuminer-opt-master' Makefile:1111: recipe for target 'all' failed make: [all] Error 2 strip: 'cpuminer': No such file

qanon1111 commented 6 years ago

image