Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open cl environment #26

Open
18521613 opened this issue Mar 17, 2021 · 19 comments
Open

Open cl environment #26

18521613 opened this issue Mar 17, 2021 · 19 comments

Comments

@18521613
Copy link

18521613 commented Mar 17, 2021

Hi @thinkoco
Could you tell me how can create De1-SoC linux image with OpenCL driver and init_opencl_.sh file? I have spent a lot of time looking for any documents about it but i couldn't find anything!
Thanks you!

@thinkoco
Copy link
Owner

thinkoco commented Mar 19, 2021 via email

@18521613
Copy link
Author

hi @thinkoco,
I want to build my sdcard so i have tried to do your B option with socfpga-opencl_4.1.22 branch on your git. But when i use cp config_opencl .config , the system informs that no file such a config_opencl or .config file. I have clicked on show hidden file but there is no file named config_opencl or .config

@thinkoco
Copy link
Owner

@18521613
Hi, the socfpga-3.18 is a stable branch for opencl.
Also, linux 4.9 and 4.19 has been tested with modified opencl driver.Here are some guides.
https://github.com/thinkoco/c5soc_opencl_rte/blob/master/documents/How_to_do.md

@18521613
Copy link
Author

@thinkoco I'm following your guides: https://github.com/thinkoco/c5soc_opencl_rte/blob/master/documents/How_to_do.md with linux 4.9. But when I'd used command make zImage, i got this error
image

@thinkoco
Copy link
Owner

hi @18521613
have you check out the socfpga-4.9.78-aoc barnch ?

git clone --depth 3 --branch socfpga-4.9.78-aocl https://github.com/thinkoco/linux-socfpga.git
export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabihf-
export LOADADDR=0x8000
make c5socl_defconfig
make zImage -j4
make modules
make socfpga_cyclone5_de10_nano.dtb

@18521613
Copy link
Author

18521613 commented Mar 21, 2021

hi @18521613
have you check out the socfpga-4.9.78-aoc barnch ?

git clone --depth 3 --branch socfpga-4.9.78-aocl https://github.com/thinkoco/linux-socfpga.git
export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabihf-
export LOADADDR=0x8000
make c5socl_defconfig
make zImage -j4
make modules
make socfpga_cyclone5_de10_nano.dtb

Yes, the last picture i sent to you that is socfpga-4.9.78-aocl branch and when i used make zImage -j4 i got the same error. And i have a question that do i have to do Update linux kernel part in your guide: https://github.com/thinkoco/c5soc_opencl_rte/blob/master/documents/How_to_do.md with socfpga-4.9.78-aocl branch
And one more when i try with linux 4.19 i also got this error:
image

@thinkoco
Copy link
Owner

@18521613
for linux 4.9, no need to update files after checkout the socfpga-4.9.78-aocl branch

git clone --depth 3 --branch socfpga-4.9.78-aocl https://github.com/thinkoco/linux-socfpga.git
export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabihf-
export LOADADDR=0x8000
make c5socl_defconfig
make zImage -j4
make modules
make socfpga_cyclone5_de10_nano.dtb

for linux 4.19, update the driver files , makefile and kconfig

@18521613
Copy link
Author

18521613 commented Apr 8, 2021

Hi @thinkoco,
I have built my sd card image with opencl driver successfully. But when i try to execute hello_world example of BSP(Board Support Package) for Altera SDK OpenCL 18.1 from terasic (http://download.terasic.com/downloads/cd-rom/de1-soc/linux_BSP/OPENCL18.1/DE1-SoC_OpenCL_BSP.zip) i got this error:
image
Do you know the way to solve this error? Thanks you!

@thinkoco
Copy link
Owner

thinkoco commented Apr 9, 2021

@18521613
maybe, the sdcard is unpluged when data copying. just fix it by fsck

@tungdt113
Copy link

@18521613
maybe, the sdcard is unpluged when data copying. just fix it by fsck

Thanks for your help, I have solved that issue. But i got another issue :(. I have run init_opencl_18.1_4.19.sh but when i try to execute hello_world.aocx the system inform that Couldn't open /dev/ac10 device! Did you load the driver?
image

And when i run ls /dev there is no ac10 here! Do you know anything about this?
image

Thank you!

@thinkoco
Copy link
Owner

@tungdt113
Hi, the opencl driver should be rebuild when running with a new zImage.

  1. dowload the runtime enviroment files here.
    https://github.com/thinkoco/c5soc_opencl_rte/blob/master/linux-4.19.x/opencl_rte/aocl-rte-18.1.0-625.arm32.4.19.tar.xz
  2. here is the guide for buiding opencl driver
export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabihf-
cd  xxxxxx/aocl-rte-18.1.0-625.arm32.4.19/board/c5soc/arm32/driver
make KDIR=xxxxxx/linux-socfpga

@18521613
Copy link
Author

Hi @thinkoco,
I have built opencl driver and copy it to /home/root in partiotion 2 of sdcard, but it not working..

@thinkoco
Copy link
Owner

Hi @18521613
you may change the path in the init_opencl_18.1_4.19 .sh for your case , or copy it to $AOCL_BOARD_PACKAGE_ROOT/arm32/driver/

#!/bin/bash
export INTELFPGAOCLSDKROOT=/root/aocl-rte-18.1.0-625.arm32.4.19
export AOCL_BOARD_PACKAGE_ROOT=$INTELFPGAOCLSDKROOT/board/c5soc
export PATH=$INTELFPGAOCLSDKROOT/bin:$PATH
export LD_LIBRARY_PATH=$INTELFPGAOCLSDKROOT/host/arm32/lib:$AOCL_BOARD_PACKAGE_ROOT/arm32/lib:$LD_LIBRARY_PATH
insmod $AOCL_BOARD_PACKAGE_ROOT/arm32/driver/aclsoc_drv.ko
#export CL_CONTEXT_COMPILER_MODE_INTELFPGA=3

@tungdt113
Copy link

tungdt113 commented May 31, 2021

Hi @thinkoco,
i have tried to build OpenCL driver like this guide: https://github.com/thinkoco/c5soc_opencl/blob/master/documents/LinuxAndDrivers.md. I have downloaded Intel FPGA Runtime Environment for OpenCL Linux Cyclone V SoC TGZ 17.1 on Altera Download Website. And I build it for kernel 3.18 like your image: c5soc_opencl_lxde_fpga_reconfigurable_20201027.img. But when I try to test my OpenCL driver on your image. I got this error like this:
image
P/s: I've download kernel3.18 in your git: https://github.com/thinkoco/linux-socfpga/tree/socfpga-3.18

@18521613
Copy link
Author

18521613 commented Jun 18, 2021

@thinkoco I'm following your guides: https://github.com/thinkoco/c5soc_opencl_rte/blob/master/documents/How_to_do.md with linux 4.9. But when I'd used command make zImage, i got this error
image

Hi @thinkoc,
I have built another image with linuxs-socfpga 4.9.78-ltsi so my zImage doesn't change fpga bridges name for aclsoc driver. I hope you could help me solve this error.
Thank you!!

@thinkoco
Copy link
Owner

@18521613
the error occurs when using gcc 5.0 and above, it has been fixed. you can checkout the lastest code on branch socfpga-4.9.78-aocl

@tungdt113
Copy link

tungdt113 commented Jun 19, 2021

@thinkoco
i have a question that if i can use socfpga_cyclone5_de1soc.dts from socfpga-3.18 branch to build socfpga_cyclone5_de1soc.dtb for socfpga-4.9.78-aocl ??

@tungdt113
Copy link

tungdt113 commented Jun 19, 2021

@18521613
the error occurs when using gcc 5.0 and above, it has been fixed. you can checkout the lastest code on branch socfpga-4.9.78-aocl

@thinkoco,
I've rebuild with your update, it builds successfully. But when i boot this zImage with socfpga.dtb for de1soc that i take from your image: c5soc_opencl_lxde_fpga_reconfigurable_20201027.img. It seemly don't add /dev/fpga0 char driver and file operations. And i saw you change something in c5soc_opencl_rte/blob/master/socfpga-4.9.78-ltsi/include/linux/fpga/fpga-mgr.h, but i did'n see any change in fpga-mgr.h of socfpga-4.9.78-aocl branch
image
And there are some warnings when i build zImage with your update. Is there anything problem with this??
image

@thinkoco
Copy link
Owner

thinkoco commented May 5, 2022

@tungdt113
yes, it’s here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants