[Rtk-users] Fix the issue when use RTK on Nvidia Kepler Architecture based GPU.
刘鹏
liupeng_cs at 163.com
Mon Jan 20 04:06:32 EST 2014
Hello,
I find an issue when I try to use RTK on a Nvidia Kepler based GPU.
The CUDA initializing always fails.
And I can see an exception about _cudaMutexOperation when any CUDA function is called in debug mode.
Exception at 0x7fefd5f940d, code: 0xe06d7363: C++ exception, flags=0x1 (execution cannot be continued) (first chance) in cudart64_50_35!_cudaMutexOperation
Following the guide in
http://docs.nvidia.com/cuda/kepler-compatibility-guide/index.html
This issue can be fixed by applying the patch on RTK code:
===========================================================================
diff --git a/cmake/FindCUDA_wrap.cmake b/cmake/FindCUDA_wrap.cmake
index e13a7c3..b40c6da 100644
--- a/cmake/FindCUDA_wrap.cmake
+++ b/cmake/FindCUDA_wrap.cmake
@@ -59,9 +59,19 @@ set (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS}
)
if(CUDA_VERSION_MAJOR GREATER "2")
- set (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS}
- -gencode arch=compute_20,code=sm_20
- )
+ IF(${CUDA_VERSION} LESS 5.0)
+ set (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS}
+ -gencode arch=compute_20,code=sm_20
+ -gencode arch=compute_20,code=compute_20
+ )
+ ELSE()
+ set (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS}
+ -gencode arch=compute_20,code=sm_20
+ -gencode arch=compute_30,code=sm_30
+ -gencode arch=compute_35,code=sm_35
+ -gencode arch=compute_35,code=compute_35
+ )
+ ENDIF()
endif()
if(CUDA_FOUND)
============================================================================
Regards,
Peng Liu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/rtk-users/attachments/20140120/2788ac40/attachment-0008.html>
More information about the Rtk-users
mailing list