Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
16557 Discussions

openCL example on yocto image on cyclone 5 SOC

Altera_Forum
Honored Contributor II
1,811 Views

I've been trying to run vector_add opencl exmaple to run on cyclone 5 SOC. It is perfectly working if I use default linux image given in Intel FPGA SDK for OpenCL. As default linux is compiled using gcc-linaro 4.7. I have compiled openCL example with gcc-linaro 4.7 and whole setup is perfectly working. 

Now I've setup yocto build environment for cyclone 5 SOC which is using gcc-linaro 5.2 and linux-altera-ltsi 4.1. I am using rootfs, zImage and dtb from yocto build and the opencl.rbf form default image. I have compiled vector_add example with gcc-linaro 5.2. I have also compiled opencl linux kernel module with gcc-linaro 5.2 and put it into /home/root directory as suggested by ug_aocl_c5soc_devkit_platform.pdf. I have used the same setup which I used with working setup. So there is no issue of misplacing file. 

 

Cyclone 5 SOC perfectly boots with this image. But when I try to install the aclsoc_drv.ko using init_opencl.sh, I got the execption as follows and board get hang. 

root@cyclone5:~# source ./init_opencl.sh 

[ 63.911143] INFO: rcu_sched self-detected stall on CPU 

[ 63.916285] 0: (1 GPs behind) idle=e6f/140000000000002/0 softirq=2567/2568 fqs=2092 

[ 63.924077] (t=2100 jiffies g=1184 c=1183 q=154) 

[ 63.928859] Task dump for CPU 0: 

[ 63.932073] insmod R running 0 865 839 0x00000002 

[ 63.938451] [<c0018968>] (unwind_backtrace) from [<c0013a6c>] (show_stack+0x20/0x24) 

[ 63.946174] [<c0013a6c>] (show_stack) from [<c004eb74>] (sched_show_task+0xb4/0x108) 

[ 63.953890] [<c004eb74>] (sched_show_task) from [<c0051c58>] (dump_cpu_task+0x48/0x50) 

[ 63.961781] [<c0051c58>] (dump_cpu_task) from [<c007226c>] (rcu_dump_cpu_stacks+0xa4/0xe4) 

[ 63.970015] [<c007226c>] (rcu_dump_cpu_stacks) from [<c0075738>] (rcu_check_callbacks+0x570/0x8ac) 

[ 63.978940] [<c0075738>] (rcu_check_callbacks) from [<c007a080>] (update_process_times+0x4c/0x74) 

[ 63.987782] [<c007a080>] (update_process_times) from [<c008b478>] (tick_sched_timer+0x78/0x268) 

[ 63.996445] [<c008b478>] (tick_sched_timer) from [<c007aeb0>] (__run_hrtimer+0x90/0x1bc) 

[ 64.004503] [<c007aeb0>] (__run_hrtimer) from [<c007b284>] (hrtimer_interrupt+0x140/0x31c) 

[ 64.012735] [<c007b284>] (hrtimer_interrupt) from [<c0017c34>] (twd_handler+0x40/0x50) 

[ 64.020628] [<c0017c34>] (twd_handler) from [<c006be3c>] (handle_percpu_devid_irq+0x90/0x124) 

[ 64.029119] [<c006be3c>] (handle_percpu_devid_irq) from [<c006785c>] (generic_handle_irq+0x3c/0x4c) 

[ 64.038128] [<c006785c>] (generic_handle_irq) from [<c0067b68>] (__handle_domain_irq+0x6c/0xc4) 

[ 64.046790] [<c0067b68>] (__handle_domain_irq) from [<c0009480>] (gic_handle_irq+0x34/0x6c) 

[ 64.055106] [<c0009480>] (gic_handle_irq) from [<c0014600>] (__irq_svc+0x40/0x54) 

[ 64.062553] Exception stack(0xce76fa78 to 0xce76fac0) 

 

 

Does anyone have idea what I am doing wrong? I am very new to this cyclone 5 SOC and opencl.
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
660 Views

I have had this exact same problem! I've been trying to get custom Linux working with OpenCL for a while now and it looks like I've taken a similar approach to you. Unfortunately I haven't got anything functional, but maybe together we can figure this thing out. 

 

I have noticed 3 consistent failure modes: 

 

1. System hangs on `insmod` (like you) 

2. I can insert the driver, but running the host program (eg. ./host) fails and gives `Unhandled fault: imprecise external abort` 

3. I can successfully run my host code, but there is a 1s delay before the kernel returns. (I believe I have only got kernel 4.3 with Yocto jethro to do this, but I would have to double check) 

 

Have you seen either of these other failure modes?
0 Kudos
Altera_Forum
Honored Contributor II
660 Views

I haven't noticed# 2 &# 3. May be I will get that when I will solve# 1. 

I thought you've made it working. I was following your another thread where you made it. 

 

https://alterawiki.com/forum/showthread.php?t=54724&p=223118
0 Kudos
Altera_Forum
Honored Contributor II
660 Views

I've only got it working to a degree unfortunately, I can't seem to get past# 3 above.

0 Kudos
Altera_Forum
Honored Contributor II
660 Views

What OS are you using? I've tried in Ubuntu 16.04, CentOS 6.3 and 6.8

0 Kudos
Reply