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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章