OpenCL with DE0-nano-SoC

I am trying to get OpenCL going on the DE0-nano-SoC, I’ve found a linux image that supports OpenCL finally and I am able to run the OpenCL demos shipped with that image, however when I try to run one of my own OpenCL programs I get the following error, so far my best guess is version mismatch in the libraries.

symbol lookup error: /home/root/opencl_arm32_rte/host/arm32/lib/libalteracl.so: undefined symbol: acl_hal_get_system_definition

If I grab the libraries from the shipped image and try to re-compile my host code aginst those I get a similar error:

libalteracl.so: undefined reference to `acl_hal_get_system_definition'

Any Ideas how I can get around this or what’s going on?

Similarly, I’ve been trying to get a custom image running using yocto, however so far I haven’t been successful. I can boot and run the init_opencl script which successfully inserts the aclsoc_drv. however when I try and run my program I get an error that hangs the system requiring a restart:

root@cyclone5:~# ./run_program
[   97.092354] Unhandled fault: imprecise external abort (0x406) at 0xbef4be34
[   97.099286] pgd = eeeec000
[   97.101980] [bef4be34] *pgd=2e7f1831, *pte=2df6c75f, *ppte=2df6cc7f
[   97.108256] Internal error: : 406 [#1] SMP ARM
[   97.112679] Modules linked in: aclsoc_drv(O)
[   97.116957] CPU: 1 PID: 808 Comm: host_pes_intel Tainted: G           O    4.3.0-altera #1
[   97.125181] Hardware name: Altera SOCFPGA
[   97.129174] task: eef18000 ti: ee7e4000 task.ti: ee7e4000
[   97.134556] PC is at aclsoc_rw+0x1f8/0x42c [aclsoc_drv]
[   97.139760] LR is at aclsoc_rw+0x1c8/0x42c [aclsoc_drv]
[   97.144964] pc : [<bf000ec4>]    lr : [<bf000e94>]    psr: 200e0013
[   97.144964] sp : ee7e5e48  ip : 00004bda  fp : ee7e5ec4
[   97.156386] r10: 00000001  r9 : 00000002  r8 : eec34000
[   97.161587] r7 : 00000008  r6 : 00000000  r5 : f020c870  r4 : f020c870
[   97.168083] r3 : 00000000  r2 : c07ca100  r1 : 00000000  r0 : ffffb0bb
[   97.174581] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
[   97.181682] Control: 10c5387d  Table: 2eeec04a  DAC: 00000051
[   97.187401] Process host_pes_intel (pid: 808, stack limit = 0xee7e4218)
[   97.193984] Stack: (0xee7e5e48 to 0xee7e6000)
[   97.198325] 5e40:                   ee7e5e7c 00000001 00000000 00000000 ee7e4000 eed8d634
[   97.206469] 5e60: 00000000 eec34000 00000000 00000008 00000008 bef4c468 eee77910 00000000
[   97.214611] 5e80: 00000002 00000000 0000c870 bef4c468 00000008 00000000 ee50e9c0 ee50e9c0
[   97.222754] 5ea0: bf0010f8 ee7e5f80 00000018 c000fe04 ee7e4000 00000000 ee7e5edc ee7e5ec8
[   97.230896] 5ec0: bf00111c bf000cd8 00000001 ee9eb5d8 ee7e5f4c ee7e5ee0 c0128bd4 bf001104
[   97.239038] 5ee0: 00000000 00000000 00000000 ee7e5ef0 eee52300 eed74d40 00000000 c0146730
[   97.247182] 5f00: 00000001 c01377f8 c07cad34 ee460000 ee50e9c0 c012942c 00000020 eeeac478
[   97.255323] 5f20: ee50e9c8 c0146a2c bef4c410 ee50e9c0 ee7e5f80 00000018 c000fe04 ee7e4000
[   97.263465] 5f40: ee7e5f7c ee7e5f50 c0129448 c0128ba4 c0139a14 c01469bc ee50e9c0 ee50e9c0
[   97.271607] 5f60: bef4c410 00000018 c000fe04 ee7e4000 ee7e5fa4 ee7e5f80 c0129d5c c01293cc
[   97.279748] 5f80: 00000000 00000000 b5916124 00020658 b619e000 00000003 00000000 ee7e5fa8
[   97.287891] 5fa0: c000fc40 c0129d14 b5916124 00020658 00000003 bef4c410 00000018 bef4c410
[   97.296035] 5fc0: b5916124 00020658 b619e000 00000003 0001ff48 b6eeacd0 0001ff88 b619e408
[   97.304176] 5fe0: 00000000 bef4c3fc b5902865 b56633a0 600e0010 00000003 00000000 00000000
[   97.312330] [<bf000ec4>] (aclsoc_rw [aclsoc_drv]) from [<bf00111c>] (aclsoc_read+0x24/0x2c [aclsoc_drv])
[   97.321778] [<bf00111c>] (aclsoc_read [aclsoc_drv]) from [<c0128bd4>] (__vfs_read+0x3c/0xe4)
[   97.330183] [<c0128bd4>] (__vfs_read) from [<c0129448>] (vfs_read+0x88/0x114)
[   97.337290] [<c0129448>] (vfs_read) from [<c0129d5c>] (SyS_read+0x54/0xb0)
[   97.344145] [<c0129d5c>] (SyS_read) from [<c000fc40>] (ret_fast_syscall+0x0/0x3c)
[   97.351598] Code: e3a06000 ea000007 e5943000 f57ff04f (e5883000)
[   97.357664] ---[ end trace 469ffa07e79f531b ]---
[   97.362823] aclsoc_close (191):
[   97.365887] aclsoc = eed8d600, pid = 808, dma_idle = 1[   97.371011]