Debugging the TensorFlow / Cuda error on AWS — ImportError: cannot open shared object file

Nikita sharma
2 min readJun 14, 2020
Photo by Romson Preechawit on Unsplash

Cause of error

This error is caused because mismatch in versions of tensorflow-gpu and CUDA. Every tensorflow-gpu lib is dependent on a very specific CUDA version.

Check our versions

Check tensorflow-gpu version :

pip list | grep tensorflow-gpu

Our tensorflow-gpu version is 1.8.0.

Check CUDA version:

ls -l /usr/local/cuda

Our cuda version is cuda-8.0.

Investigate issue

What are the compatible cuda versions for tensorflow :

Let’s refer to official TensorFlow page for the version compatibility.

So required dependencies for our tensorflow-gpu versions are:

So we have 2 options:

  1. Downgrade tensorflow-gpu to version 1.4.0 to match our system cuda version cuda-8.0
  2. Upgrade system cuda version to cuda-9.0 to match our…