1. pytorch查看cuda、cudnn版本
python -c "import torch;print(f'torch version:{torch.__version__}');print(f'cuda version:{torch.version.cuda}');print(f'cudnn version:{torch.backends.cudnn.version()}')"
输出结果
root@bcc5071417cf:/# python -c "import torch;print(f'torch version:{torch.__version__}');print(f'cuda version:{torch.version.cuda}');print(f'cudnn version:{torch.backends.cudnn.version()}')"
torch version:1.11.0
cuda version:11.3
cudnn version:8200
2. tensorflow查看cuda、cudnn版本
root@cc58e655b170:/home/zhou# nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Sun_Feb_14_21:12:58_PST_2021
Cuda compilation tools, release 11.2, V11.2.152
Build cuda_11.2.r11.2/compiler.29618528_0
python -c "import tensorflow as tf;print(tf.reduce_sum(tf.random.normal([1000, 1000])))"
输出结果:
root@cc58e655b170:/usr# python -c "import tensorflow as tf;print(tf.reduce_sum(tf.random.normal([1000, 1000])))"
2022-03-22 15:26:13.281719: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1525] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 3951 MB memory: -> device: 0, name: NVIDIA GeForce GTX 1660 Ti, pci bus id: 0000:01:00.0, compute capability: 7.5
tf.Tensor(-2613.715, shape=(), dtype=float32)
可以看到: GPU:0 with 3951 MB memory: -> device: 0, name: NVIDIA GeForce GTX 1660 Ti, pci bus id: 0000:01:00.0, compute capability: 7.5 name为NVIDIA GeForce GTX 1660 Ti为显卡名称, compute capability: 7.5为cudnn版本,为7.5
|