Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: libcuda.so.1: cannot open shared object file: No such file or directory #32

Closed
ahbon123 opened this issue Jun 4, 2019 · 3 comments

Comments

@ahbon123
Copy link

ahbon123 commented Jun 4, 2019

I build the Docker image nima-gpu with docker build -t nima-gpu . -f Dockerfile.gpu

Sending build context to Docker daemon  188.7MB
Step 1/8 : FROM tensorflow/tensorflow:latest-gpu-py3
 ---> 20a4b7fa03e7
Step 2/8 : RUN apt-get update && apt-get install -y --no-install-recommends       bzip2       g++       git       graphviz       libgl1-mesa-glx       libhdf5-dev       openmpi-bin       wget &&     rm -rf /var/lib/apt/lists/*
 ---> Using cache
 ---> 9a8f03e4404d
Step 3/8 : COPY src /src
 ---> Using cache
 ---> 00047f6005a3
Step 4/8 : COPY entrypoints /src/entrypoints
 ---> Using cache
 ---> 8f7e8ad022b1
Step 5/8 : WORKDIR /src
 ---> Using cache
 ---> e1fef7ec3a14
Step 6/8 : RUN pip install -r requirements.txt
 ---> Using cache
 ---> 6c1371f032e4
Step 7/8 : ENV PYTHONPATH='/src/:$PYTHONPATH'
 ---> Using cache
 ---> cdde560f51de
Step 8/8 : ENTRYPOINT ["entrypoints/entrypoint.train.gpu.sh"]
 ---> Using cache
 ---> 1fe2ce0c9ad9
Successfully built 1fe2ce0c9ad9
Successfully tagged nima-gpu:latest

But when I score a demo image with nima-gpu, I get a Traceback:

./predict --docker-image nima-gpu --base-model-name MobileNet --weights-file $(pwd)/models/MobileNet/weights_mobilenet_technical_0.11.hdf5 --image-source $(pwd)/src/tests/test_images/42039.jpg

How could I make this correct? Thanks.

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: libcuda.so.1: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/src/evaluater/predict.py", line 6, in <module>
    from utils.utils import calc_mean_score, save_json
  File "/src/utils/utils.py", line 4, in <module>
    import keras
  File "/usr/local/lib/python3.5/dist-packages/keras/__init__.py", line 3, in <module>
    from . import utils
  File "/usr/local/lib/python3.5/dist-packages/keras/utils/__init__.py", line 6, in <module>
    from . import conv_utils
  File "/usr/local/lib/python3.5/dist-packages/keras/utils/conv_utils.py", line 9, in <module>
    from .. import backend as K
  File "/usr/local/lib/python3.5/dist-packages/keras/backend/__init__.py", line 84, in <module>
    from .tensorflow_backend import *
  File "/usr/local/lib/python3.5/dist-packages/keras/backend/tensorflow_backend.py", line 5, 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 pywrap_tensorflow  # pylint: disable=unused-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 74, 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: libcuda.so.1: cannot open shared object file: No such file or directory
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors
for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.```

@clennan
Copy link
Collaborator

clennan commented Jun 4, 2019

You can‘t use the predict script with GPUs. What kind of GPU do you have? Did you set up nvidia-docker??

@ahbon123
Copy link
Author

ahbon123 commented Jun 6, 2019

I have TensorBook with RTX 2080 GPU. I have done the following step, are there the other steps need to be done?

docker build -t nima-gpu . -f Dockerfile.gpu
Sending build context to Docker daemon  188.7MB
Step 1/8 : FROM tensorflow/tensorflow:latest-gpu-py3
 ---> 20a4b7fa03e7
Step 2/8 : RUN apt-get update && apt-get install -y --no-install-recommends       bzip2       g++       git       graphviz       libgl1-mesa-glx       libhdf5-dev       openmpi-bin       wget &&     rm -rf /var/lib/apt/lists/*
 ---> Using cache
 ---> 9a8f03e4404d
Step 3/8 : COPY src /src
 ---> Using cache
 ---> 00047f6005a3
Step 4/8 : COPY entrypoints /src/entrypoints
 ---> Using cache
 ---> 8f7e8ad022b1
Step 5/8 : WORKDIR /src
 ---> Using cache
 ---> e1fef7ec3a14
Step 6/8 : RUN pip install -r requirements.txt
 ---> Using cache
 ---> 6c1371f032e4
Step 7/8 : ENV PYTHONPATH='/src/:$PYTHONPATH'
 ---> Using cache
 ---> cdde560f51de
Step 8/8 : ENTRYPOINT ["entrypoints/entrypoint.train.gpu.sh"]
 ---> Using cache
 ---> 1fe2ce0c9ad9
Successfully built 1fe2ce0c9ad9
Successfully tagged nima-gpu:latest

@clennan
Copy link
Collaborator

clennan commented Jun 6, 2019

Yes, other steps are required. As I asked before - did you set up nvidia-docker yet?? This article might be helpful https://medium.com/@amaan.ngp/installation-setup-of-nvidia-geforce-rtx-2080ti-cuda-10-1-15fa6c8f8ecb

@clennan clennan closed this as completed Jul 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants