Closed mmchen88 closed 5 years ago
minicaffe 没有适配 cuda 9
简单的解决办法是,Cuda.cmake中手设定__nvcc_out
,例如:
if(__nvcc_res EQUAL 0)
# nvcc outputs text containing line breaks when building with MSVC.
# The line below prevents CMake from inserting a variable with line
# breaks in the cache
#string(REGEX MATCH "([1-9].[0-9])" __nvcc_out "${__nvcc_out}")
#string(REPLACE "2.1" "2.1(2.0)" __nvcc_out "${__nvcc_out}")
#set(CUDA_gpu_detect_output ${__nvcc_out} CACHE INTERNAL "Returned GPU architetures from mshadow_detect_gpus tool" FORCE)
set(__nvcc_out "5.2")
set(CUDA_gpu_detect_output ${__nvcc_out} CACHE INTERNAL "Returned GPU architetures from mshadow_detect_gpus tool" FORCE)
else()
message(WARNING "Running GPU detection script with nvcc failed: ${__nvcc_out}")
endif()
手动指定GPU架构 cmake -DUSE_CUDA=ON -DUSE_CUDNN=ON -DCUDA_ARCH_NAME=Pascal
手动指定GPU架构
cmake -DUSE_CUDA=ON -DUSE_CUDNN=ON -DCUDA_ARCH_NAME=Pascal
It works, thank you!
win10平台,安装CUDA9.2,编译失败,提示如下: 1>------ 已启动生成: 项目: ZERO_CHECK, 配置: Release x64 ------ 1> Checking Build System 1> CMake does not need to re-run because E:/mini-caffe-master/build_gpu/CMakeFiles/generate.stamp is up-to-date. 2>------ 已启动生成: 项目: caffe, 配置: Release x64 ------ 2> Building Custom Rule E:/mini-caffe-master/CMakeLists.txt 2> CMake does not need to re-run because E:\mini-caffe-master\build_gpu\CMakeFiles\generate.stamp is up-to-date. 2> Building NVCC (Device) object CMakeFiles/cuda_compile_1.dir/src/util/Release/cuda_compile_1_generated_bbox_util.cu.obj 2> nvcc fatal : Unsupported gpu architecture 'compute_92' 2> 2> CMake Error at cuda_compile_1_generated_bbox_util.cu.obj.Release.cmake:222 (message): 2> Error generating 2> E:/mini-caffe-master/build_gpu/CMakeFiles/cuda_compile_1.dir/src/util/Release/cuda_compile_1_generated_bbox_util.cu.obj 2> 2> 2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: “cmd.exe”已退出,代码为 1。 ========== 生成: 成功 1 个,失败 1 个,最新 0 个,跳过 0 个 ==========
请问该如何解决呢?