Is CUDA back-compatible?

i.e., if I installed CUDA 10.2, can I still install pytorch via conda by

conda install pytorch torchvision cudatoolkit=10.1 -c pytorch


In general it is not I’m afraid.
But for versions that are very close, it might work :smiley:
Unfortunately, you won’t get a nice error message. So if you get weird cuda errors, this is most likely due to this mismatch.

Note that when you install cuda in conda, it installs a brand new cuda and won’t use your system wide one. So here you’re safe and you won’t get any issue.

So pytorch depends on cudatoolkit that comes with it in conda environment, right?

As @albanD explained, if you install the PyTorch binaries with cudatoolkit, your local CUDA installation won’t be used, but instead the one shipped with the binaries.

If I understand the original question right, you would like to install PyTorch with CUDA10.1 as the binaries, while CUDA10.2 is installed locally on your machine?
If that’s the case, then yes it’ll work as the binaries won’t interfere with the local installation.