Fail to build on Power8 LE

Issue #320 new
Mattia Rizzolo created an issue

The 2.2 failed to build on both Debian and Ubuntu with a quite long error.

I could reproduce the error with the current default branch.

cd /<<PKGBUILDDIR>>/x265-10bit/common && /usr/bin/c++   -DEXPORT_C_API=0 -DHAVE_ALTIVEC=1 -DHAVE_INT_TYPES_H=1 -DHAVE_LIBNUMA -DHIGH_BIT_DEPTH=1 -DPPC64=1 -DX265_ARCH_POWER8=1 -DX265_ARCH_POWER=1 -DX265_DEPTH=10 -DX265_NS=x265_10bit -D__STDC_LIMIT_MACROS=1 -I/<<PKGBUILDDIR>>/source/. -I/<<PKGBUILDDIR>>/source/common -I/<<PKGBUILDDIR>>/source/encoder -I/<<PKGBUILDDIR>>/x265-10bit  -g -O3 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2   -Wall -Wextra -Wshadow -std=gnu++98 -fPIC -Wno-array-bounds -ffast-math -fno-exceptions -maltivec -mabi=altivec -flax-vector-conversions -fpermissive -mcpu=power8 -Wno-unused  -Wno-unknown-pragmas -Wno-maybe-uninitialized -o CMakeFiles/common.dir/ppc/pixel_altivec.cpp.o -c /<<PKGBUILDDIR>>/source/common/ppc/pixel_altivec.cpp
/<<PKGBUILDDIR>>/source/common/ppc/pixel_altivec.cpp: In function ‘int x265_10bit::sad16_altivec(const pixel*, intptr_t, const pixel*, intptr_t)’:
/<<PKGBUILDDIR>>/source/common/ppc/pixel_altivec.cpp:98:46: error: invalid parameter combination for AltiVec intrinsic
         pix1v = /*vec_vsx_ld*/vec_xl( 0, pix1);
                                              ^
/<<PKGBUILDDIR>>/source/common/ppc/pixel_altivec.cpp:99:46: error: invalid parameter combination for AltiVec intrinsic
         pix2v = /*vec_vsx_ld*/vec_xl( 0, pix2);
                                              ^
/<<PKGBUILDDIR>>/source/common/ppc/pixel_altivec.cpp: In function ‘void x265_10bit::sad16_x3_altivec(const pixel*, const pixel*, const pixel*, const pixel*, intptr_t, int32_t*)’:
/<<PKGBUILDDIR>>/source/common/ppc/pixel_altivec.cpp:448:32: error: invalid parameter combination for AltiVec intrinsic
         pix1v = vec_xl( 0, pix1); //@@RM vec_vsx_ld( 0, pix1);
                                ^
/<<PKGBUILDDIR>>/source/common/ppc/pixel_altivec.cpp:449:32: error: invalid parameter combination for AltiVec intrinsic
         pix2v = vec_xl( 0, pix2); //@@RM vec_vsx_ld( 0, pix2);
                                ^

is how the error starts.

Comments (17)

  1. Pradeep Ramachandran Account Deactivated

    What version of ubuntu and what ppc processor are you using? I am able to build it on a POWER8E chip running ubuntu 16.04. And I am assuming that you are using our cmake flow for compilation from inside the linux folder?

  2. Mattia Rizzolo reporter

    The version is the current development one (zesty/17.04). The processor is what under ubuntu (and debian) is known as ppc64el. The failure is very much the same on both ubuntu and debian, so it shouldn't matter the difference, also because the depending libraries are pretty much the same. FTR, I only have access to a Debian ppc64el system.

    The linked build logs are what is done by the debian packaging (which does pretty much the same, it's not like that 'make-Makefiles.bash' does magic ;)), but I could reproduce using a very fresh mercurial checkout, running the very same commands mentioned in the wiki.

  3. Mattia Rizzolo reporter

    If you want more details of the processor of the system where I reproduced it, the first entry in /proc/cpuinfo is

    processor       : 0
    cpu             : POWER8E (raw), altivec supported
    clock           : 3425.000000MHz
    revision        : 2.1 (pvr 004b 0201)
    
  4. Pradeep Ramachandran Account Deactivated

    I don't have access to a ppc machine running zesty to debug this. How is the ppc intrinsic support in general on zesty? It would also be good to check the version of gcc that you are using, and to see if has good support for ppc intrinsics.

  5. Roger Moussalli

    Hi,

    Looks like a bug was introduced in GCC 6 where vec_xl was redefined incorrectly. Back in GCC 5, vec_xl was simply a synonym for __builtin_vec_vsx_ld (see altivec.h):

    #define vec_xl __builtin_vec_vsx_ld
    

    For now, if vec_xl breaks compilation, one workaround is replacing the calls to vec_xl with calls to vec_vsx_ld. I notified the folks at IBM in charge of this. The bug should be addressed in upcoming GCC releases.

  6. Pradeep Ramachandran Account Deactivated

    But that would disable all assembly optimizations which buys quite a bit of performance today. Maybe trying what Roger suggests would be @sramxtr suggests would be more prudent?

  7. Mattia Rizzolo reporter

    Redefining vec_xl makes it go ahead and brings to the next error

    /home/mattia/x265/x265/source/common/ppc/dct_altivec.cpp: In function 'uint32_t quant_altivec(const int16_t*, const int32_t*, int32_t*, int16_t*, int, int, int)':
    /home/mattia/x265/x265/source/common/ppc/dct_altivec.cpp:176:48: error: invalid parameter combination for AltiVec intrinsic
             vec_xst(v_level_ss, 0, &qCoef[blockpos]) ;
                                                    ^
    

    @sramxtr if we can get this fixed in gcc7 I might be able to just ask our toolchain maintainer to backport the fix, which would probably be better anyway. Is there a bug open in GCC's bugzilla?

  8. Mattia Rizzolo reporter

    Thank you for the pointer! Using what's is in Debian as gcc-6 version 6.3.0-6 which claims to be a checkout of gcc-6 branch at r245197 (thus including that change) I can successfully build the trunk branch. Though the released 2.2 still fails with

    /home/mattia/x265/x265-2.2/source/common/ppc/pixel_altivec.cpp: In function 'void x265_10bit::setupPixelPrimitives_altivec(x265_10bit::EncoderPrimitives&)':
    /home/mattia/x265/x265-2.2/source/common/ppc/pixel_altivec.cpp:4199:42: error: no matches converting function 'sad16_altivec' to type 'x265_10bit::pixelcmp_t {aka int (*)(const short unsigned int*, long int, const short unsigned int*, long int)}'
             p.pu[LUMA_ ## W ## x ## H].sad = sad16_altivec<W, H>; \
                                              ^~~~~~~~~~~~~~~~~~~
    

    and

    /home/mattia/x265/x265-2.2/source/common/ppc/intrapred_altivec.cpp:825:42: error: invalid parameter combination for AltiVec intrinsic
         vec_xst(vout_11, dstStride*21+16, dst);
                                              ^
    

    and others similar to those.

  9. Mattia Rizzolo reporter

    Right, indeed building with -DHIGH_BIT_DEPTH=ON (with and without -DMAIN12=ON) makes it fail (I'm sorry, I didn't notice the build I was doing of 2.2 before uses -DHIGH_BIT_DEPTH=ON - it builds building with a bit-depth of 8 indeed).

  10. Pradeep Ramachandran Account Deactivated

    @mapreri - do you still see this issue with building off the latest trunk, or can I close this?

  11. Mattia Rizzolo reporter

    Yes, it still doesn't build. I also tried with gcc-7 this time, and still fails to build that way.

  12. Log in to comment