This setup is to make the development platform fairly consistent with what would be used to run the same exact system on a server, and more importantly allowing us to work with multiple versions of Pytorch and nvidia drivers seamlessly without having to change configuration on the host system.
There are a few too many layers of abstraction here, and even the explanation (Pytorch on docker on WSL on Windows) is technically an excerpt on the underlying complexities and abstractions of each of docker, WSL and Windows. Not to mention the missing NGC containers that are not part of the abbreviated explanation.
This is a highly opinionated workflow that I have developed because I work on multiple different tech stacks at the same time which is largely enabled by docker. Since running docker on windows requires a virtualization backend, WSL is the natural choice for that. Developing within these containerized environments is usually done using VSCode devcontain