-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Set proper LD_LIBRARY_PATH on Linux in nightly venv in nightly pull tool
#143262
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
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/143262
Note: Links to docs will display an error until the docs builds have been completed. ⏳ No Failures, 50 PendingAs of commit de9d701 with merge base a10b765 ( UNSTABLE - The following jobs are marked as unstable, possibly due to flakiness on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
… tool
Before this change:
```console
$ make setup-env-cuda PYTHON="${HOMEBREW_PREFIX}/bin/python3.12"
$ source venv/bin/activate
$ python3 -c 'import torch'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/PanXuehai/Projects/pytorch/torch/__init__.py", line 379, in <module>
from torch._C import * # noqa: F403
^^^^^^^^^^^^^^^^^^^^^^
ImportError: libcudnn.so.9: cannot open shared object file: No such file or directory
```
This PR add `site-packages/nvidia/**/lib` to `LD_LIBRARY_PATH` to let NVIDIA PyPI packages to be loaded correctly.
See also:
- pytorch#141837
ghstack-source-id: b4d4b78
Pull Request resolved: pytorch#143262
… tool
Before this change:
```console
$ make setup-env-cuda PYTHON="${HOMEBREW_PREFIX}/bin/python3.12"
$ source venv/bin/activate
$ python3 -c 'import torch'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/PanXuehai/Projects/pytorch/torch/__init__.py", line 379, in <module>
from torch._C import * # noqa: F403
^^^^^^^^^^^^^^^^^^^^^^
ImportError: libcudnn.so.9: cannot open shared object file: No such file or directory
```
This PR add `site-packages/nvidia/**/lib` to `LD_LIBRARY_PATH` to let NVIDIA PyPI packages to be loaded correctly.
See also:
- pytorch#141837
ghstack-source-id: ba7bdd3
Pull Request resolved: pytorch#143262
… tool
Before this change:
```console
$ make setup-env-cuda PYTHON="${HOMEBREW_PREFIX}/bin/python3.12"
$ source venv/bin/activate
$ python3 -c 'import torch'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/PanXuehai/Projects/pytorch/torch/__init__.py", line 379, in <module>
from torch._C import * # noqa: F403
^^^^^^^^^^^^^^^^^^^^^^
ImportError: libcudnn.so.9: cannot open shared object file: No such file or directory
```
This PR add `site-packages/nvidia/**/lib` to `LD_LIBRARY_PATH` to let NVIDIA PyPI packages to be loaded correctly.
See also:
- #141837
ghstack-source-id: 4a1b1ab
Pull Request resolved: #143262
… tool
Before this change:
```console
$ make setup-env-cuda PYTHON="${HOMEBREW_PREFIX}/bin/python3.12"
$ source venv/bin/activate
$ python3 -c 'import torch'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/PanXuehai/Projects/pytorch/torch/__init__.py", line 379, in <module>
from torch._C import * # noqa: F403
^^^^^^^^^^^^^^^^^^^^^^
ImportError: libcudnn.so.9: cannot open shared object file: No such file or directory
```
This PR add `site-packages/nvidia/**/lib` to `LD_LIBRARY_PATH` to let NVIDIA PyPI packages to be loaded correctly.
See also:
- pytorch#141837
ghstack-source-id: 4a1b1ab
Pull Request resolved: pytorch#143262
|
This shouldn't be needed? My understanding is that we buildin appropriate rpath into our shared libraries so they can find the nvidia packages without any LD_LIBRARY path (which the user will never have locally). |
For normal installation from PyPI, this is not needed. Because the This PR fixes the |
… tool
Before this change:
```console
$ make setup-env-cuda PYTHON="${HOMEBREW_PREFIX}/bin/python3.12"
$ source venv/bin/activate
$ python3 -c 'import torch'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/PanXuehai/Projects/pytorch/torch/__init__.py", line 379, in <module>
from torch._C import * # noqa: F403
^^^^^^^^^^^^^^^^^^^^^^
ImportError: libcudnn.so.9: cannot open shared object file: No such file or directory
```
This PR add `site-packages/nvidia/**/lib` to `LD_LIBRARY_PATH` to let NVIDIA PyPI packages to be loaded correctly.
See also:
- #141837
ghstack-source-id: a1c9d21
Pull Request resolved: #143262
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move typo fixes/refactors to the separate RP.
And changes to the environment variable proposed in this PR feels wrong to me: If I'm not mistaken, PyPI package sometimes missing header files, and this change is not updating system includes search path, is it?
I.e. you are building with one set of header, but than dynamically load other libraries
The goal of the nightly tool is to allow contributors to run and test Python code without building from source, if they want to contribute Python code only. Since the nightly installation is an in-tree git repository, all torch headers are in the local directory. The NVIDIA headers are under |
|
Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as |
… tool
Before this change:
```console
$ make setup-env-cuda PYTHON="${HOMEBREW_PREFIX}/bin/python3.12"
$ source venv/bin/activate
$ python3 -c 'import torch'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/PanXuehai/Projects/pytorch/torch/__init__.py", line 379, in <module>
from torch._C import * # noqa: F403
^^^^^^^^^^^^^^^^^^^^^^
ImportError: libcudnn.so.9: cannot open shared object file: No such file or directory
```
This PR add `site-packages/nvidia/**/lib` to `LD_LIBRARY_PATH` to let NVIDIA PyPI packages to be loaded correctly.
See also:
- #141837
ghstack-source-id: 79e38fd
Pull Request resolved: #143262
… tool
Before this change:
```console
$ make setup-env-cuda PYTHON="${HOMEBREW_PREFIX}/bin/python3.12"
$ source venv/bin/activate
$ python3 -c 'import torch'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/PanXuehai/Projects/pytorch/torch/__init__.py", line 379, in <module>
from torch._C import * # noqa: F403
^^^^^^^^^^^^^^^^^^^^^^
ImportError: libcudnn.so.9: cannot open shared object file: No such file or directory
```
This PR add `site-packages/nvidia/**/lib` to `LD_LIBRARY_PATH` to let NVIDIA PyPI packages to be loaded correctly.
See also:
- #141837
ghstack-source-id: 424d923
Pull Request resolved: #143262
… tool
Before this change:
```console
$ make setup-env-cuda PYTHON="${HOMEBREW_PREFIX}/bin/python3.12"
$ source venv/bin/activate
$ python3 -c 'import torch'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/PanXuehai/Projects/pytorch/torch/__init__.py", line 379, in <module>
from torch._C import * # noqa: F403
^^^^^^^^^^^^^^^^^^^^^^
ImportError: libcudnn.so.9: cannot open shared object file: No such file or directory
```
This PR add `site-packages/nvidia/**/lib` to `LD_LIBRARY_PATH` to let NVIDIA PyPI packages to be loaded correctly.
See also:
- #141837
ghstack-source-id: e25e05f
Pull Request resolved: #143262
malfet
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, if lint is green...
|
@pytorchbot merge -f "Lint + MPS are green" |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
… tool (pytorch#143262) Before this change: ```console $ make setup-env-cuda PYTHON="${HOMEBREW_PREFIX}/bin/python3.12" $ source venv/bin/activate $ python3 -c 'import torch' Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/PanXuehai/Projects/pytorch/torch/__init__.py", line 379, in <module> from torch._C import * # noqa: F403 ^^^^^^^^^^^^^^^^^^^^^^ ImportError: libcudnn.so.9: cannot open shared object file: No such file or directory ``` This PR adds `site-packages/nvidia/**/lib` to `LD_LIBRARY_PATH` in `venv/bin/activate` script to let NVIDIA PyPI packages can be loaded correctly. See also: - pytorch#141837 Pull Request resolved: pytorch#143262 Approved by: https://github.com/malfet
Stack from ghstack (oldest at bottom):
LD_LIBRARY_PATHon Linux in nightly venv in nightly pull tool #143262Before this change:
This PR adds
site-packages/nvidia/**/libtoLD_LIBRARY_PATHinvenv/bin/activatescript to let NVIDIA PyPI packages can be loaded correctly.See also:
RPATHfor_C.sofor in tree installation: assuption fail"$ORIGIN/../.." -> site-packages#141837cc @ZainRizvi @kit1980 @huydhn @clee2000