question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ImportError: /usr/lib/x86_64-linux-gnu/libcuda.so.1: file too short

See original GitHub issue

I use Docker to run this project, but meet some problems.

The progress is below:

docker image build -t ppdemo . docker run --name my_mongo -p 27017:27017 -d mongo docker run -t --link my_mongo:mongo -v $PWD:/app/Personae ppdemo spider/stock_spider.py

It is fine now. But some errors happened when python import tensorflow.

$ docker run -t --link my_mongo:mongo -v $PWD:/app/Personae ppdemo algorithm/SL/DualAttnRNN.py
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "/usr/lib/python3.5/imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "/usr/lib/python3.5/imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: /usr/lib/x86_64-linux-gnu/libcuda.so.1: file too short

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "algorithm/SL/DualAttnRNN.py", line 3, in <module>
    import tensorflow as tf
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import *
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 72, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "/usr/lib/python3.5/imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "/usr/lib/python3.5/imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: /usr/lib/x86_64-linux-gnu/libcuda.so.1: file too short


Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/install_sources#common_installation_problems

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.

I am a noob in using docker. May you tell me what’s wrong with the progress?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
Yanggetcommented, Mar 8, 2019

nvidia-docker run -dit -p 8888:8888 -p 6006:6006 tensorflow/newbuild:2.0 /bin/bash like me .you should use nvidia-docker to run

3reactions
wangzhangupcommented, Jun 24, 2018

@JS00000 You should use Nvidia-docker2.

Read more comments on GitHub >

github_iconTop Results From Across the Web

usr/lib/x86_64-linux-gnu/libcuda.so.1: file too short
I am trying to convert my training dataset from KITTI to TFRecords using the tlt-dataset-convert tool and I am getting the following error:...
Read more >
ImportError: libcuda.so.1: cannot open shared object file
A typical scenario would be for /etc/ld.so.conf to add, say, /usr/lib/x86_64-linux-gnu ; and for libcuda.so.* to be there.
Read more >
usr/lib/x86_64-linux-gnu/libcuda.so.1: file too short
/usr/lib/x86_64-linux-gnu/libcuda.so.1: file too short ... ImportError: /usr/local/cuda-8.0/lib64/libcudnn.so.5: file too short.
Read more >
[SOLVED] Having trouble finding libcuda.so.1 file despite ...
I'm using ubuntu 16.04 and using Python 3.6 /Python 2.7 This is the exact error: ImportError: libcuda.so.1: cannot open shared object file: ...
Read more >
Failed to load the native TensorFlow runtime. ImportError
ImportError : libcuda.so.1: cannot open shared object file: No such file or ... to provide /etc/ld.so.conf.d/x86_64-linux-gnu_GL.conf ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found