'CXXABI_1.3.8' not found in tensorflow-gpu - install from source
ML System Design practice on Codemia
Design recommenders, ranking systems and training pipelines the way ML interviews actually ask for them, with worked solutions.
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
Related reading
- Darknet YOLO image size
- Data Augmentation in PyTorch
- Dataset gets re-copied to GPU causing out of memory when calling to eval twice
- Dead simple example of synaptic js lstm rnn algorithm
- Data stored in MLMD in TensorFlow TFX
- DataType float32 for attr ''T'' not in list of allowed values int32, int64
- Cycle inside ; building could produce unreliable results Xcode Error
- Cygwin/Git error cygheap base mismatch detected
.png&w=3840&q=75)
Tackling System Design Interview Problems
A short course that equips you with the skills to approach system design interviews methodically.
Start the free courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
ML System Design practice on Codemia
Design recommenders, ranking systems and training pipelines the way ML interviews actually ask for them, with worked solutions.