(cudaErrorNoDevice) "cudaGetDeviceCount(&device_count)" - Windows 11

I’m getting the error above while trying to execute the BlackScholes sample.
I’m running Windows 11 (winver output: build 22000.348) on a HP Pavilion Laptop 15-ck0xx with a GeForce 940MX.
The driver used is 510.06_gameready_win11_win10-dch_64bit_international.
nvidia-cuda-toolkit 10.1.243-3 is installed inside WSL2 (Ubuntu 20.04)
/dev/dxg is missing