大家好,又见面了,我是你们的朋友全栈君。
https://medium.com/@changrongko/nv-how-to-check-cuda-and-cudnn-version-e05aa21daf6c
cuda 版本 cat /usr/local/cuda/version.txt
cudnn 版本 cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2
测试 系统 cuda 和 cudnn 有效性
test_cuda.py
import torch
print(2.0)
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
# Assume that we are on a CUDA machine, then this should print a CUDA device:
print(device)
x = torch.Tensor([2.1])
xx = x.cuda()
print(xx)
# CUDNN TEST
from torch.backends import cudnn
print('cudann is ' + str(cudnn.is_acceptable(xx)))
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/129961.html原文链接:https://javaforall.cn
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有