I can’t explain how much pain I suffered setting up RTX 3070 before all the official docs were updated.
You need Cuda 11 to make 30XX family work. And make sure you have the latest drivers, of course.
In short, you have two options:

Create a new conda environment and then literally follow Pytorch install docs conda install pytorch torchvision torchaudio cudatoolkit=11.0 -c pytorch . cudatoolkit will install cuda and cdnn.
Or use the official nvidia docker image NVIDIA NGC 5