question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pytorchWithCuda possible?

See original GitHub issue

In the following code, torch resolves to the package pytorch. Is there a way to make it resolve to pytorchWithCuda instead?

devShell = mach-nix.mkPythonShell rec {
  requirements = ''
      torch
      jupyterlab
      torchvision
      matplotlib
   '';

   providers = {
     torch = "nixpkgs";
   };
};

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
DavHaucommented, Jan 17, 2021

You could just use overridesPost in mach-nix to enable cuda for pytorch:

let
  mach-nix = import (
    builtins.fetchGit {
      url = "https://github.com/DavHau/mach-nix/";
      ref = "refs/tags/3.1.1";
    }
  ) {
    python = "python37";
  };
in
mach-nix.mkPython {
  requirements = ''
    torch
  '';
  providers.torch = "nixpkgs";
  overridesPost = [(curr: prev: {
    torch = prev.torch.override {
      cudaSupport = true;
    };
  })];
}

I cannot verify, since I don’t have a GPU available right now.

Should we add this to the examples.md?

1reaction
InLawcommented, Jan 4, 2021

pname is an issue in some cases

  • but pname is defined in the source code
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to set up and Run CUDA Operations in Pytorch
This article will cover setting up a CUDA environment in any system containing CUDA-enabled GPU(s) and a brief introduction to the various CUDA...
Read more >
Is it required to set-up CUDA on PC before installing CUDA ...
One limitation to this is that you would still need a locally installed CUDA toolkit to build custom CUDA extensions or PyTorch from...
Read more >
How to Install PyTorch with CUDA 10.0 - VarHowto
1. cat /usr/local/cuda/version.txt 2. pip install torch==1.4.0 torchvision==0.5.0 -f https://download.pytorch.org/whl/cu100/torch_stable.html Note: PyTorch only supports CUDA 10.0 up to 1.4.0. (Search torch- in https://download.pytorch.org/whl/cu100/torch_stable.html). 3....
Read more >
Installing Pytorch with CUDA support on Windows 10
The latest version of Pytorch available is Pytorch 1.7.1. There are many possible ways to match the Pytorch version with the other features,...
Read more >
Using CUDA with pytorch? - python - Stack Overflow
to set cuda as your device if possible. There are various code examples on PyTorch Tutorials and in the documentation linked above that ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found