FPGA, SoC, And CPLD Boards And Kits
FPGA Evaluation and Development Kits
5921 Discussions

aocl install fails with compile error

okramer
New Contributor I
1,270 Views

I am trying to install an a10GX dev board on my Ubuntu 16.04 box, but when I get to the point of running `aocl install`, I get the following output with error:

$ aocl install Do you want to setup the FCD at directory /opt/Intel/OpenCL/Boards [Y/n] aocl install: Setting up the FPGA Client Driver (FCD) to the system. This process may require admin privilege Install the FCD file to /opt/Intel/OpenCL/Boards aocl install: Adding the board package /home/okramer/intelFPGA_pro/19.3/hld/board/a10_ref to the list of installed packages Installing the board package driver to the system. aocl install: Running install from /home/okramer/intelFPGA_pro/19.3/hld/board/a10_ref/linux64/libexec Looking for kernel source files in /lib/modules/4.4.0-164-generic/build Using kernel source files from /lib/modules/4.4.0-164-generic/build Building driver for BSP with name a10_ref make: Entering directory '/usr/src/linux-headers-4.4.0-164-generic' CC [M] /tmp/opencl_driver_r6J2oV/aclpci_queue.o CC [M] /tmp/opencl_driver_r6J2oV/aclpci.o CC [M] /tmp/opencl_driver_r6J2oV/aclpci_fileio.o CC [M] /tmp/opencl_driver_r6J2oV/aclpci_dma.o CC [M] /tmp/opencl_driver_r6J2oV/aclpci_pr.o /tmp/opencl_driver_r6J2oV/aclpci_pr.c: In function ‘aclpci_pr_s10’: /tmp/opencl_driver_r6J2oV/aclpci_pr.c:340:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] dma_mode_t dma_mode = 0; ^ CC [M] /tmp/opencl_driver_r6J2oV/aclpci_cmd.o /tmp/opencl_driver_r6J2oV/aclpci_cmd.c: In function ‘__aclpci_get_user_pages’: /tmp/opencl_driver_r6J2oV/aclpci_cmd.c:312:30: warning: passing argument 6 of ‘get_user_pages’ makes pointer from integer without a cast [-Wint-conversion] num_pages - got, 1, 1, ^ In file included from /tmp/opencl_driver_r6J2oV/aclpci_cmd.c:50:0: include/linux/mm.h:1243:6: note: expected ‘struct page **’ but argument is of type ‘int’ long get_user_pages(struct task_struct *tsk, struct mm_struct *mm, ^ /tmp/opencl_driver_r6J2oV/aclpci_cmd.c:313:10: warning: passing argument 7 of ‘get_user_pages’ from incompatible pointer type [-Wincompatible-pointer-types] p + got, vma); ^ In file included from /tmp/opencl_driver_r6J2oV/aclpci_cmd.c:50:0: include/linux/mm.h:1243:6: note: expected ‘struct vm_area_struct **’ but argument is of type ‘struct page **’ long get_user_pages(struct task_struct *tsk, struct mm_struct *mm, ^ /tmp/opencl_driver_r6J2oV/aclpci_cmd.c:309:10: error: too many arguments to function ‘get_user_pages’ ret = get_user_pages(target_task, target_task->mm, ^ In file included from /tmp/opencl_driver_r6J2oV/aclpci_cmd.c:50:0: include/linux/mm.h:1243:6: note: declared here long get_user_pages(struct task_struct *tsk, struct mm_struct *mm, ^ scripts/Makefile.build:285: recipe for target '/tmp/opencl_driver_r6J2oV/aclpci_cmd.o' failed make[1]: *** [/tmp/opencl_driver_r6J2oV/aclpci_cmd.o] Error 1 Makefile:1454: recipe for target '_module_/tmp/opencl_driver_r6J2oV' failed make: *** [_module_/tmp/opencl_driver_r6J2oV] Error 2 make: Leaving directory '/usr/src/linux-headers-4.4.0-164-generic' aocl install: failed. aocl install: Removing FCD aocl install: Removing the board package /home/okramer/intelFPGA_pro/19.3/hld/board/a10_ref from the list of installed packages

I got similar errors when building on Ubuntu 18.04, but managed to fix them following the recommendations by user Tyurin here. However, those fixes don't work on 16.04. But, more to the point, why am I getting any errors when 16.04 shows as compatible? What is the fix?

 

0 Kudos
8 Replies
MEIYAN_L_Intel
Employee
1,027 Views

Hi,

 

According to http://fpgasoftware.intel.com/requirements/19.3/, the Intel FPGA SDK for OpenCL is not supported in Ubuntu 18.04.

 

You are probably experiencing a conflict with the altera_cvp driver that is automatically installed with Ubuntu 16.04. 

 

Can you try the link below:

https://www.intel.com/content/altera-www/global/en_us/index/support/support-resources/knowledge-base/embedded/2018/why-does-aocl-diagnose-fail-to-find-device-on-ubuntu-16-04-5-lts.html

 

I would like to confirm with you that the kernel version used is 4.4.0-164? 

 

If the problem still persist, please tell me as well.

 

Thanks

0 Kudos
okramer
New Contributor I
1,027 Views

RE Ubuntu 18.04: I was hoping that it would be a simple fix to get that OS to support AOCL, but I guess not.

 

RE the compilation errors: I followed the support link but that addresses the issue with 'aocl diagnose'. I'm having a compile issue with the 'aocl install' command. I did run 'lspci -v | grep Altera' but found nothing. The kernel version is given in the compile output I posted above

Using kernel source files from /lib/modules/4.4.0-164-generic/build Building driver for BSP with name a10_ref make: Entering directory '/usr/src/linux-headers-4.4.0-164-generic'

I looked in /usr/src/linux-headers-4.4.0-164-generic/include/linux/mm.h and, sure enough, the API does not match what I'm seeing in aclpci_cmd.c. The latter has an extra "1" argument where there should be a "struct page **". Here's a snippet from aclpci_cmd.c (after removing the preproc macros for clarity):

ret = get_user_pages(target_task, target_task->mm, start_page + got * PAGE_SIZE, num_pages - got, 1, 1, p + got, vma);

while mm.h declares:

long get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long start, unsigned long nr_pages, unsigned int gup_flags, struct page **pages, struct vm_area_struct **vmas);

I think there is a typo in the aclpci_cmd.c. After removing the second "1", the install completes successfully. Now I run 'aocl list-devices' and get:

$ aocl list-devices -------------------------------------------------------------------- Warning: No devices attached for package: /home/okramer/intelFPGA_pro/19.3/hld/board/a10_ref --------------------------------------------------------------------

I actually got to this point on Ubuntu 18.04 after fixing even more compile issues there.

 

0 Kudos
MEIYAN_L_Intel
Employee
1,027 Views

Hi,

 

Regarding the problem as mentioned in the comment above, can you try to command "aocl flash"? I would like to know more information about this issue.

 

Thanks

 

0 Kudos
okramer
New Contributor I
1,027 Views

aocl flash doesn't find any device attached. See above for output of "list-devices"

0 Kudos
MEIYAN_L_Intel
Employee
1,027 Views

Hi,

You may be experiencing the problem I mentioned in my first comment. Please run through the procedure in this solution.

https://www.intel.com/content/altera-www/global/en_us/index/support/support-resources/knowledge-base/embedded/2018/why-does-aocl-diagnose-fail-to-find-device-on-ubuntu-16-04-5-lts.html

 

If that doesn’t solve the problem, then please redo step 4 and 5 of the previous section in https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/an/an807.pdf.  Be sure not to power off.

Program the FPGA on your Intel® Arria® 10 GX FPGA Development Kit with the top.sof file by running the following command:

quartus_pgm -c 1 -m JTAG -o “p;top.sof”

 

Perform a soft reboot (sometimes called a warm reboot) of your host system. On Linux systems, use the /sbin/reboot command to perform a soft reboot.

 

After rebooting, run the diagnostic

$aocl diagnose 

If that is successful, then continue to program the flash. If not, please power down the system and double check the jumpers.

 

Thanks

0 Kudos
MEIYAN_L_Intel
Employee
1,027 Views

Hi,

I got customers who facing the same problem.

This problem might be due to the Ubuntu kernel version.

Can you try to revert back to Ubuntu with kernel version: 4.4.0-138 which is more stable version?

Thanks

0 Kudos
okramer
New Contributor I
1,027 Views

I was able to successfully install with Ubuntu 16.04 kernel 4.15.0-72. A couple of points to possibly help others:

  1. I had to continuously set the clock speed to 6M via jtagconfig, not just the one time as described in AN807. Everytime the board's power is cycled, the clock has to be reset to 6M.
  2. aocl diagnose was failing the ICD tests but passing the BSP part. I found that the .icd files were not being copied to /etc/OpenCL/vendors by the install script, even though I was running as root with the aocl/quartus env set. After I manually copied $INTELFPGAOCLSDKROOT/icd/*.icd to /etc/OpenCL/vendors, the aocl diagnose ran successfully.

 

0 Kudos
MEIYAN_L_Intel
Employee
1,027 Views

Hi,

 

Thanks you for your update and I am glad that you have successfully install the OpenCL SDK software.

 

Thanks

0 Kudos
Reply