是否有任何快速命令或脚本来检查安装的CUDA版本?
我在安装目录下找到了4.0的手册,但我不确定它是否是实际安装的版本。
是否有任何快速命令或脚本来检查安装的CUDA版本?
我在安装目录下找到了4.0的手册,但我不确定它是否是实际安装的版本。
当前回答
在Ubuntu上:
Try
$cat/usr/local/cuda/version.txt或$cat/usr/local/cuda-8.0/version.txt
有时文件夹名为“Cuda版本”。
如果以上都不起作用,请尝试转到$/usr/local/找到Cuda文件夹的正确名称。
输出应类似于:CUDA版本8.0.61
其他回答
使用tensorflow:
import tensorflow as tf
from tensorflow.python.platform import build_info as build
print(f"tensorflow version: {tf.__version__}")
print(f"Cuda Version: {build.build_info['cuda_version']}")
print(f"Cudnn version: {build.build_info['cudnn_version']}")
tensorflow版本:2.4.0
Cuda版本:11.0
Cudnn版本:8
在使用CUDA 11.6.1的Windows 11上,这对我很有用:
cat "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\version.json"
安装CUDA后,可以通过以下方式检查版本:nvcc-V
我已经安装了5.0和5.5
Cuda编译工具5.5版V5.5,0
此命令适用于Windows和Ubuntu。
您可以使用
nvcc -V
或者你可以使用
nvcc --version
或者您可以检查CUDA使用的位置
whereis cuda
然后做
cat location/of/cuda/you/got/from/above/command
在Ubuntu上:
Try
$cat/usr/local/cuda/version.txt或$cat/usr/local/cuda-8.0/version.txt
有时文件夹名为“Cuda版本”。
如果以上都不起作用,请尝试转到$/usr/local/找到Cuda文件夹的正确名称。
输出应类似于:CUDA版本8.0.61