验证linux gpu是否可用

通过torch验证

python 复制代码
import torch
 
print(torch.__version__)  # 查看torch当前版本号
print(torch.version.cuda)  # 编译当前版本的torch使用的cuda版本号
print(torch.cuda.is_available())  # 查看当前cuda是否可用于当前版本的Torch,如果输出True,则表示可用
print(torch.backends.cudnn.version()) # 查看cudnn版本是否正确
print(torch.backends.cudnn.is_available())
相关推荐
bush42 分钟前
嵌入式linux学习记录七,中断
linux·嵌入式
RisunJan19 分钟前
Linux命令-nologin(用于系统账户或需要禁止交互式登录的场景)
linux·运维
copyer_xyf25 分钟前
Python 异常处理
前端·后端·python
是阿建吖!27 分钟前
【Linux】信号
android·linux·c语言·c++
城北徐宫30 分钟前
Linux信号深度解剖:5种产生、3张表、4次切换
linux·c++·学习
倔强的石头10632 分钟前
【Linux指南】Linux快捷键与系统实用技巧
linux·运维·服务器
番茄地瓜34 分钟前
Linux 配置静态 IP 步骤
linux·运维·服务器
liulilittle38 分钟前
论 Linux 内核态全局稳态带宽的卡尔曼估计与工程实现
linux·服务器·网络·c++·计算机网络·tcp·通信
麻雀飞吧1 小时前
期货多合约策略目标持仓怎么更新才不乱
python·区块链
Cthy_hy1 小时前
拓扑排序超详解:原理 + Kahn 贪心算法
python·算法·贪心算法