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

Trouble loading recompiled aclsoc-drv.ko

Altera_Forum
Honored Contributor II
1,945 Views

I have na Altera Cyclone V dev board and I've used Yocto to build a new SD card image that includes some python functionality. Now I am trying to get OpenCL on the board as well. 

 

I've downloaded the opencl_arm32_rte and recompiled the driver against the kernel from the altera-opensource/linux-socfpga github that was used in the Yocto build. However, whenever I try to load the aclsoc_drv.ko with insmod I get a vermagic error. If I change the suffix used in the Yocto build (-altera) to match that of the linux-socfpga kernel against which I compiled the driver, then insmod hangs, I can't even send ctrl+c interrupt. 

 

 

Any idea why this hangs? or any advice on how to get OpenCL installed? 

 

 

0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
1,092 Views

Update, 

 

I used the `opencl.rbf` file from the prebuilt sd_card image, but what I missed in my first attempts was renaming that file. My linux console was looking for `soc_system.rbf` so I renamed the `opencl.rbf` to match and then managed to successfully install aclsoc_drv.ko. 

 

Of course I've hit my next wall now, I can't actually run any OpenCL programs on the FPGA: 

 

root@cyclone5:~# ./host ERROR: Unable to find Altera OpenCL platform. 

 

Any ideas on this one?
0 Kudos
Altera_Forum
Honored Contributor II
1,092 Views

For posterity, I will update myself again! 

 

I found this in the Intel FPGA SDK for OpenCL Release Notes document: 

 

desciption 

 

The Altera SDK for OpenCL platform is now the Intel FPGA SDK for OpenCL platform. As a result, if the cl_platform_id findPlatform(string_name) function in your host code looks for "Altera", "Altera SDK", or other similar strings, the findPlatform() call will return a NULL value. In some cases, you might not receive a NULL value from findPlatform(), but you will encounter a segmentation fault when running your application. When running design examples from previous versions, you might encounter the following error message: 'ERROR: Unable to find Altera OpenCL Platform' 

 

workaround 

 

Update your host code to instruct the findPlatform() function to search for "Intel(R) FPGA SDK for OpenCL", "Intel(R) FPGA SDK", or "Intel(R) FPGA". Do not limit the search string to just "Intel" because you might have other Intel platforms in your library path. Note: Version 16.1 of the OpenCL design examples have been updated to search for "Intel(R) FPGA" as the platform name.
0 Kudos
Altera_Forum
Honored Contributor II
1,092 Views

Hi bmorcos, 

 

I have also created a custome image using Yocto and recompiled the opencl_arm32_rte against 4.1.22-ltsi-altera kernel. I have loaded aclsoc_drv.ko without problems but when I try to launch aocl this is what I have: 

 

``` 

root@cyclone5:~# aocl version 

/home/root/aocl_rte/bin/aocl: line 110: /home/root/aocl_rte/host/arm32/bin/aocl: No such file or directory 

``` 

 

Did you experiment something similar, some help would be appreciated. 

 

Thanks
0 Kudos
Altera_Forum
Honored Contributor II
1,092 Views

I did not get this.  

 

Make sure that file exists in your directory, it doesn't need to be recompiled against the new kernel, you can copy these directly from the RTE files shipped from Altera.
0 Kudos
Altera_Forum
Honored Contributor II
1,092 Views

Please export following variable before you install aclsoc_drv.ko 

export ALTERAOCLSDKROOT=/home/root/opencl_arm32_rte 

export AOCL_BOARD_PACKAGE_ROOT=$ALTERAOCLSDKROOT/board/c5soc 

export PATH=$ALTERAOCLSDKROOT/bin:$PATH 

export LD_LIBRARY_PATH=$ALTERAOCLSDKROOT/host/arm32/lib:$LD_LIBRARY_PATH 

 

Also make sure you have all these folder available in your /home/root directory. If you don't have then you can download it from Altera site and then put the your compiled kernel module into those directory. I don't know exact location where to put .ko file but it is somewhere in driver directory. Hope this helps. 

 

 

--- Quote Start ---  

Hi bmorcos, 

 

I have also created a custome image using Yocto and recompiled the opencl_arm32_rte against 4.1.22-ltsi-altera kernel. I have loaded aclsoc_drv.ko without problems but when I try to launch aocl this is what I have: 

 

``` 

root@cyclone5:~# aocl version 

/home/root/aocl_rte/bin/aocl: line 110: /home/root/aocl_rte/host/arm32/bin/aocl: No such file or directory 

``` 

 

Did you experiment something similar, some help would be appreciated. 

 

Thanks 

--- Quote End ---  

0 Kudos
Reply