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
pytorch-0.3 with cuda and cudnn #32438
Conversation
checkPhase = '' | ||
${stdenv.shell} test/run_test.sh | ||
''; | ||
preConfigure = if cudnn != null then |
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.
lib.optionalString
utillinux | ||
which | ||
] ++ lib.optionals cudaSupport | ||
(lib.remove null [cudatoolkit cudnn]); |
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.
no need to remove null
pkgs/top-level/python-packages.nix
Outdated
cudnn = pkgs.cudnn; | ||
}; | ||
|
||
pytorchWithCuda = self.pytorch.override { |
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.
why add extra attributes when its a matter of overriding and setting cudaSupport=true;
?
2ca3be7
to
8e871a1
Compare
done |
''; | ||
|
||
doCheck = false; # for some unknown reason doesn't detect cuda if run from builder user |
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.
Do the tests have to be disabled for pytorchWithoutCuda
too?
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.
actually, not.
Hey, sorry I am a huge noob with NixOs, how can I use your fork in my nixpkgs so that I can finally run pytorch with cuda like calling something like : |
@tcosmo, personally I just cherry-picked top two commits to channels/nixos-17.09. Now I can run pytorch like this:
You may find this link useful: http://anderspapitto.com/posts/2015-11-01-nixos-with-local-nixpkgs-checkout.html |
cc maintainer @teh |
@akamaus Thank you very much for your answer!! |
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.
LGTM. Thanks!
''; | ||
|
||
doCheck = !cudaSupport; # for some unknown reason doesn't detect cuda if run from builder user |
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.
Could the check failure be caused by group permissions? I think to use cuda you need to be in the video group? In any case disabling for the cuda case with comment is OK.
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.
Well, I'm not sure. Users working with Cuda on my machine don't belong to video group. DISPLAY variable doesn't make any difference too.
Permissions for nvidia device are as follows:
% ls /dev/nvidia0 -l
crw-rw-rw- 1 root root 195, 0 jan 14 18:35 /dev/nvidia0
This doesn’t build when merged to current master (or channels/nixos-18.03).
|
Another issue: The non-cuda build seems to require cuda. I think it's down to this line:
|
Another one: multiprocessig tests fail with
I think the
@akamaus you still interested in updating this PR? Might be worth updating to 0.3.1 as well. |
I opened a new PR #38530 based on this, addressing all the above problems. |
Closing in favor of #38530. |
Motivation for this change
Currently pytorch derivation lacks cuda support. After introducing cudatoolkit9 supporting gcc6 it became easy to add cuda-related flags.
Notes
Unfortunately cuda-enabled pytorch tests fail to detect driver if run by nix builder. Still they can be run manually after package installation. Just run unpackPhase and execute the script.
Had to provide a fixed commit fix hash for revision, without it getFetchFromGithub doesn't download required submodules.