怎么查看安装的cuda是否可用
时间: 2023-08-14 16:09:33 浏览: 187
要查看安装的cuda是否可用,可以使用以下代码:
```python
import torch
print(torch.cuda.is_available())
```
这段代码会返回一个布尔值,如果返回True,则表示cuda可用;如果返回False,则表示cuda不可用。这是一种验证cuda是否成功安装的简单方法。\[1\]
#### 引用[.reference_title]
- *1* *2* [[Linux ]安装Anaconda、python、验证cuda是否可用](https://blog.csdn.net/weixin_49627776/article/details/115289454)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [Python 查看pytorch版本、判断CUDA是否可用](https://blog.csdn.net/hb_learing/article/details/114851335)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文