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

Import mxnet throws libcudart error on non cuda linux hosts #390

Closed
vdantu opened this issue May 12, 2018 · 3 comments
Closed

Import mxnet throws libcudart error on non cuda linux hosts #390

vdantu opened this issue May 12, 2018 · 3 comments
Assignees

Comments

@vdantu
Copy link
Contributor

vdantu commented May 12, 2018

I am seeing

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/mxnet-model-server/testenv/local/lib/python2.7/site-packages/mxnet/__init__.py", line 25, in <module>
    from . import engine
  File "/mxnet-model-server/testenv/local/lib/python2.7/site-packages/mxnet/engine.py", line 23, in <module>
    from .base import _LIB, check_call
  File "/mxnet-model-server/testenv/local/lib/python2.7/site-packages/mxnet/base.py", line 113, in <module>
    _LIB = _load_lib()
  File "/mxnet-model-server/testenv/local/lib/python2.7/site-packages/mxnet/base.py", line 105, in _load_lib
    lib = ctypes.CDLL(lib_path[0], ctypes.RTLD_LOCAL)
  File "/usr/lib/python2.7/ctypes/__init__.py", line 362, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libcudart.so.9.0: cannot open shared object file: No such file or directory

When I try to import mxnet after doing a pip install from setup.py. This happens when I try to import "mxnet" in my python module. This doens't happen with mxnet-mkl and happens with mxnet-cu90mkl package on generic linux host. We might need to change the default installation for linux.

Steps to recreate this issue on a linux machine:

1. (testenv)$ pip install mxnet-cu90mkl
2. (testenv)$ python
3.  >>> import mxnet
@vrakesh
Copy link
Contributor

vrakesh commented May 13, 2018

This issue, seems to appearing in CI as well, My recent pull request is failing in codebuild (linux base) due to the very same reason, any changes to the cu90mkl package recently??, the change was tested on many linux machines before, this seems to be something new. Will look into it

@vrakesh
Copy link
Contributor

vrakesh commented May 24, 2018

resolved in PR #394

@vrakesh vrakesh closed this as completed May 24, 2018
@nithishc829
Copy link

nithishc829 commented Mar 16, 2019

Solution :

  1. deactivate the environment
  2. edit the bashrc file like nano ~/.bashrc file & add the cuda path to environment variable LD_LIBRARY_PATH LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64:$LD_LIBRARY_PATH and save
  3. type the command source ~/.bashrc
  4. type the command sudo ldconfig to reflect the changes for library to be seen by OS
  5. done! activate the environment & run python
  6. import mxnet
    Problem solved. I spent 1 whole day find the solution...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants