Running Docker on WSL2 without Docker Desktop can be a bit of a pain because of its daemonized nature, especially if you're running applications inside the container on your command line instead of just letting them run in the background.
As podman doesn't require a daemon, it makes running docker containers on WSL2 much easier and cleaner and you can just alias docker=podman
as the APIs are 100% compatible. Setting up the nvidia support should be pretty straightforward as well, but as it took some time for me to figure it out (as the process isn't very well documented yet) I'm putting this Gist together for me and for everyone that might need it.
- Run the
setup.sh
script bellow. It'll install both podman and the required nvidia packages. This script is based on the information found at https://docs.nvidia.com/cuda/wsl-user-guide/index.html and https://podman.io/getting-started/installation;