我如何确定完整的CUDA版本+颠覆版本? [英] How can I determine the full CUDA version + subversion?
问题描述
CUDA发行版曾经有一个名为 version.txt
的文件,该文件读取例如:
CUDA distributions on Linux used to have a file named version.txt
which read, e.g.:
CUDA Version 10.2.89
这非常有用.但是,从CUDA 11.1开始,此文件不再存在.
which is quite useful. However, as of CUDA 11.1, this file no longer exists.
如何在Linux上和命令行上确定我正在查看哪个版本的/path/to/cuda/toolkit
?包括颠覆吗?
How can I determine, on Linux and from the command line, and inspecting /path/to/cuda/toolkit
, which exact version I'm looking at? Including the subversion?
推荐答案
(由于@RobertCrovella的评论而回答)
(Answer due to @RobertCrovella's comment)
这可以解决问题:
/path/to/cuda/toolkit/bin/nvcc --version | egrep -o "V[0-9]+.[0-9]+.[0-9]+" | cut -c2-
当然,对于当前选择并配置为使用的CUDA版本,只需采用路径上的 nvcc
:
And of course, for the CUDA version currently chosen and configured to be used, just take the nvcc
that's on the path:
nvcc --version | egrep -o "V[0-9]+.[0-9]+.[0-9]+" | cut -c2-
例如:您将获得 11.2.67
,该文件可在本周在NVIDIA网站上下载CUDA 11.2.
For example: You would get 11.2.67
for the download of CUDA 11.2 which was available this week on the NVIDIA website.
完整的 nvcc --version
输出为:
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2020 NVIDIA Corporation
Built on Mon_Nov_30_19:08:53_PST_2020
Cuda compilation tools, release 11.2, V11.2.67
Build cuda_11.2.r11.2/compiler.29373293_0
这篇关于我如何确定完整的CUDA版本+颠覆版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!