From 1c7d0802abacd4d0adb08f046802acfad735d91c Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Wed, 26 May 2021 17:01:18 +0800 Subject: [PATCH] fix(cuda): remove cuda driver version check and runtime minor version GitOrigin-RevId: 4463beccf15e6eec5b9a1f081523e127aeb94c96 --- src/core/impl/utils/persistent_cache.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/impl/utils/persistent_cache.cpp b/src/core/impl/utils/persistent_cache.cpp index b5db023e..efe3d54a 100644 --- a/src/core/impl/utils/persistent_cache.cpp +++ b/src/core/impl/utils/persistent_cache.cpp @@ -41,14 +41,14 @@ std::string PersistentCache::make_category_from_comp_node(CompNode comp_node) { switch (env.property().type) { #if MGB_CUDA case CompNode::DeviceType::CUDA: { - int drv = -1, cuda_rt = -1; - MGB_CUDA_CHECK(cudaDriverGetVersion(&drv)); + int cuda_rt = -1; MGB_CUDA_CHECK(cudaRuntimeGetVersion(&cuda_rt)); + int cuda_rt_major = cuda_rt / 1000; auto&& prop = env.cuda_env().device_prop; // note: we do not contain library versions such as cudnn here. They // are handled by opr impls in MegDNN - return ssprintf("plat=cuda;dev=%s;cap=%d.%d,drv=%d;runtime=%d", - prop.name, prop.major, prop.minor, drv, cuda_rt); + return ssprintf("plat=cuda;dev=%s;cap=%d.%d;runtime=%d", + prop.name, prop.major, prop.minor, cuda_rt_major); break; } #endif