'CXXABI_1.3.8' not found in tensorflow-gpu - install from source
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
The CXXABI_1.3.8 not found error occurs when TensorFlow's compiled binaries require a newer C++ ABI (Application Binary Interface) version than what your system's libstdc++ provides. CXXABI_1.3.8 is provided by GCC 4.9+ and its associated libstdc++.so.6. The fix is to upgrade your GCC/libstdc++ version, set LD_LIBRARY_PATH to a newer libstdc++, or build TensorFlow from source with your existing compiler.
The Error
This means the TensorFlow binary was compiled with a newer GCC than what your system has installed.
Diagnosing the Problem
Fix 1: Upgrade GCC and libstdc++
Fix 2: Point LD_LIBRARY_PATH to a Newer libstdc++
If you have a newer GCC installed but the system still uses the old libstdc++:
Add the export to your .bashrc or .zshrc to make it permanent.
Fix 3: Install via Conda (Bundles libstdc++)
Conda installs its own libstdc++ that includes the required CXXABI versions:
Fix 4: Build TensorFlow from Source
Build TensorFlow with your system's compiler to match the available CXXABI:
Building from source ensures TensorFlow links against your system's libstdc++ and avoids the CXXABI mismatch entirely.
Fix 5: Use Docker (Avoids System Issues)
Verifying the Fix
Common Pitfalls
- Upgrading GCC without updating libstdc++: Installing a new GCC compiler does not always install the matching
libstdc++.so.6. On CentOS/RHEL,devtoolsetinstalls the library in a non-standard path that is not onLD_LIBRARY_PATHby default. Runscl enable devtoolset-N bashor setLD_LIBRARY_PATHexplicitly. - Mixing Conda and system libraries: When using Conda with TensorFlow, the system's
libstdc++may take precedence over Conda's newer version. SetLD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATHto ensure Conda's libraries are found first. - Not cleaning previous builds: When building TensorFlow from source after a failed attempt, stale build artifacts can cause linking errors. Run
bazel clean --expungebefore rebuilding to start fresh. - Wrong CUDA/cuDNN versions: Building from source requires specific CUDA and cuDNN versions for each TensorFlow version. Check the official build compatibility table at tensorflow.org/install/source. Mismatched versions cause cryptic linker errors beyond the CXXABI issue.
- Copying libstdc++.so.6 from another system: Copying a
libstdc++.so.6binary from a different machine may not work due to glibc version mismatches. The library must be compatible with your system's glibc. Install the matchinglibstdc++package instead of copying binaries.
Summary
CXXABI_1.3.8 not foundmeans yourlibstdc++is too old for the TensorFlow binary- Upgrade GCC to 4.9+ (for
CXXABI_1.3.8) or 5.1+ (forCXXABI_1.3.9) and install the matchinglibstdc++ - Set
LD_LIBRARY_PATHto point to the newerlibstdc++.so.6if it is installed in a non-standard location - Use Conda to install TensorFlow with bundled compatible libraries
- Build TensorFlow from source to match your system's exact compiler version
- Use Docker (
tensorflow/tensorflow:latest-gpu) to avoid all system dependency issues

