when installing PyTorch 2.5 try to use Python versions from 3.9 up to 3.12, because PyTorch 2.5 officially supports Python versions from 3.9 up to 3.12.
CUDA 12.4 is compatible with NVIDIA driver version is 566.36.
For cuDNN cuDNN 9.1.0.70 version is compatible with CUDA 12.4.
For Installation:
Create a new virtual environment using conda with python version 3.12.0:
conda create -n pytorch_env python==3.12.0
Activate the env:
conda activate pytorch_env
Install pyTorch with CUDA 12.4:
conda install pytorch torchvision torchaudio pytorch-cuda=12.4 -c pytorch -c nvidia
Now try to verify it:
print(torch.cuda.is_available())