How to run pytorch with NVIDIA "cuda toolkit" version instead of the official conda "cudatoolkit" version?
Some questions came up from https://superuser.com/questions/1572640/do-i-need-to-install-cuda-separately-after-installing-the-nvidia-display-driver. One of these questions:
Does conda pytorch need a different version than the official non-conda / non-pip cuda toolkit at https://developer.nvidia.com/cuda-toolkit?
In other words: Can I use the NVIDIA &quot;cuda toolkit&quot; for a pytorch installation?
Context:
If you go through the &quot;command helper&quot; at https://pytorch.org/get-started/locally/, you can choose between cuda versions 9.2, 10.1, 10.2 and None.
Taking 10.2 can result in:
conda install pytorch torchvision cudatoolkit=10.2 -c pytorch

Taking &quot;None&quot; builds the following command, but then you also cannot use cuda in pytorch:
conda install pytorch torchvision cpuonly -c pytorch

Could I then use NVIDIA &quot;cuda toolkit&quot; version 10.2 as the conda cudatoolkit in order to make this command the same as if it was executed with cudatoolkit=10.2 parameter?
The question arose since pytorch installs a different version (10.2 instead of the most recent NVIDIA 11.0), and the conda install takes additional 325 MB. If both versions were 11.0 and the installation size was smaller, you might not even notice the possible difference. But now it is clear that conda carries its own cuda version which is independent from the NVIDIA one.

You can try to install PyTorch via Pip:
pip install torch torchvision

It is also official way of installing, available in &quot;command helper&quot; at https://pytorch.org/get-started/locally/.
It uses preinstalled CUDA and doesn't download own CUDA Toolkit.
Also you can choose the version of CUDA to install PyTorch for:
pip install torch==1.7.1+cu110 torchvision==0.8.2+cu110 torchaudio===0.7.2 -f https://download.pytorch.org/whl/torch_stable.html

