-
Notifications
You must be signed in to change notification settings - Fork 378
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
Conda installs a cpu version of pytorch and torchvision #529
Comments
@ashnair1 @calebrob6 this relates to #295. I believe both |
Just tried installing pytorch-gpu ( |
With Spack this would look like: $ spack install py-torchgeo ^py-torch+cuda cuda_arch=... I don't know of any other package managers that have that level of flexibility. But we can certainly add this advice to the installation instructions! |
For what it's worth I've opened conda-forge/pytorch-cpu-feedstock#102 to look into this. I didn't observe this when I pushed #295 so I'm not sure if it's a new development but I can reproduce this now. |
I believe conda does have a way to determine if your device has a gpu or not via virtual packages. Refer here. But I'm still not clear on the details. |
@remtav was this issue fixed by #528? From the discussion in conda-forge/pytorch-cpu-feedstock#102 it seems like this issue only affects the pytorch package from conda-forge, it shouldn't affect the pytorch package from the pytorch channel. |
Unfortunately, no. Even the pytorch channel chooses the cpu version: A quick solution would be to specify However, for a more permanent solution, we'd have to dig further into what @ashnair1 shared. Maybe conda can validate the presence of a GPU or not and choose the package based on that. |
Could you try installing by pegging the cudatoolkit to one of the following (10.2, 11.1, 11.3, 11.5)? pytorch does not ship a whl compiled with cudatoolkit 11.7 which is the latest cudatoolkit and the one that gets installed by default. Talked about this in the linked conda-forge issue here -> conda-forge/pytorch-cpu-feedstock/issues/102#issuecomment-1133948416 |
Works! I simply changed :
to
and conda installed pytorch with gpu support: @adamjstewart I'd be pushing a tiny PR for this tomorrow if that's fine on your side. |
I'm surprised we even have cudatoolkit in there, isn't that only needed for pytorch-gpu? Btw, I'm fine with whatever, I don't use conda. |
check out https://pytorch.org/get-started/locally/ |
This installs the cpu version by default again now. (21/06/2024 RTX4090) |
Conda installation (tested on Ubuntu 20.04) installs a cpu version of pytorch and torchvision. In my own project, the only remedy I've found was to hardcode the pytorch package to use. Poor solution. Hoping to find an alternative.
Related to #527
result from
conda list
in torchgeo environment:The text was updated successfully, but these errors were encountered: