Cudatoolkit version relevant?

pytorch.org suggest 2 cudatoolkit versions to install pytorch:

conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch
conda install pytorch torchvision torchaudio cudatoolkit=11.6 -c pytorch -c conda-forge

But what happens if I just install the latest cudatoolkit (right now I think it’s 11.7) like this ?
conda install pytorch torchvision torchaudio cudatoolkit -c pytorch -c conda-forge

Will I run into compatibility issue ?

The reason I’m asking is that I’m automating the install of pytorch on multiple machines, and installing the latest pytorch is always conda install pytorch torchvision torchaudio however I can’t know in advance the cudatoolkit version. Is it a hard requirement for pytorch to specify the cudatoolkit version, will the latest cudatoolkit run just fine too ?

No, as we need to build the binaries for each new CUDA release. Right now, I have the builds ready and would need to enable the CUDA 11.7 binaries in the CI next.
You would thus need to specify which dependency you want to use.

Thanks, that’s good to know.

I noticed that if I’m not installing explicitly cudatoolkit (conda install pytorch -c pytorch), the minimum cudatoolkit with which pytorch is compatible will be installed (right now cudatoolkit 11.3).
Am I correct, and is it safe to let pytorch tell conda its own cudatoolkit dependency rather than forcing it ?

I’m trying to find an easy, reproducible way to install the latest pytorch (now and in the future) with working CUDA support without having to specify the required cudatoolkit version. Ideally the latest supported cudatoolkit version, but I’m afraid there won’t be an easy solution for that.

I don’t know how conda will select the CUDA runtime version if none is specified. Maybe it’s picking whatever is the “first” it can find or maybe it uses some clever logic internally, but I don’t know.