Given above discussion, I’m surprised I was able to use PyTorch version 1.6 while my ubuntu20 host has CUDA version 11. For my setup, I used pytorch in a docker container using python3.8 base image and I pip installed pytorch 1.6 and torchvision 0.7. I did not even install any other cudatoolkit version. To access gpu from container I had nvidia-docker2 container toolkit package on the host. torch.cuda.is_available() returned true.