doonny / PipeCNN

An OpenCL-based FPGA Accelerator for Convolutional Neural Networks
Apache License 2.0
1.26k stars 369 forks source link

A few questions about emulation #108

Closed r0drigor closed 5 years ago

r0drigor commented 5 years ago

Hello, I have been able to compile the hardware and used it on my DE1-SoC, it works fine. I'm having some problems regarding the sw_emu compilation.

If I want to debug it in my laptop (x86) I should choose the x86 in the Makefile's "host architecture", correct? Whenever I do this I get this error: g++ ./host/main.o ../common/ocl_util.o ../common/timer.o -o run.exe -L/home/rodrigo/altera/16.0/hld/board/de1soc/arm32/lib -L/home/rodrigo/altera/16.0/hld/host/arm32/lib -L/home/rodrigo/altera/16.0/hld/host/linux64/lib -Wl,--no-as-needed -lalteracl -lalterammdpcie -lstdc++ -lelf /usr/bin/ld: skipping incompatible /home/rodrigo/altera/16.0/hld/board/de1soc/arm32/lib/libalteracl.so when searching for -lalteracl /usr/bin/ld: skipping incompatible /home/rodrigo/altera/16.0/hld/host/arm32/lib/libalteracl.so when searching for -lalteracl /usr/bin/ld: skipping incompatible /home/rodrigo/altera/16.0/hld/board/de1soc/arm32/lib/libalterammdpcie.so when searching for -lalterammdpcie /usr/bin/ld: skipping incompatible /home/rodrigo/altera/16.0/hld/host/arm32/lib/libalterammdpcie.so when searching for -lalterammdpcie /usr/bin/ld: cannot find -lalterammdpcie /usr/bin/ld: skipping incompatible /home/rodrigo/altera/16.0/hld/board/de1soc/arm32/lib/libelf.so when searching for -lelf /usr/bin/ld: skipping incompatible /home/rodrigo/altera/16.0/hld/host/arm32/lib/libelf.so when searching for -lelf collect2: error: ld returned 1 exit status Makefile:135: recipe for target 'run.exe' failed make: *** [run.exe] Error 1

I also tried to compile it with the arm32 architecture, tried to run it in the fpga cpu but it always prints "CL_OUT_OF_RESOURCES" which I guess comes from the DE1-SoC CPU limitations as it is a weak processing unit.

This is probably a fairly easy problem to solve.

r0drigor commented 5 years ago

I figured it out. If you're trying to compile for emulation, your target board can't be a SoC board (because it's arm32 architecture and your CPU is most likely x86) so all you need to do is change your export BOARD_PACKAGE to the s5_ref (remember to change the target architecture in the makefile as well), for example: export AOCL_BOARD_PACKAGE_ROOT=${ALTERAOCLSDKROOT}/board/s5_ref