Closed ArjunaDeSoysa closed 6 years ago
Dear @thinkoco do you know how to slove this problem?
@ArjunaDeSoysa So, you have use the opencl sdk 16.0 runtime file and rebuild driver? It's recommend to use sdk 16.1 runtime file. Also, CMA, Altera FPGA firmware downlaod module, fpga-bridge ,socfpga bridge driver are needed. OpenCL driver should be rebuilt. The device tree should contains the fpga-bridge and fpga manager descriptions.and so on
@thinkoco yes i use opencl sdk 16.1 runtime file in host computer. But in terasic site there's only have BSP(Board Support Package) for Altera SDK OpenCL 16.0. i saw that someone say that it is okay for this pipeCNN.
@ArjunaDeSoysa Also, you can use my SD card image c5soc_opencl_lxde_all_in_one_180317.img. Just need to replace the dtb with no vga one here and delete the CL_CONTEXT_COMPILER_MODE_ALTERA=3 flag in the init_opencl16.1.sh file.
Okay I'll try that. Thank you very much @thinkoco.
@ArjunaDeSoysa here is the x2go setting. check the host IP on board. login user: knat password: knat. use sudo su to get root privileges
@thinkoco , 1) Do i want to replace the socfpga_cyclone5_de1soc_novga.dtb with socfpga.dtb or de1soc_socfpga.dtb(inside the de1soc folder )?
2) I use UART to USB cable so , username : knat and password : knat right?
i am really sorry for the bothering again and again.
@ArjunaDeSoysa cover the socfpga.dtb with socfpga_cyclone5_de1soc_novga.dtb , and keep the socfpga.dtb name. x2go user is knat, root for uart.
@thinkoco , Still i got same error,
root@C5SoC:~# source init_opencl_16.1.sh
root@C5SoC:~# cd cnn
root@C5SoC:~/cnn# ./run.exe conv.aocx
******************************************
An OpenCL-Based FPGA Accelerator for CNNs
******************************************
Platform: Intel(R) FPGA SDK for OpenCL(TM)
Using 1 device(s)
Device 0: de1soc_sharedonly_vga : Cyclone V SoC Development Kit
Device OpenCL Version: OpenCL 1.0 Intel(R) FPGA SDK for OpenCL(TM), Version 16.1
Device Max Compute Units: 1
Device Max WorkGroup Size: 2147483647
Device Max WorkItem Size: 2147483647
Device Global Memory Size: 512 MBytes
Device Local Memory Size: 16 KBytes
Device Max Clock Freq: 1000 Mhz
Loading kernel/binary from file conv.aocx
ERROR: CL_INVALID_BINARY
Location: ../common/ocl_util.cpp:415
Failed to create program with binary
at the beginning(not only this time) there's not appear in this part below ;
61063552 total weights read
154587 bytes image read
1024 total output reference read
i tried various thing. can you please help me to solve this?
@thinkoco , you are right. i check aocl board-xml-test
in the host computer, the result is in given below;
arjuna@arjuna-Inspiron-3542:~$ source /etc/profile
arjuna@arjuna-Inspiron-3542:~$ aocl board-xml-test
board-path = /home/arjuna/intelFPGA/16.1/hld/board/terasic/de1soc
board-version = 13.0
board-name = de1soc
board-default = de1soc
board-hw-path = /home/arjuna/intelFPGA/16.1/hld/board/terasic/de1soc/./de1soc
board-link-flags = -L/home/arjuna/intelFPGA/16.1/hld/board/terasic/de1soc/arm32/lib -L/home/arjuna/intelFPGA/16.1/hld/host/arm32/lib
board-libs = -lalterammdpcie -lstdc++
board-util-bin = /home/arjuna/intelFPGA/16.1/hld/board/terasic/de1soc/arm32/bin
The bord-version is 13.0. As you said, that is the problem. i download DE1-SoC OpenCL BSP(Board Support Package) in terrasic site hear. I serched BSP 16.1 to download and i coulden't find it.
Can you please send me the link , where can i download DE1-SoC OpenCL BSP(Board Support Package) for 16.1 .?
@ArjunaDeSoysa it seems to be the board xml or hardware template version. It's not the SDK version. Before you building and running the host, check not setting the CL_CONTEXT_EMULATOR_DEVICE_ALTERA flag.Also ,some other flags.I have test the PipeCNN on my baord with my sd card image , It's OK. if I set CL_CONTEXT_EMULATOR_DEVICE_ALTERA = 1 and run, get you same error. Maybe, not your same issue, but you can check it.
you need firstly to reprogram the fpga manually on the DE1 platform
Prof. @doonny did you mean,
run aocl program /dev/acl0 conv.aocx
before ./run.exe conv.aocx
?
yes
you could also use aocl diagnose to verify that you have the right driver installed.
yes it worked. Thank you very much thinkoco and Prof. doonny
Dear @thinkoco , i Tried your sd image in 16.1. Then i get ,
source init_opencl_16.1.sh
command type,
it get stuck. can you please help me to solve this issue?
Hi @doonny , @thinkoco , I am using the OpenCL SDK v17.1, and having the same error. What shall I do??
Dear @doonny , @thinkoco , @Fnajjar When i compile the ./run.exe conv.aocx (two generate file from the host computer) in my arm based de1-soc FPGA, the error occurs,
Loading kernel/binary from file conv.aocx
ERROR: CL_INVALID_BINARY
Location: ../common/ocl_util.cpp:415
Failed to create program with binary
and in location : ../common/ocl_util.cpp:415 there is;
#ifdef FPGA_DEVICE
cl_program program = clCreateProgramWithBinary(context, num_devices,devices, binary_lengths,
(const unsigned char **) binaries.get(), binary_status, &status);
checkError(status, "Failed to create program with binary");
So i think the problem is inconst unsigned char **
. Because I found some differences in x86 and arm32. Can you please help me to slove this problem?
@DasunBhanuka If you use the opencl-vga based bsp to build you kernel.see the steps here and known the limits first.So you need update the rbf file. if you use the terasic's bsp and my sd card image, you can update the dtb with the no vga one and update the rbf file with top.tbf(rename to opencl.rbf).Also, remove the CL_CONTEXT_COMPILER_MODE_ALTERA flag in the init_opencl_16.1.sh file.
@Fnajjar PCIE based board ? you can try to test the runtime with the "aocl diagnose" or "aocl program" command first.
@thinkoco @doonny @Fnajjar If I rename the folder 'de1soc_sharedonly' to 'de1soc', will the following get resolved?
Loading kernel/binary from file conv.aocx
ERROR: CL_INVALID_BINARY
Location: ../common/ocl_util.cpp:415
Failed to create program with binary
@DasunBhanuka No.
Hey @thinkoco, @DasunBhanuka
I tried the instruction but still have the same error
What do you think?
@thinkoco @Fnajjar @aazz44ss @doonny
I am getting the exact same error just like this.. even though I am running OpenCl 16.1 Can you give us another idea?
@Fnajjar There may be some difference in conv.aocx
@thinkoco , actually i did the commandes and it seems that there 's no ".acl.board_spec.xml "
@Fnajjar nothing in the .acl.board ? Is this an emulater .aocx file? So,you want to run emulater for Arria 10 GX board on PC?
@thinkoco, yes it is, is that possible to run emulater for Arria 10 GX board on PC? How shall I know is there anythiong in the .acl.board ? I tried "aocl binedit conv.aocx get .acl.board board.xml && cat board.xml" and I've got nothing
@Fnajjar It seem to be an emulater .aocx file, there is no .acl.fpga.bin in the conv.aocx. if emulater, try "export CL_CONTEXT_EMULATOR_DEVICE_ALTERA=1" before running host. This command(aocl binedit conv.aocx get .acl.board board.txt) will get .acl.board to board.txt. I seem that DE5a-Net is Arria 10 GX chip, but I have little experience for emulatering based on this chip.
thank you @thinkoco , I did it and this time I have different error, is that because there is no "bin_file_r" What shall I do? please find the screenshot below!
@thinkoco, actually I have already uploaded them "/home/najjar/Documents/PipeCNN-master/data", besides of the data_vgg16 and data_alex *the problem is that it's not beeing detected or can't been found
@Fnajjar Also, data_alex is needed.see the host code and the path
const char *weight_file_path = "./data/data_alex/weights.dat";
const char *input_file_path = "./data/data_alex/image.dat";
const char *ref_file_path = "./data/data_alex/fc8.dat";
const char *dump_file_path = "./result_dump.txt";
Dear @thinkoco
How to check this in fpga,
aocl binedit conv.aocx list "aocl binedit conv.aocx get .acl.board_spec.xml board.xml && cat board.xml
as you said..
@thinkoco thank you very much for your help acctually it works! I already uploded the data_alex. I moved the files "conv.aocx" and the "run.exe" in the folloing path "/home/najjar/Documents/PipeCNN-master" and it worked!
@Fnajjar if you able to complete the HW emulation also you can help to @DasunBhanuka to get it work. cause you both have same problem right. Thank You.
@Fnajjar Can you please explain how you made it work, after that error..
@DasunBhanuka, well when I had the "ERROR: CL_INVALID_BINARY" I just used the command line "export CL_CONTEXT_EMULATOR_DEVICE_INTELFPGA" and then, it still couldn't find the weights even though, I had the data in the wright directories. So, I just moved the two files "conv.aocx" and the "run.exe" in the folloing path "/home/user/Documents/PipeCNN-master" and it worked!
@Fnajjar Will you also try this using a FPGA hardware?
well now since it's working on emulator, I am going to implement it on a Attila Arria 10 Gx but, I am trying to know how to do that? Do you have an idea??
@Fnajjar I am currently trying to implement it on Altera DE1SoC. If it works, I'll tell you..
@DasunBhanuka Sorry for no indicating that aocl diagnose on de1soc and aocl binedit on PC
Dear @thinkoco can you please explain how to do aocl diagnose on de1soc and aocl binedit.. It would be a great help..
@DasunBhanuka 1.you can use "aocl diagnose" command after sourcing the opencl initial shell file on de1soc.
Dear @thinkoco I did as you said.. Here's the result
Dear @thinkoco why do you think I get the error No such file or directory
Or Am I missing something here?
@DasunBhanuka Hi, you can cd to the folder which contians conv.aocx first .Also,read permissions of this file
@thinkoco Can you send me the files you created for DE1SoC? conv.aocx & run.exe Will they be compatible with my board?
I suggest first trying to run the official examples from Terasic. If the examples are ok, PipeCNN should be the same.
Dear Prof. @doonny , I use De1-SoC and Angstrom v2014.12 - Kernel , I changed,
const char *vendor_name = "altera";
in derictory ../project/host/main.cpp because of when *vendor_name = "Intel" there was Error "Unable to find the desired OpenCL platform."now there is new error;
So i want to know, There are another things do i want to change ? (because of changing
const char *vendor_name = "altera";
)?Thank You