2018-08-28-darknet-cannot-compile-gpu-1

titlecategorylayouttagsdate
darknet:cannot compile with gpu=1
dl
post
Pytorch
dl
2018-08-28 17:26:24

问题描述

在编译dartnet的时候设置GPU=1的时候编译出现错误:

compilation terminated due to -Wfatal-errors.
Makefile:91: recipe for target 'obj/crop_layer_kernels.o' failed
make: *** [obj/crop_layer_kernels.o] Error 1
/usr/include/string.h: In function ‘void* __mempcpy_inline(void*, const void*, size_t)’:
/usr/include/string.h:652:42: error: ‘memcpy’ was not declared in this scope
   return (char *) memcpy (__dest, __src, __n) + __n;
                                          ^
compilation terminated due to -Wfatal-errors.
Makefile:91: recipe for target 'obj/avgpool_layer_kernels.o' failed
make: *** [obj/avgpool_layer_kernels.o] Error 1
/usr/include/string.h: In function ‘void* __mempcpy_inline(void*, const void*, size_t)’:
/usr/include/string.h:652:42: error: ‘memcpy’ was not declared in this scope
   return (char *) memcpy (__dest, __src, __n) + __n;
                                          ^
compilation terminated due to -Wfatal-errors.
Makefile:91: recipe for target 'obj/blas_kernels.o' failed
make: *** [obj/blas_kernels.o] Error 1

解决办法:

1.正确安装cuda,并设置cuda路径 2.Makefile中添加NVCC += -D_FORCE_INLINES 例如:

ifeq ($(GPU), 1) 
NVCC += -D_FORCE_INLINES
COMMON+= -DGPU -I/usr/local/cuda/include/
CFLAGS+= -DGPU
LDFLAGS+= -L/usr/local/cuda/lib64 -lcuda -lcudart -lcublas -lcurand
endif
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值