You can use ‘lambda stack’ instead of installation pytorch from source.
Fast and easy:
  
      
      Lambda Blog – 31 Jan 21
  
  
    

Install TensorFlow & PyTorch for the RTX 3090, 3080, 3070 939

Instructions for getting TensorFlow and PyTorch running on NVIDIA's GeForce RTX 30 Series GPUs  (Ampere), including RTX 3090, RTX 3080, and RTX 3070.