Forum Discussion

DongWang-BJTU's avatar
DongWang-BJTU
Icon for Occasional Contributor rankOccasional Contributor
7 years ago

Possible bug in FPGA OpenCL runtime for v18.1.0 (verified with a10_ref)

I am currently using an a10 reference board, and I have recently upgraded to v18.1.0. I recompiled the official helloword example, and found out the host program crashed like follows,

So, I digged into the file ./common/src/AOCLUtils/opencl.cpp, and printed out the value of variable num_devices for the clGetDeviceIDs function, and it always show a value of "33".

Therefore, in the host program of the example, I changed the device num to 32 as follow

This time, it works correctly:

Is this possibly a bug ? I am using Ubuntu 14.04, and there is no such issue with the DE5net board and v18.1 std version runtime.

9 Replies

  • Hi, Do you have multiple platform connected to the host or A10GX is the only one in this case? Or Multiple BSP's installed on the host, try uninstalling all the other BSP's and see if this helps. Thanks, Arslan
  • DongWang-BJTU's avatar
    DongWang-BJTU
    Icon for Occasional Contributor rankOccasional Contributor

    Thx for the reply. I do have multiple boards on the machine. The other one is de5net. But before installing the driver for a10_ref, I have uninstalled the driver of the de5net board.

    • DongWang-BJTU's avatar
      DongWang-BJTU
      Icon for Occasional Contributor rankOccasional Contributor

      Yes, there are multiple FCD files in /opt/Intel/OpenCL/Boards/. I did not know these hidden files. Problem solved when deleted other icd files manually. Thx.

      BTW, how should user properly choose between different fpga devices in the host program when multiple boards are installed on the same machine ?

  • You may also want to try the workaround suggested for a similar issue on Windows. https://www.intel.com/content/www/us/en/programmable/documentation/ewa1412772636144.html#ewa1412773000284 Issue Details: For Windows, when the host application queries the number of devices, calls to clGetDeviceIDs return 128 devices regardless of the actual number of devices present. Note: You can find the actual available devices at the beginning of the device list returned by clGetDeviceIDs. This issue affects the Intel® Arria® 10 GX FPGA Development Kit Reference Platform and the Intel® Stratix® 10 GX FPGA Development Kit Reference Platform. Workaround: Perform one of the following workarounds: Rewrite the host application to limit the query for clGetDeviceIDs to the actual number of devices. Rewrite the host application to use clGetDeviceInfo to query which devices are available. Calling clGetDeviceInfo with the CL_DEVICE_AVAILABLE flag correctly reports that extraneous devices are unavailable. Rewrite the host application to only call clCreateContext with the actual number of devices. Calling clCreateContext with extraneous devices will fail with the error CL_DEVICE_NOT_AVAILABLE. Set the environment variable CL_OVERRIDE_NUM_DEVICES_INTELFPGA to the correct number of devices. Doing so fixes the erroneous behavior of clGetDeviceIDs. Thanks, Arslan
  • Glad to know you are able to proceed with suggested workaround of deleting the un-used FCD files.
    • DongWang-BJTU's avatar
      DongWang-BJTU
      Icon for Occasional Contributor rankOccasional Contributor

      How could I keep the runtime enviorment for both boards on the same machine. When I run the application for de5-net, the following error shows up:

      It seems that the runtime is loading the lib file from the a10_ref BSP folder, however, I have set the AOCL_BOARD_PACEKAGE_ROOT varaible to de5-net 's BPS folder.

      • HRZ's avatar
        HRZ
        Icon for Frequent Contributor rankFrequent Contributor

        Check you ~/.profile; recently the installer of Quartus adds its environmental variables directly to that file which might conflict with your configuration in ~/.bashrc.