Make sure the NVIDIA driver is correctly installed and in case you have a local CUDA toolkit installed, build and run some CUDA examples.
Once this is verified, install the latest PyTorch binary using the CUDA11.1 or 11.3 runtime.