ERROR: cuda failure (no CUDA-capable device is detected) in error_util.h:91

The error message is displayed when I try to run the mnistCUDNN example on wsl2.
Executing: mnistCUDNN
cudnnGetVersion() : 8202 , CUDNN_VERSION from cudnn.h : 8202 (8.2.2)
Host compiler version : GCC 9.4.0
ERROR: cuda failure (no CUDA-capable device is detected) in error_util.h:91
Aborting…

Also have installed CUDA 11.4.152 and it sees the GPU (RTX3060 laptop GPU). nvidia-smi sees the windows driver 511.65 CUDA 11.6.

I also have CUDA and CUDNN installed in Windows 10, and both see the GPU.
Gary