How to get the cuda version?

后端 未结 19 2127
囚心锁ツ
囚心锁ツ 2020-11-30 16:24

Is there any quick command or script to check for the version of CUDA installed?

I found the manual of 4.0 under the installation directory but I\'m not sure whether

相关标签:
19条回答
  • 2020-11-30 16:33

    If you have installed CUDA SDK, you can run "deviceQuery" to see the version of CUDA

    0 讨论(0)
  • 2020-11-30 16:33

    One can get the cuda version by typing the following in the terminal:

    $ nvcc -V
    
    # below is the result
    nvcc: NVIDIA (R) Cuda compiler driver
    Copyright (c) 2005-2017 NVIDIA Corporation
    Built on Fri_Nov__3_21:07:56_CDT_2017
    Cuda compilation tools, release 9.1, V9.1.85
    

    Alternatively, one can manually check for the version by first finding out the installation directory using:

    $ whereis -b cuda         
    cuda: /usr/local/cuda
    

    And then cd into that directory and check for the CUDA version.

    0 讨论(0)
  • 2020-11-30 16:33

    if nvcc --version is not working for you then use cat /usr/local/cuda/version.txt

    0 讨论(0)
  • 2020-11-30 16:34

    If you are running on linux:

    dpkg -l | grep cuda
    
    0 讨论(0)
  • 2020-11-30 16:34

    Programmatically with the CUDA Runtime API C++ wrappers:

    auto v1 = cuda::version::maximum_supported_by_driver();
    auto v2 = cuda::version::runtime();
    

    This gives you a cuda::version_t structure, which you can compare and also stream, e.g.:

    if (v2 < cuda::version_t{ 8, 0 } ) {
        std::cerr << "CUDA version " << v2 << " is insufficient." std::endl;
    }
    
    0 讨论(0)
  • 2020-11-30 16:35

    If you run

    nvidia-smi
    

    You should find the CUDA Version on the top right corner of the comand's output. At least I found that output for CUDA version 10.0 e.g.,

    0 讨论(0)
提交回复
热议问题