Skip to content

libstdc++.so.6: version `CXXABI_1.3.8' not found #15777

Closed

Description

@yaroslavvb

All of my tf-nightly Travis CI pipelines started failing today with following error

ImportError: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /home/travis/virtualenv/python3.5.4/lib/python3.5/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so)

Example:
https://travis-ci.org/yaroslavvb/chain_constant_memory/builds/323851093

Any ideas how to fix?

Activity

  1. yaroslavvb commented on Jan 1, 2018

    @yaroslavvb
    ContributorAuthor

    PS, happy new year!

  2. yaroslavvb commented on Jan 2, 2018

    @yaroslavvb
    ContributorAuthor

    Give that this broke this morning, I suspect this breakage is due to build infrastructure change that was checked in yesterday, perhaps this one -- 4036422

    cc @gunan

  3. alsrgv commented on Jan 2, 2018

    @alsrgv
    Contributor

    I have a similar issue with Travis CI starting tonight:

    ImportError: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.20' not found
    (required by /home/travis/virtualenv/python2.7.14/lib/python2.7/site-
    packages/tensorflow/python/_pywrap_tensorflow_internal.so)
    
  4. alsrgv commented on Jan 2, 2018

    @alsrgv
    Contributor

    Similarly, in Debian Jessie:

    ImportError: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.21' not found
    (required by /usr/local/lib/python2.7/dist-packages/tensorflow/python/_pywrap_tensorflow_internal.so)
    
  5. ppwwyyxx commented on Jan 2, 2018

    @ppwwyyxx
    Contributor

    Debian jessie is only gcc 4.9 (https://packages.debian.org/jessie/devel/gcc), so still not new enough. The build infra was switched to 16.04 in the new year which uses gcc 5.3 by default (https://packages.ubuntu.com/xenial/gcc). According to the symbol versioning (https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html) you'll need at least gcc 5.1 runtime to run it.

  6. gunan commented on Jan 2, 2018

    @gunan
    Contributor

    Happy new year!
    The issue is potentially a side effect of us moving our build machines up to ubuntu 16.
    https://github.com/tensorflow/tensorflow/blob/r1.5/RELEASE.md

    We made this decision because cuda 9 docker images using ubuntu 14 were not available, and we elected to keep all builds on the same base system image.

    @jhseu @martinwicke FYI

  7. alsrgv commented on Jan 2, 2018

    @alsrgv
    Contributor

    @yaroslavvb, Travis CI don't have plans to support Ubuntu 16 (travis-ci/travis-ci#5821), so it seems that our only recourse is to dockerize the tests (https://docs.travis-ci.com/user/docker/, e.g. horovod/horovod#136).

  8. martinwicke commented on Jan 2, 2018

    @martinwicke
    Member

    The last comment on that Travis issue is over a year old... I guess that means they want you to move to docker for real. You're of course welcome to use our CI docker images.

    As @gunan noted, we cannot stay with old Ubuntu since CUDA won't let us.

  9. jart commented on Jan 4, 2018

    @jart
    Contributor

    Ubuntu 14 LTE doesn't become EOL until April 2019. Are we planning to move it out of our support matrix? (See go/tf-issues-triage) What about CentOS 7, which has gcc 4.8.5? What are the benefits of this new ABI?

    If changing our support matrix is the consensus here, I'd suggest we go a step further and compile prebuilt binaries with SSE4 (maybe AVX2, possibly even AVX512) since that makes TensorFlow CPU 4x faster.

    Otherwise, maybe it's possible to use _GLIBCXX_USE_CXX11_ABI to support the old ABI? According to this page, the new ABI is mostly meant to resolve the concerns of the C++ standards committee.

  10. jart commented on Jan 4, 2018

    @jart
    Contributor

    To further clarify, I agree with the points @martinwicke and @gunan made about CUDA being responsible for how much Ubuntu 14.04 support we can offer. I'm just hoping that doesn't rule out the possibility of TensorFlow CPU continuing to support Ubuntu 14.04.

  11. soumith commented on Jan 4, 2018

    @soumith

    fwiw while nvidia doesn't provide cuda9 docker images for 14.04, it's pretty simple to install cuda9 on a base ubuntu 14.04 image (or even take the cuda8 image and install cuda9 on it).
    All you have to do is install via the cuda9 .run file and skip the driver install.

  12. gunan commented on Jan 4, 2018

    @gunan
    Contributor

    Technically, you are right that it is an easy task to build such images.
    But we are mostly constrained by what is officially available, as there are more than just technical side to consider.

  13. yaroslavvb commented on Jan 5, 2018

    @yaroslavvb
    ContributorAuthor

    IMHO it's too early to drop support for Ubuntu 14.04 and Docker still needs time to mature (ie, 3 months ago you couldn't use GPUs properly with docker)

  14. 11 remaining items

  15. jhseu commented on Jan 17, 2018

    @jhseu
    Contributor

    @angersson we would still have a glibc incompatibility even if we fix libstdc++.

  16. jart commented on Jan 17, 2018

    @jart
    Contributor

    @jhseu That's likely correct. Although @angersson was right that writing a crosstool is the way to go. We'd just probably have to build it on Debian 8 in order to guarantee support for glibc 2.19 and higher. Thankfully Clang team maintains an apt repo so we can have Clang 6.0 on Debian 8. That way we can build portable binaries that support anything up to AVX-512.

    Building on Debian 8 should create binaries that work on at least the following distros:

    • Ubuntu 14+
    • CentOS 7+
    • Debian 8+
    • SuSE 13.2+
    • Mint 17.3+
    • Manjaro 0.8.11

    I sent out a PR adding such a toolchain in #16173 although we can't make any promises at this time quite yet, whether or not we'll be able to incorporate this into our release process.

  17. jart commented on Feb 6, 2018

    @jart
    Contributor

    This issue should be safe to close, now that TF 1.5 is rolled out. To recap:

    This problem wasn't easy to solve, due to challenging constraints imposed by vendors—who shall remain nameless.

    What fixed this is @av8ramit @gunan @case540 (among others) are now putting aside added time to manually build CPU releases on Ubuntu 14.04, to maintain the compatibility commitments we made to the community.

    An optional Debian 8 Clang 6.0 toolchain now also exists, but wasn't what solved this issue; however, it can provide flexibility for folks in the community needing to do compatible source builds—particularly ones that take advantage of recent instructions sets, e.g. AVX-512, on old distros with very recent hardware.

    Please note I'm not sure what the status is for tf-nightly, which might not be Ubuntu 14 compatible.

  18. jart commented on Feb 6, 2018

    @jart
    Contributor

    Oh, for posterity, here are some facts we uncovered for anyone who's interested in using Debian 8 with Clang. This could potentially be useful for other people in the industry who are interested in distributing TensorFlow.


    Debian 8 Jessie (lifetime 2015→2020) is my personal favorite. Clang team maintains an apt repo for Debian 8. The two have a surprising degree of synergy.

    Unlike the GCC 4.9.2 which comes included with Debian 8, Clang 6.0 is able to generate opcodes for more recent instruction sets, e.g. AVX-512. Those can make TF potentially 10x faster on CPUs like Skylake Xeons (c. 2015) assuming -march=native is used.

    If one's goal is compatibility, -msse3 is a safe optimization that works on nearly every x86_64 CPU in existence. For example, the optional TF Debian 8 Clang 6 Bazel CROSSTOOL should in theory create binaries that are compatible with:

    • Ubuntu 14+
    • CentOS 7+
    • Debian 8+
    • SuSE 13.2+
    • Mint 17.3+
    • Manjaro 0.8.11

    Proof:

    jart@tomservo:/tmp/pip$ find . -name \*.so | xargs ldd -v | grep -Po '(?:GCC|GLIBC|CXXABI)_[.\d]+' | sort -n | sort -u
    CXXABI_1.3.7 (GCC 4.8.3)
    GCC_4.2.0
    GLIBC_2.18
    jart@tomservo:/tmp/pip$ ldd tensorflow-1.5.0rc0.data/purelib/tensorflow/libtensorflow_framework.so 
            linux-vdso.so.1 (0x00007ffe70f80000)
            libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f4487259000)
            libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f4486f58000)
            libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f4486d3b000)
            libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f4486a30000)
            libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f4486685000)
            /lib64/ld-linux-x86-64.so.2 (0x00007f448801b000)
            libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f448646f000)
    

    Some facts we uncovered about Linux distributions:

    # Linux distro versions
    2014 CentOS 5.11 (EOL 2019-08)    gcc4.1 libc2.5 libc++4.1.2 sqlite3.3.6
    2015 Wheezy 7.0 (EOL 2018-05)     gcc4.7 libc2.13 libc++4.7.2 sqlite3.7.13
    2014 CentOS 7 (EOL 2019-08)       gcc4.8 libc2.17 libc++4.8.5 sqlite3.7.17
    2014 Trusty 14.04 (EOL 2019-04)   gcc4.8 libc2.19 libc++4.8.4 sqlite3.8.2
    2015 Jessie 8.0 (EOL 2020-05)     gcc4.9 libc2.19 libc++4.8.4 sqlite3.8.7
    2016 Xenial 16.04 (EOL 2021-04)   gcc5.3 libc2.23 libc++5.4.0 sqlite3.11.0
    
    # C++ ABIs
    CXXABI_1.3.7 <-- max on ubuntu 14?
    CXXABI_1.3.8 <-- where the C++11 ABI break happened for GCC 5.x
    strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep LIBCXX
    

    Some facts we uncovered about x86 CPUs (w.r.t. scientific computing):

    # Noteworthy CPU Features
    SSE      128-bit vector instructions (e.g. addps http://www.felixcloutier.com/x86/ADDPS.html)
    SSE4.1   Makes SSE good
    SSE4.2   Makes SSE do strings and CRC32
    AVX      Makes SSE 256-bit (e.g. vaddps)
    AVX2     Adds features to AVX
    AVX-512  Makes SSE 512-bit
    SHA      Makes SSE do SHA1 and SHA256
    FMA      Fused multiply–add
    CLMUL    Carry-less multiplication https://goo.gl/ritKJX
    TSX      Transactional memory instructions for threads http://www.intel.com/software/tsx
    
    # Intel CPU Line
    2003 P6 M           SSE SSE2
    2004 prescott       SSE3 SSSE3 (-march=prescott)
    2006 core           X64 SSE4.1 (only on 45nm variety) (-march=core2)
    2008 nehalem        SSE4.2 VT-x VT-d (-march=nehalem)
    2010 westmere       CLMUL AES (-march=westmere)
    2012 sandybridge    AVX TXT (-march=sandybridge)
    2012 ivybridge      F16C MOVBE (-march=ivybridge)
    2013 haswell        AVX2 TSX BMI2 FMA (-march=haswell)
    2014 broadwell      RDSEED ADCX PREFETCHW (-march=broadwell - works on trusty gcc4.9)
    2015 skylake        SGX ADX MPX AVX-512[xeon-only] (-march=skylake / -march=skylake-avx512 - needs gcc7)
    2018 cannonlake     AVX-512 SHA (-march=cannonlake - needs clang5)
    
    # Intel Low Power CPU Line
    2013 silvermont     SSE4.1 SSE4.2 VT-x (-march=silvermont)
    2016 goldmont       SHA (-march=goldmont - needs clang5)
    
    # AMD CPU Line
    2003 k8             SSE SSE2 (-march=k8)
    2005 k8 (Venus)     SSE3 (-march=k8-sse3)
    2008 barcelona      SSE4a?! (-march=barcelona)
    2011 bulldozer      SSE4.1 SSE4.2 CLMUL AVX AES FMA4?! (-march=bdver1)
    2011 piledriver     FMA (-march=bdver2)
    2015 excavator      AVX2 BMI2 MOVBE (-march=bdver4)
    
    # Google Compute Engine Supported CPUs
    # https://cloud.google.com/compute/docs/cpu-platforms
    2012 sandybridge 2.6gHz -march=sandybridge
    2012 ivybridge   2.5gHz -march=ivybridge
    2013 haswell     2.3gHz -march=haswell
    2014 broadwell   2.2gHz -march=broadwell
    2015 skylake     2.0gHz -march=skylake-avx512
    

    One possibility Debian/Ubuntu distributors could explore is:

    # We might be able to say something like this in /etc/apt/sources.list
    # so folks can get a package for their specific microarchitecture.
    deb [arch=skylake] https://apt.tensorflow.org/ stretch stable
    

    Please note -msse3 or -march=native is not a binary dilemma. It's possible to use a single Debian 8 machine to cross-compile to -march=whatever.

    There also appear to be sweet-spot combinations where you can build binaries that support large subsets in-between. For example, the following optimized CFLAGS have been carefully selected to represent the points in time where Intel and AMD microarchitectures came into alignment.

    oldcpu: Nearly all x86_64 microarchitectures
      $ intersect <(march-copts core2) <(march-copts k8-sse3)
      -msse3
    default: x86_64 + SSE4
      $ intersect <(march-copts nehalem) <(march-copts bdver1)
      -mcx16
      -mpopcnt
      -msahf
      -msse3
      -msse4
      -msse4.1
      -msse4.2
      -mssse3
    avx: x86_64 + AVX
      $ intersect <(march-copts sandybridge) <(march-copts bdver1)
      -maes
      -mavx
      -mavx256-split-unaligned-store
      -mcx16
      -mpclmul
      -mpopcnt
      -msahf
      -msse3
      -msse4
      -msse4.1
      -msse4.2
      -mssse3
      -mxsave
    avx2: x86_64 + AVX2
      $ intersect <(march-copts haswell) <(march-copts bdver4)
      -maes
      -mavx
      -mavx2
      -mbmi
      -mbmi2
      -mcx16
      -mf16c
      -mfma
      -mfsgsbase
      -mlzcnt
      -mmovbe
      -mpclmul
      -mpopcnt
      -mrdrnd
      -msahf
      -msse3
      -msse4
      -msse4.1
      -msse4.2
      -mssse3
      -mxsave
      -mxsaveopt
    avx3: x86_64 + AVX-512
      $ march-copts skylake-avx512
      -madx
      -maes
      -mavx
      -mavx2
      -mavx512bw
      -mavx512cd
      -mavx512dq
      -mavx512f
      -mavx512vl
      -mbmi
      -mbmi2
      -mclflushopt
      -mcx16
      -mf16c
      -mfma
      -mfsgsbase
      -mhle
      -mlzcnt
      -mmovbe
      -mpclmul
      -mpku
      -mpopcnt
      -mprfchw
      -mrdrnd
      -mrdseed
      -msahf
      -msse3
      -msse4
      -msse4.1
      -msse4.2
      -mssse3
      -mxsave
      -mxsavec
      -mxsaveopt
      -mxsaves
    

    See also:

  19. gmantova commented on May 20, 2018

    @gmantova

    I get the same error while trying to run foxit pdf reader in ubuntu 17.10

  20. babaknaimi commented on Sep 30, 2018

    @babaknaimi

    The following solution worked for me on Centos 7:

    Upgrade gcc version to 5.x.x, and then run the followings (depending on the gcc version, you may have a different file of libstdc++.so.6.0.25):

    cp /usr/local/lib64/libstdc++.so.6.0.25 /lib64
    cd /lib64
    rm -rf libstdc++.so.6
    ln -s libstdc++.so.6.0.25 libstdc++.so.6

  21. vadamoto commented on Mar 4, 2019

    @vadamoto

    I get the same error on Centos 7

  22. sakura7621 commented on May 23, 2019

    @sakura7621

    Upgrade gcc or degrade tensorflow version.

    • For example, the latter solution:
      pip uninstall tensorflow
      conda install tensorflow==1.12.0
  23. plmsmile commented on Sep 4, 2019

    @plmsmile

    i get the same error when i conda uninstall gcc or install gcc new version.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions