I'm trying to use cuda on WSL2 ubuntu. when I run nvidia-smi, it's good:
$ nvidia-smi
Wed Aug 9 14:11:02 2023
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.98.01 Driver Version: 536.99 CUDA Version: 12.2 |
|-----------------------------------------+----------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+======================+======================|
| 0 NVIDIA GeForce RTX 2060 On | 00000000:01:00.0 On | N/A |
| N/A 53C P8 12W / 80W | 872MiB / 6144MiB | 7% Default |
| | | N/A |
+-----------------------------------------+----------------------+----------------------+
+---------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=======================================================================================|
| 0 N/A N/A 256 G /Xwayland N/A |
+---------------------------------------------------------------------------------------+
In python I run
>>> torch.cuda.device_count()
1
but cuda is not available:
>>> torch.cuda.is_available()
False