The conda and pip binaries come with built-in libs. See this answer from another thread:

  
    
    
    Newbie question: What are the prerequisites for running PyTorch with GPU? 
  
  
    if you want to use pytorch with an NVIDIA GPU, all you need to do is install pytorch binaries and start using it. We ship with everything in-built (pytorch binaries include CUDA, CuDNN, NCCL, MKL, etc.). 
So it’s a one-touch install: 

Install pytorch from binaries ( http://pytorch.org has instructions)
Try a simple program with CUDA:

import torch
a = torch.randn(10).cuda()
print(a)
print(a + 2)
  


Usually you don’t need to build it from source.
The reasons why you would want to build it yourself are:

if you would like to develop a new PyTorch feature and thus need to work on the source code
if you need a new PyTorch feature or bug fix which has not been integrated into the binaries yet.