Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
1,026 Views

hello world launch hang - intel a10 FPGA

Hello,

 

I am trying to setup, compile run an hello world example. Below are the instructions I have followed, until launch kernel which just hangs there.

 

Please let me know if the setup instructions looks right any pointers to debug the kernel hang.

 

SETUP

-----

source /local/ramachandra.utah/inteldevstack/init_env.sh

export INTELFPGAOCLSDKROOT=/local/ramachandra.utah/inteldevstack/intelFPGA_pro/hld/

export ALTERAOCLSDKROOT=/local/ramachandra.utah/inteldevstack/intelFPGA_pro/hld/

source /local/ramachandra.utah/inteldevstack/intelFPGA_pro/hld/init_opencl.sh

source /local/ramachandra.utah/inteldevstack/a10_gx_pac_ias_1_1_pv/opencl/opencl_bsp/linux64/libexec/setup_permissions.sh

export AOCL_BOARD_PACKAGE_ROOT=$INTELFPGAOCLSDKROOT/board/a10_ref

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/local/ramachandra.utah/inteldevstack/intelFPGA_pro/hld/board/a10_ref/linux64/lib 

 

DRIVER install

------------

aocl install

Do you want to install /local/ramachandra.utah/inteldevstack/intelFPGA_pro/hld//board/a10_ref? [y/n] y  

 LD [M] /tmp/opencl_driver_f2SkG2/aclpci_a10_ref_drv.ko

....

....

[root@fpga002 ~]# lsmod | grep a10

aclpci_a10_ref_drv   41362 0 

[root@fpga002 ~]# lsmod | grep fpga

intel_fpga_fme     52380 0 

intel_fpga_afu     31735 0 

fpga_mgr_mod      14693 1 intel_fpga_fme

intel_fpga_pci     26519 2 intel_fpga_afu,intel_fpga_fme

 

OPENCL

-------

aocl diagnose

aocl program acl0 ./inteldevstack/a10_gx_pac_ias_1_1_pv/opencl/vector_add.aocx

aocl program acl1 ./inteldevstack/a10_gx_pac_ias_1_1_pv/opencl/vector_add.aocx

aocl diagnose // success

[root@fpga001 hello_world]# aoc -list-boards

Board list:

 a10gx

   Board Package: /local/ramachandra.utah/inteldevstack/intelFPGA_pro/hld/board/a10_ref

 a10gx_hostch

   Board Package: /local/ramachandra.utah/inteldevstack/intelFPGA_pro/hld/board/a10_ref

   Channels:   host_to_dev, dev_to_host

pac_a10

   Board Package: /local/ramachandra.utah/inteldevstack/a10_gx_pac_ias_1_1_pv/opencl/opencl_bsp

 

EMULATOR MODE (runs fine)

--------------------

aoc -march=emulator -v -board=pac_a10 device/hello_world.cl -o bin/hello_world.aocx

module load intel/compiler/2019

make // compile host

env CL_CONTEXT_EMULATOR_DEVICE_INTELFPGA=1 bin/host // runs fine

 

BOARD COMPILATION

-------------------------

aoc -v -board=pac_a10 device/hello_world.cl -o bin/hello_world.aocx

 

BOARD RUN (hang)

--------------

[root@fpga001 hello_world]# ./bin/host 

Querying platform for info:

==========================

CL_PLATFORM_NAME             = Intel(R) FPGA SDK for OpenCL(TM)

CL_PLATFORM_VENDOR            = Intel(R) Corporation

CL_PLATFORM_VERSION           = OpenCL 1.0 Intel(R) FPGA SDK for OpenCL(TM), Version 17.1.1

 

Querying device for info:

========================

CL_DEVICE_NAME              = pac_a10 : PAC Arria 10 Platform (pac_a10_eb00001)

CL_DEVICE_VENDOR             = Intel Corp

CL_DEVICE_VENDOR_ID           = 4466

CL_DEVICE_VERSION            = OpenCL 1.0 Intel(R) FPGA SDK for OpenCL(TM), Version 17.1.1

CL_DRIVER_VERSION            = 17.1

CL_DEVICE_ADDRESS_BITS          = 64

CL_DEVICE_AVAILABLE           = true

CL_DEVICE_ENDIAN_LITTLE         = true

CL_DEVICE_GLOBAL_MEM_CACHE_SIZE     = 32768

CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE   = 0

CL_DEVICE_GLOBAL_MEM_SIZE        = 8589934592

CL_DEVICE_IMAGE_SUPPORT         = true

CL_DEVICE_LOCAL_MEM_SIZE         = 16384

CL_DEVICE_MAX_CLOCK_FREQUENCY      = 1000

CL_DEVICE_MAX_COMPUTE_UNITS       = 1

CL_DEVICE_MAX_CONSTANT_ARGS       = 8

CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE    = 2147483648

CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS    = 3

CL_DEVICE_MEM_BASE_ADDR_ALIGN      = 8192

CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE    = 1024

CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR  = 4

CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT  = 2

CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT   = 1

CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG  = 1

CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT  = 1

CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE = 0

Command queue out of order?       = false

Command queue profiling enabled?     = true

Using AOCX: hello_world.aocx

Reprogramming device [0] with handle 1

 

Kernel initialization is complete.

Launching the kernel...

 

0 Kudos
3 Replies
Highlighted
64 Views

Hi, Can I know what version of OS are you using ? Looking at aocl diagnose, it seems you are using multiple devices. 1. Can you try aocl diagnose acl0 or acl1 and check if you see and READ/ WRITE transactions. 2. I notice you are missing the aocl flash command, please follow steps as mentioned in https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/hb/opencl-sdk/aocl_getting_... Page 36, Programming the Flash Memory of an FPGA Let me know if this is helpful to you. Thanks, Arslan
Highlighted
Beginner
64 Views

Hi Arslan,

 

Thanks a lot for the response. I re did the setup referring the document from scratch.

But facing problems and errors when I do aocl flash, although the diagnose is successful.

 

Please review the below detailed instructions and let me know if I have did something wrong.

 

Check the interface ID

---------------------

[root@fpga001 inteldevstack_1_1]# sudo fpgainfo fme

//****** FME ******//

Class Path       : /sys/class/fpga/intel-fpga-dev.0/intel-fpga-fme.0

Device Path      : /sys/devices/pci0000:85/0000:85:02.0/0000:86:00.0/fpga/intel-fpga-dev.0/intel-fpga-fme.0

Bus          : 0x86

Device         : 0x00

Function        : 0x00

Device Id       : 0x09C4

Fim Version      : 1.1.3

Ports Num       : 1

Socket Id       : 0

Bitstream Id      : 0x113000200000177

Bitstream Metadata   : 0x1805304

Pr Interface Id    : 9926ab6d-6c92-5a68-aabc-a7d84c545738

Object Id       : 247463936

//****** FME ******//

Class Path       : /sys/class/fpga/intel-fpga-dev.1/intel-fpga-fme.1

Device Path      : /sys/devices/pci0000:d7/0000:d7:00.0/0000:d8:00.0/fpga/intel-fpga-dev.1/intel-fpga-fme.1

Bus          : 0xD8

Device         : 0x00

Function        : 0x00

Device Id       : 0x09C4

Fim Version      : 1.1.3

Ports Num       : 1

Socket Id       : 0

Bitstream Id      : 0x113000200000177

Bitstream Metadata   : 0x1805304

Pr Interface Id    : 9926ab6d-6c92-5a68-aabc-a7d84c545738

Object Id       : 247463937

 

Download and INSTALL the version for the above interface Id.

----------------------------------------------------------

http://download.altera.com/akdlm/software/dcp/1.1/a10_gx_pac_ias_1_1_pv_dev_installer.tar.gz

./setup and install into /home/ramachandra.utah/inteldevstack_1_1/

 

 

Confirm if driver is loaded

--------------------------

[root@fpga001 inteldevstack_1_1]# sudo lsmod | grep fpga 

intel_fpga_pac_hssi  18107 0 

intel_fpga_fme     52380 0 

intel_fpga_afu     31735 0 

intel_fpga_pci     26519 2 intel_fpga_afu,intel_fpga_fme

fpga_mgr_mod      14693 1 intel_fpga_fme

 

Setup environment

-----------------

[root@fpga001 inteldevstack_1_1]# source /home/ramachandra.utah/inteldevstack_1_1/init_env.sh

export QUARTUS_HOME=/home/ramachandra.utah/inteldevstack_1_1/intelFPGA_pro/quartus

Adding $QUARTUS_HOME/bin to PATH

export OPAE_PLATFORM_ROOT=/home/ramachandra.utah/inteldevstack_1_1/a10_gx_pac_ias_1_1_pv

Adding $OPAE_PLATFORM_ROOT/bin to PATH

 

[root@fpga001 inteldevstack_1_1]# source /home/ramachandra.utah/inteldevstack_1_1/a10_gx_pac_ias_1_1_pv/opencl/opencl_bsp/linux64/libexec/setup_permissions.sh

This script handles device permissions and huge page table setup.

Please refer to DCP Quick Start User Guide for OPAE driver and SW installation

instructions.

/etc/security/limits.d/99-opae_memlock.conf is already setup.

setup huge pages. must be done after every reboot

sudo bash -c "echo 20 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages"

setup permissions for device. must be done after every reboot.

sudo chmod 666 /dev/intel-fpga-port.*

sudo chmod 666 /sys/class/fpga/intel-fpga-dev.*/intel-fpga-port.*/userclk_freqcmd

sudo chmod 666 /sys/class/fpga/intel-fpga-dev.*/intel-fpga-port.*/userclk_freqcntrcmd

sudo chmod 666 /sys/class/fpga/intel-fpga-dev.*/intel-fpga-port.*/errors/clear

sudo chmod 666 /dev/intel-fpga-fme.*

 

 

export AOCL_BOARD_PACKAGE_ROOT=/home/ramachandra.utah/inteldevstack_1_1/a10_gx_pac_ias_1_1_pv/opencl/opencl_bsp/

 

source /home/ramachandra.utah/inteldevstack_1_1/intelFPGA_pro/hld/init_opencl.sh 

INTELFPGAOCLSDKROOT is set to /home/ramachandra.utah/intelFPGA_pro/18.1/hld. Using that.

Found a Quartus directory at /home/ramachandra.utah/intelFPGA_pro/18.1/quartus. Using that.

Adding /home/ramachandra.utah/intelFPGA_pro/18.1/hld/bin to PATH

Adding /home/ramachandra.utah/intelFPGA_pro/18.1/hld/host/linux64/lib to LD_LIBRARY_PATH

Adding /home/ramachandra.utah/intelFPGA_pro/18.1/hld/board/a10_ref/linux64/lib to LD_LIBRARY_PATH

 

 

 

Aocl install, diagnose and flash

-------------------------------

[root@fpga001 inteldevstack_1_1]# aocl install

Do you want to install /home/ramachandra.utah/inteldevstack_1_1/a10_gx_pac_ias_1_1_pv/opencl/opencl_bsp? [y/n] y

aocl install: Adding the board package /home/ramachandra.utah/inteldevstack_1_1/a10_gx_pac_ias_1_1_pv/opencl/opencl_bsp to the list of installed pckages

aocl install: Setting up FCD

aocl install: Running install from /home/ramachandra.utah/inteldevstack_1_1/a10_gx_pac_ias_1_1_pv/opencl/opencl_bsp/linux64/libexec

WARNING: install not implemented. Please refer to DCP Quick Start User Guide 

for installation instructions.

 

 

[root@fpga001 inteldevstack_1_1]# aocl diagnose

/home/ramachandra.utah/inteldevstack_1_1/a10_gx_pac_ias_1_1_pv/opencl/opencl_bsp/linux64/libexec/diagnose: error while loading shared libraries: libintel_opae_mmd.so: cannot open shared object file: No such file or directory

 

[root@fpga001 inteldevstack_1_1]# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/ramachandra.utah/inteldevstack_1_1/a10_gx_pac_ias_1_1_pv/opencl/opencl_bsp/linux64/lib/

 

 

 

[root@fpga001 inteldevstack_1_1]# aocl diagnose

--------------------------------------------------------------------

Device Name:

acl0

BSP Install Location:

/home/ramachandra.utah/inteldevstack_1_1/a10_gx_pac_ias_1_1_pv/opencl/opencl_bsp

Vendor: Intel Corp

Physical Dev Name  Status      Information

pac_a10_eb00001   Passed      PAC Arria 10 Platform (pac_a10_eb00001)

                   PCIe 216:00.0

                   FPGA temperature = 44 degrees C.

DIAGNOSTIC_PASSED

--------------------------------------------------------------------

--------------------------------------------------------------------

Device Name:

acl1

BSP Install Location:

/home/ramachandra.utah/inteldevstack_1_1/a10_gx_pac_ias_1_1_pv/opencl/opencl_bsp

Vendor: Intel Corp

Physical Dev Name  Status      Information

pac_a10_eb00000   Passed      PAC Arria 10 Platform (pac_a10_eb00000)

                   PCIe 134:00.0

                   FPGA temperature = 44 degrees C.

DIAGNOSTIC_PASSED

--------------------------------------------------------------------

 

 

aocl flash acl0 /home/ramachandra.utah/inteldevstack_1_1/a10_gx_pac_ias_1_1_pv/opencl/hello_world.aocx 

aocl flash: Running flash from /home/ramachandra.utah/inteldevstack_1_1/a10_gx_pac_ias_1_1_pv/opencl/opencl_bsp/linux64/libexec

ERROR: flash not implemented. Please refer to DCP Quick Start User Guide for

installation instructions.

aocl flash: Program failed.

 

 

0 Kudos
Highlighted
64 Views

Hi, Are you still facing issue or you are able to proceed ? Please try latest Acceleration stack version 1.2 and follow the instructions in quick starter guide first.. https://www.intel.com/content/www/us/en/programmable/documentation/iyu1522005567196.html Thanks, Arslan
0 Kudos