大家好,又见面了,我是你们的朋友全栈君。

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

代码语言:javascript复制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


八种女人容易得妇科病
问皮鞋250是多少码