I just hit this problem as well with Spack (https://spack.io 2). Does PyTorch keep track of supported CUDA versions for each release? So far I’ve found:

CUDA 7.5+ for older PyTorch
CUDA 9+ for PyTorch 1.1+
CUDA 9.2+ for PyTorch 1.6+

from CMake but I’ve never seen an upper bound. I’m guessing that CUDA is handled like Python where it’s assumed that new versions will be compatible but not guaranteed when CUDA/Python break backwards compatibility?
Anyway, I’ll add a constraint to our PyTorch build recipe that says that PyTorch 1.10 and older require CUDA 11.4 and older. Let me know if there are any other known constraints.