Repository navigation
python3Packages.torch: add libnvrtc to torch's runpath - #315694
SomeoneSerge merged 2 commits into
Conversation
|
Sending this out to get some preview from the reviewers. Also some questions: @SomeoneSerge: Should I apply the same change to |
|
Result of 62 packages marked as broken and skipped:
619 packages failed to build:
|
Yes, IIRC it suffered from the same problem
I think I ran something like
@siraben I presume this was just a fluke?:) |
|
I tried to run |
Will do
Sorry I do not quite follow. Is this a way to add tests that can be run manually but not triggered automatically? Thanks! |
2028eec to
2dbfc9d
Compare
|
I have manually tested the commit following @SomeoneSerge's suggestion. With the commit:Python 3.11.9 (main, Apr 2 2024, 08:25:04) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.randn(10, 10).to("cuda").det().item()
-1625.952880859375
>>>Without the commit:Python 3.11.9 (main, Apr 2 2024, 08:25:04) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.randn(10, 10).to("cuda").det().item()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: Error in dlopen for library libnvrtc.so.12and libnvrtc-26bfb51d.so.12 |
There was a problem hiding this comment.
This needs to be wrapped in optionals cudaSupport, otherwise the vanilla nixpkgs instance's torch would also depend on non-free cuda
There was a problem hiding this comment.
Good point. Will fix.
There was a problem hiding this comment.
Nit: I don't think cudaSupport belongs here. THe reasoning for isLinux was that it's lazy (and not entirely correct) way of saying "postPatchelfPhase only makes sense on systems that use ELF". Not that it matters a whole lot, because I at least still hope to see a more generic hook introduced, which would allow removing ad hoc code from torch and other derivations
There was a problem hiding this comment.
So without cudaSupport here, my understanding is that for non-cuda build on Linux the hook is still going to perform the patch. Do you mean this is ok?
There was a problem hiding this comment.
Yes, it'll just be a no-op when extraRunpaths is empty
|
I apologize for the delayed response. Got some acute illness. Let me update and test again. Thanks a lot for the prompt review! |
2dbfc9d to
73ddfdc
Compare
|
Addressed comments and verified again. PTAL. |
Co-authored-by: Someone <[email protected]>
|
@ofborg build python311Packages.torch python312Packages.torch |
|
Seems that the checks have passed. I am wondering if there's anything else needed from my side to do at this moment? Thanks! |
|
@breakds I guess I'll have to rebase/squash to fix the commit message |
|
Thank you @breakds |
|
If you feel up to it, maybe you could now rewrite |
Got it. I will probably need to read and learn more before I can take that, but definitely want to try. |
Description of changes
Aim bandage and work around #296179
This is a temporary solution before #297590 is ready. Many modern machine learning models will not be able to run if this is not fixed. This fix is based on @SomeoneSerge's SomeoneSerge/dust3r.nix@8715f78
The same fix has been tested here: nixvital/ml-pkgs@518e76b and I can verify it resolves the issue.
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.