CUDA Error: no CUDA-capable device is detected and Error: Did not find a GPU

I have faced with this error:
CUDA Error: no CUDA-capable device is detected /arbd/src/GPUManager.cpp 77
Error: Did not find a GPU

more information about my system:
nvidia-smi

glxinfo | grep NVIDIA
Device: D3D12 (NVIDIA GeForce MX350) (0xffffffff)
OpenGL renderer string: D3D12 (NVIDIA GeForce MX350)

nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Thu_Nov_18_09:45:30_PST_2021
Cuda compilation tools, release 11.5, V11.5.119
Build cuda_11.5.r11.5/compiler.30672275_0
lspci | grep -i nvidia
there is no out put
dpkg -l | grep nvidia


uname -r
5.15.90.1-microsoft-standard-WSL2
inxi -G
Graphics:
Device-1: Microsoft Basic Render Driver driver: dxgkrnl v: 2.0.1
Device-2: Microsoft Basic Render Driver driver: dxgkrnl v: 2.0.1
Display: wayland server: Microsoft Corporation X.org driver:
gpu: dxgkrnl,dxgkrnl resolution: 1920x1080~60Hz
OpenGL: renderer: D3D12 (NVIDIA GeForce MX350)
v: 4.2 Mesa 23.0.4-0ubuntu1~22.04.1

As I mentioned, I have encountered the following error:

CUDA Error: No CUDA-capable device is detected in /arbd/src/GPUManager.cpp line 77.
Error: A GPU was not found. Does anyone have any suggestions for resolving this GPU-related issue? Any suggestions are welcome.

Hi there @fadaeifatemeh1, welcome to the NVIDIA developer forums.

Just for clarification for the CUDA experts, this is a Laptop setup on Windows and you are using WSL2 with Ubuntu 22.04, correct?

First of all, you seem to have a driver mismatch since nvidia-smi gives two different driver versions. Which does not necessarily has to be the reason your device is not found.

But in general I would recommend you check out the CUDA on WSL2 documentation in detail and follow the Recommended actions after CUDA setup. It is very likely that your issues will be resolved afterwards.

Thanks!

Thank you so much for your prompt reply. Yes, I am using WSL2 with Ubuntu 22.04 on my Acer Aspire 5 laptop (model A515-54G-72QW). I will just check the links. Thank you again

I have changed the version of CUDA, but I still have the same error. Does anybody have any suggestions?
nvcc --version
nvcc--version
nvidia-smi

How did you install cuda? It’s mandatory no nvidia driver components are installed in the WSL2 environment since this will break cuda.