-
Notifications
You must be signed in to change notification settings - Fork 24.2k
Always try to preload pypi cuda deps. #133963
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/133963
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit c4188d5 with merge base 24b695a ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
409bdf6
to
02f2270
Compare
Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as |
ping @malfet |
@pytorchbot label "topic: not user facing" |
6112c47
to
daaadd0
Compare
Fixes #101314
Fixes #121207
Could detect #138324 before release
Fixes the import error when using redhat-like system with a system-wide cuda runtime.
Redhat-like have seperate platlib and purelib dir and breaks the rpath search, while if a system-wide cuda runtime presents, importing
libtorch_global_deps.so
will not fail because it only depends onlibcudart.so
andlibnvToolsExt.so
so the pypi path is not triggered, then it will fail likely because of a version mismatch of libcudnn and libnccl.This PR always try to preload pypi nvidia librarys if anysite-packages/nvidia
presents, and fixes the issue.Risk: unexpected (e.g. partiacally installed pypi nvidia packages)site-packages/nvidia
folder present will lead to import failure. This PR also change the behavior that all paths insys.path
will be walked through, searching for/nvidia/<libs>
. It seems unnecessary to me, but I do see some references from old issue e.g. #92096. Now it only searched forsite-packages/nvidia
. (Debian might need to take care of thedist-packages
dir)We use python's import mechanism to detect and find the pypi packages, this can handle various case, including purelib/platlib, and different install location from easy install.
@malfet @atalman