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 failed #2

Closed
zhang-bo-lilly opened this issue Feb 7, 2025 · 0 comments
Closed

Import failed #2

zhang-bo-lilly opened this issue Feb 7, 2025 · 0 comments

Comments

@zhang-bo-lilly
Copy link

Hi @lucaspar , thanks for compiling the tutorial. I tried it on my machine but ran into some errors. Wonder if you have any suggestions.

$ poetry install -E cuda --with cuda
Creating virtualenv poetry-torch--qGkISV7-py3.9 in /home/c271831/.cache/pypoetry/virtualenvs
Updating dependencies
Resolving dependencies... (4.8s)

Package operations: 26 installs, 0 updates, 0 removals

  - Installing nvidia-nvjitlink-cu12 (12.8.61)
  - Installing filelock (3.17.0)
  - Installing markupsafe (3.0.2)
  - Installing mpmath (1.3.0)
  - Installing nvidia-cublas-cu12 (12.1.3.1): Downloading... 50%
  - Installing nvidia-cusparse-cu12 (12.1.0.106): Installing...
  - Installing nvidia-cublas-cu12 (12.1.3.1): Installing...
  - Installing nvidia-cusparse-cu12 (12.1.0.106)
  - Installing nvidia-cublas-cu12 (12.1.3.1)
  - Installing nvidia-cusparse-cu12 (12.1.0.106)
  - Installing fsspec (2025.2.0)
  - Installing jinja2 (3.1.5)
  - Installing networkx (3.2.1): Installing...
  - Installing nvidia-cuda-cupti-cu12 (12.1.105): Downloading... 0%
  - Installing nvidia-cuda-nvrtc-cu12 (12.1.105): Pending...
  - Installing nvidia-cuda-cupti-cu12 (12.1.105): Downloading... 10%
  - Installing networkx (3.2.1)
  - Installing nvidia-cuda-cupti-cu12 (12.1.105): Installing...
  - Installing nvidia-cuda-nvrtc-cu12 (12.1.105): Downloading... 60%
  - Installing nvidia-cuda-cupti-cu12 (12.1.105)
  - Installing nvidia-cuda-nvrtc-cu12 (12.1.105): Downloading... 90%
  - Installing nvidia-cuda-runtime-cu12 (12.1.105)
  - Installing nvidia-cuda-nvrtc-cu12 (12.1.105): Installing...
  - Installing nvidia-cuda-runtime-cu12 (12.1.105)
  - Installing nvidia-cuda-nvrtc-cu12 (12.1.105)
  - Installing nvidia-cuda-runtime-cu12 (12.1.105)
  - Installing nvidia-cudnn-cu12 (8.9.2.26): Downloading... 8%
  - Installing nvidia-cufft-cu12 (11.0.2.54): Downloading... 50%
  - Installing nvidia-cudnn-cu12 (8.9.2.26): Downloading... 16%
  - Installing nvidia-cufft-cu12 (11.0.2.54): Installing...
  - Installing nvidia-curand-cu12 (10.3.2.106)
  - Installing nvidia-cusolver-cu12 (11.4.5.107): Downloading... 100%
  - Installing nvidia-cudnn-cu12 (8.9.2.26): Installing...
  - Installing nvidia-cufft-cu12 (11.0.2.54)
  - Installing nvidia-cudnn-cu12 (8.9.2.26)
  - Installing nvidia-cufft-cu12 (11.0.2.54)
  - Installing nvidia-curand-cu12 (10.3.2.106)
  - Installing nvidia-cusolver-cu12 (11.4.5.107)
  - Installing nvidia-nccl-cu12 (2.20.5)
  - Installing nvidia-nvtx-cu12 (12.1.105)
  - Installing sympy (1.13.3)
  - Installing triton (2.3.1)
  - Installing typing-extensions (4.12.2)
  - Installing numpy (1.26.4)
  - Installing pillow (11.1.0)
  - Installing torch (2.3.1+cu121)
  - Installing loguru (0.7.3)
  - Installing torchvision (0.18.1+cu121)

Writing lock file

However, PyTorch cannot be imported

$ poetry run python check-cuda.py
2025-02-07 15:50:53.745 | ERROR    | __main__:<module>:11 - torch could not be imported, exiting.
2025-02-07 15:50:53.745 | ERROR    | __main__:<module>:12 - libcudnn.so.8: cannot open shared object file: No such file or directory
2025-02-07 15:50:53.745 | INFO     | __main__:<module>:13 - Installed packages matching 'torch':

...

Some additional information is as follows

(poetry-torch-py3.9) $ python
Python 3.9.19 (main, Sep 11 2024, 00:00:00) 
[GCC 11.5.0 20240719 (Red Hat 11.5.0-2)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/xxxxxx/.cache/pypoetry/virtualenvs/poetry-torch--qGkISV7-py3.9/lib64/python3.9/site-packages/torch/__init__.py", line 239, in <module>
    from torch._C import *  # noqa: F403
ImportError: libcudnn.so.8: cannot open shared object file: No such file or directory
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

1 participant