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.

[mamba] Installing cpuonly PyTorch and torchvision from conda channel should not require cudatoolkit

See original GitHub issue

🐛 Describe the bug

When installing CPU-only version of PyTorch 1.10 using the official guidelines from the website for using conda as package manager, the package cudatoolkit is also installed. The cudatoolkit package is very large to download (1 GB) and even larger after getting installed. The large size is concern especially in building Docker images.

Basic reproduction steps:

  1. Use conda for a dry-run install of cpuonly pytorch=1.10 and torchvision.
  2. Check in the output whether cudatooklit would have been installed or not.

The script below saves the dry-run’s output to a file and uses grep to check if cudatoolkit was indeed identified as a dependency.

# assuming conda is installed
conda create -n dry python=3.8
conda install -q -n dry \
    -c pytorch -c defaults -c conda-forge \
    cpuonly pytorch=1.10 torchvision \
    --dry-run > dry-run.txt
grep cudatoolkit dry-run.txt

Versions

PyTorch version: N/A
Is debug build: N/A
CUDA used to build PyTorch: N/A
ROCM used to build PyTorch: N/A

OS: Microsoft Windows 10 Enterprise
GCC version: Could not collect
Clang version: 13.0.1
CMake version: version 3.22.2
Libc version: N/A

Python version: 3.8.12 (default, Oct 12 2021, 03:01:40) [MSC v.1916 64 bit (AMD64)] (64-bit runtime)
Python platform: Windows-10-10.0.19042-SP0
Is CUDA available: N/A
CUDA runtime version: 11.2.67
GPU models and configuration: GPU 0: NVIDIA GeForce 940MX
Nvidia driver version: 472.88
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A

Versions of relevant libraries:
[pip3] Could not collect
[conda] Could not collect

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
motjustecommented, Apr 1, 2022

Yes, with torchvision 0.12.0, it works as expected — no cudatoolkit is installed, and only the cpu versions are installed when asked for cpuonly. Unfortunately, one does have to update to pytorch 1.11.0, but that does not seem to be a breaking change for me at least. Thanks a lot for your work!

1reaction
rgommerscommented, Mar 18, 2022

This seems to have been fixed in the 0.12.0 release made 8 days ago. All conda packages now have a dependency on pytorch-mutex 1.0 (click the (i) icon on https://anaconda.org/pytorch/torchvision/files to verify):

image

@motjuste does it work for you now?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Start Locally - PyTorch
To install PyTorch via Anaconda, and do not have a CUDA-capable or ROCm-capable system or do not require CUDA/ROCm (i.e. GPU support), in...
Read more >
New mamba environment force torch CPU and I don't know why
I noticed that it get the pytorch 1.13.0 so i tried mamba install pytorch==1.12.1 torchvision torchaudio -c pytorch -c conda-forge and i worked, ......
Read more >
conda/conda - Gitter
this happens when I do conda create -q -n test-environment pytorch cpuonly torchvision python=3.7 -c pytorch-nightly with channel_priority=strict.
Read more >
Installing Python Packages & setting up libraries for Data ...
Go ahead and install python packages in this manner, by just replacing conda with mamba. mamba install pytorch torchvision torchaudio cpuonly -c ...
Read more >
Installation — pytorch_geometric documentation
Ensure that at least PyTorch 1.12.0 is installed: · Find the CUDA version PyTorch was installed with: python -c "import torch; print(torch. ·...
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