ubuntu 编译darknet error: ‘__args_arr’ was not declared in this scope

今天 在编译darknet的时候,出现了下面的错误:

/usr/local/cuda/include/crt/host_runtime.h:19:2: warning: #warning "crt/device_functions.h is an internal header file and must not be used directly.  Please use cuda_runtime_api.h or cuda_runtime.h instead." [-Wcpp]
 #warning "crt/device_functions.h is an internal header file and must not be used directly.  Please use cuda_runtime_api.h or cuda_runtime.h instead."
  ^~~~~~~
/tmp/tmpxft_000057f7_00000000-5_convolutional_kernels.compute_52.cudafe1.stub.c: In function ‘void __device_stub__Z15binarize_kernelPfiS_(float*, int, float*)’:
/tmp/tmpxft_000057f7_00000000-5_convolutional_kernels.compute_52.cudafe1.stub.c:13:87: error: ‘__args_arr’ was not declared in this scope
 __Z15binarize_kernelPfiS_(float *__par0, int __par1, float *__par2){__cudaSetupArgSimple(__par0, 0UL);__cudaSetupArgSimple(__par1, 8UL);__cudaSetupArgSimple(__par2, 16UL);__cudaLaunch(((char *)((void ( *)(float *, int, float *))binarize_kernel)));}
                                                                     ^
compilation terminated due to -Wfatal-errors.
Makefile:92: recipe for target 'obj/convolutional_kernels.o' failed
make: *** [obj/convolutional_kernels.o] Error 1

我的编译命令为:

cd darknet && cp  Makefile-GPU Makefile && make

解决方法

ifeq ($(GPU), 1) 
COMMON+= -DGPU -I/usr/local/cuda-9.0/include/
CFLAGS+= -DGPU
LDFLAGS+= -L/usr/local/cuda-9.0/lib64 -lcuda -lcudart -lcublas -lcurand
endif

把Makefile-GPU的关于cuda的配置指向你cuda路径就行了,我的是cuda-9.0

参考文献

[1].failing to compile with GPU=1 #200. https://github.com/pjreddie/darknet/issues/200

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

农民小飞侠

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值