I followed Nvidia’s WSL2 page closely and everything on this page CUDA on WSL :: CUDA Toolkit Documentation works except for 4.2.4. Deep Learning Framework Containers, in that it reports no GPU driver found.
docker run --gpus all -it --shm-size=1g --ulimit memlock=-1 --ulimit stack=67108864 nvcr.io/nvidia/tensorflow:20.03-tf2-py3 WARNING: The NVIDIA Driver was not detected. GPU functionality will not be available. Use 'nvidia-docker run' to start this container;
I tried nvidia-docker which behaves the same, it looks to me tensorflow failed to realize that NVIDIA driver under WSL2 is provided by Windows instead of where docker is running(ubuntu 20.04)?
NOTE the cuda sample runs fine and gave me result of CUDA, so apparently its tensorflow could not detect the WSL2 environment here.