首先进入python编译环境
Pytorch
import torch
torch.cuda.is_available()
显示true
则GPU可用
Tensorflow
import tensorflowas tf
tf.test.is_gpu_available()
显示true
则GPU可用
附:
- 查看cuda版本
nvcc -V
- 查看torch/tensorflow版本
import torch/import tensorflowas tf
torch/tf/__version__