How to get the cuda version?

后端 未结 19 2164
囚心锁ツ
囚心锁ツ 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: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;
    }
    

提交回复
热议问题