Pytorch找不到gpu

问题描述 投票:0回答:0

我开始在我的windows11机器上学习机器学习。但是 torch 找不到我的 gpu。

In [2]: device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")

In [3]: device
Out[3]: device(type='cpu')

这是我的

nvidia-smi
输出

+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 531.68                 Driver Version: 531.68       CUDA Version: 12.1     |
|-----------------------------------------+----------------------+----------------------+
| GPU  Name                      TCC/WDDM | 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 3060 L...  WDDM | 00000000:01:00.0  On |                  N/A |
| N/A   38C    P8               13W /  N/A|    876MiB /  6144MiB |      5%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
python pytorch gpu torch
© www.soinside.com 2019 - 2024. All rights reserved.