在运行网上下载的gipuma源码时遇到这个问题,以为是CUDA版本问题就换了笔记本试,源码核心的源文件见https://github.com/kysucix/gipuma/blob/master/gipuma.cu
笔记本:WIN10,VS2015,OPENCV2.4.13,CUDA9.0,显卡GTX950M,计算能力5.0,显卡驱动版本388.73
台式:WIN7家庭版,VS2015,OPENCV2.4.13,CUDA8.0,显卡QUADRO K2000,计算能力3.0,显卡驱动版本417.35
在网上查是code generation不对,其中-arch表示gpu architecture,于是在CMakeLists里将set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-O3 --use_fast_math --ptxas-options=-v -std=c++11 --compiler-options -Wall -gencode arch=compute_30,code=sm_30 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_61,code=sm_61)
笔记本里改成了set(CUDA_NVCC_FLAGS_RELEASE ${CUDA_NVCC_FLAGS};-O3 --use_fast_math --ptxas-options=-v -std=c++11 --compiler-options -Wall -arch=sm_50 -gencode=arch=compute_50,code=sm_50)
台式里改为了set(CUDA_NVCC_FLAGS_RELEASE ${CUDA_NVCC_FLAGS};-O3 --use_fast_math --ptxas-options=-v -std=c++11 --compiler-options -Wall -arch=sm_30 -gencode=arch=compute_30,code=sm_30)
结果还是不行,也换了其他所有可能的数字都不行,在CMake生成的工程属性页CUDA C/C++里也进行了修改(不知道对不对),也不行,求求各位帮忙看一下!可能问题有描述不清的地方,我会尽力解释的。PS:积分用完了,之后赚回来再悬赏吧
多是版本的问题。我也遇到相同的问题,后来将pytorch的版本降低,并且降低了cudatoolkit的版本之后,就可以跑了。