You should select the CUDA install based on which CUDA version you have. You can do this via nvcc --version in a terminal; it’ll tell you what version you’re running.
PyTorch checks your ‘/usr/local/cuda’ directory for a CUDA installation, as well as the CUDA_HOME global variable (source code here 222). You don’t need to set the CUDA_HOME manually unless your CUDA installation is somewhere non-standard.