How to install cuDNN for PyTorch 2.1.0 with CUDA 12.1

Hi, new to machine learning and trying to run with my 4090.

I followed the instructions here on the pytorch website, installed for CUDA 12.1

But I read on Nvidia’s docs that I should install cuDNN as well, so downloaded v8.9.1 for CUDA 12.x

But realized is just a bunch of files with no installer. Searched and found the following youtube video where it showed that I simply have to copy the files from that cuDNN download into the respective “bin”, “include”, “lib” folders.

Question1: Am I installing cuDNN correctly?

Question2: Is Pytorch using cuDNN?

Question3: When running the following in my visual studio code…

import torch
print(torch.backends.cudnn.version())

It printed out “8801”

Should I be concerned, since the cuDNN I downloaded is v8.9.1?

Please advise!

2 Likes

The PyTorch binaries ship with their own CUDA, cuDNN, NCCL, etc. dependencies. You can directly install the experimental nightly binaries with CUDA 12.1 and cuDNN 8.9 or you could build PyTorch from source using your locally installed CUDA toolkit and cuDNN in the versions you want.

1 Like