在编译caffe后使用 make runtest时候,会出现一些这样的问题,实际上问题是出现在makefile.config中的。。。
F0221 16:54:21.855986 11564 im2col.cu:49] Cuda kernel failed. Error: invalid device function
*** Check failure stack trace: ***@ 0x7f2556cc1b4d google::LogMessage::Fail()
@ 0x7f2556cc5b67 google::LogMessage::SendToLog()
@ 0x7f2556cc39e9 google::LogMessage::Flush()
@ 0x7f2556cc3ced google::LogMessageFatal::~LogMessageFatal()
@ 0x463bf2 caffe::im2col_gpu<>()
@ 0x452031 caffe::ConvolutionLayer<>::Forward_gpu()
@ 0x41288f caffe::Layer<>::Forward()
@ 0x41c9be caffe::ConvolutionLayerTest_TestSimpleConvolution_Test<>::TestBody()
@ 0x43becd testing::internal::HandleExceptionsInMethodIfSupported<>()
@ 0x42dab1 testing::Test::Run()
@ 0x42db97 testing::TestInfo::Run()
@ 0x42dcd7 testing::TestCase::Run()
@ 0x432bdf testing::internal::UnitTestImpl::RunAllTests()
@ 0x43ba7d testing::internal::HandleExceptionsInMethodIfSupported<>()
@ 0x42d0da testing::UnitTest::Run()
@ 0x40f774 main
@ 0x318ae1ecdd (unknown)
@ 0x40f4c9 (unknown)
/bin/sh: line 1: 11564 Aborted (core dumped) $testbin 0
把里面的编译条件设置一下!
我的是gtx980m,所以设置了52,如果不具备5.2的,就用5.0吧。
CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \
-gencode arch=compute_20,code=sm_21 \
-gencode arch=compute_30,code=sm_30 \
-gencode arch=compute_35,code=sm_35 \
-gencode arch=compute_50,code=sm_50 \
-gencode arch=compute_52,code=sm_52