Forum Discussion
oneAPI on Cyclone10gx
Hi all,
the official Intel fpga requirement page says the Cyclone10gx fpga is supported by oneAPI so I downloaded the latest version on my Ubuntu20 (Quartus Prime also installed), I tried to compile a sample-adder, the compiler (targeting the fpga) works but then when I run simple-add-buffer.fpga I get:
tetto@ubuntuoffice:~/simple-add/build$ ./simple-add-buffers.fpga
An exception is caught while computing on device.
terminate called after throwing an instance of 'sycl::_V1::runtime_error'
what(): No device of requested type available. Please check https://software.intel.com/content/www/us/en/develop/articles/intel-oneapi-dpcpp-system-requirements.html -1 (PI_ERROR_DEVICE_NOT_FOUND)
Aborted (core dumped)
43 Replies
- BoonBengT_Altera
Moderator
Hi @StefanoC,
Thank you for posting in Intel community forum on your interest in oneAPI and hope all is well.
If I understand the situation correctly it seems that you are trying to run the hardware compilation in the IP authoring flow, and based on the error message it complaining that device not found.
Hence suspecting that the command line used might be incorrect, for that you may refer to the compilation flags below:
Hope that clarify
Best Wishes
BB
- StefanoC
Occasional Contributor
I was following this:
and indeed I can compile with make (both emulation and fpga), the issue I experience is at runtime, when I try to execute the ./simple-add-buffers.fpga (previously I had issued cmake .. -DFPGA_DEVICE=cyclone10gx to really target my device).
Overall, I have a dual boot computer with windows10/ubuntu, on windows10 I was able to compile and download a sample vhdl to the fpga, so I am sure the board is powered ok/jtag cable is ok too, I am wondering if on ubuntu any additional driver/os related has to be installed. At the moment I have quartus prime (licence is ok) and oneAPI (on both windows10 and ubuntu). I would prefer Linux as I am more comfortable with command line, but I think I am missing something how to get the Cyclone 10gx board properly installed (my understanding was Quartus prime pro contains the cyclone10 driver..), what should I check to make sure my fpga is configured properly on my linux system?
thanks!
- StefanoC
Occasional Contributor
I am trying to compile and run this sample code:
#include <CL/sycl.hpp> #include <iostream> #include <sycl/ext/intel/fpga_extensions.hpp> using namespace cl::sycl; int main() { auto selector = sycl::ext::intel::fpga_selector_v; queue q(selector); const int N = 100; int a[N], b[N], c[N]; // Initialize arrays on the host for (int i = 0; i < N; i++) { a[i] = i; b[i] = i * 2; } buffer<int, 1> buf_a(a, range<1>(N)); // Create buffers for arrays buffer<int, 1> buf_b(b, range<1>(N)); buffer<int, 1> buf_c(c, range<1>(N)); q.submit([&](handler& h) { auto a_acc = buf_a.get_access<access::mode::read>(h); auto b_acc = buf_b.get_access<access::mode::read>(h); auto c_acc = buf_c.get_access<access::mode::write>(h); h.parallel_for(range<1>(N), [=](id<1> i) { c_acc[i] = a_acc[i] + b_acc[i]; // Perform element-wise addition }); }); q.wait(); // Wait for completion // Print results on the host for (int i = 0; i < N; i++) { std::cout << c[i] << " "; } std::cout << std::endl; return 0; }following your link/suggestion I did add the proper flags (see below), I also made sure the board is seen by the OS but I still get the following runtime error:
tetto@ubuntuoffice:~/mytrial1$ jtagconfig 1) USB-BlasterII [1-1] 031820DD 10M08SA(.|ES)/10M08S(C|L) 02E120DD 10CX220Y tetto@ubuntuoffice:~/mytrial1$ icpx -fsycl -fintelfpga fpga_add2.cpp -Xshardware -Xstarget=Cyclone10GX -o fpga_compile.>aoc: Compiling for FPGA. This process may take several hours to complete. Prior to performing this compile, be sure to> tetto@ubuntuoffice:~/mytrial1$ ./fpga_compile.fpga terminate called after throwing an instance of 'sycl::_V1::runtime_error' what(): Invalid device program image: size is zero -30 (PI_ERROR_INVALID_VALUE) Aborted (core dumped)
- BoonBengT_Altera
Moderator
Hi @StefanoC,
Appreciate and noted on the sample code used, as well as the checking on the board connection to windows 10 host.
Also noted Ubuntu, you have run the command jtagconfig to check on the connect to board.
Further question, may I know what is the what are the quartus prime pro version and oneapi version that you have?
Hope to hear from you soon.
Best Wishes
BB
- StefanoC
Occasional Contributor
latest version of oneAPI:
tetto@ubuntuoffice:~/mytrial1$ icpx --version Intel(R) oneAPI DPC++/C++ Compiler 2024.0.2 (2024.0.2.20231213) Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: /opt/intel/oneapi/compiler/2024.0/bin/compiler Configuration file: /opt/intel/oneapi/compiler/2024.0/bin/compiler/../icpx.cfgI have both artus 23.4 (I know not compatible/supported by oneAPI latest yet) and Quartus 23.1 (this should be compatible). My licence is Pro, here is my .bashrc file (do I miss anything there?)
export QSYS_ROOTDIR="/home/tetto/intelFPGA_pro/23.1/qsys/bin" export QUARTUS_ROOTDIR_OVERRIDE=/home/tetto/intelFPGA_pro/23.1/quartus export LD_LIBRARY_PATH=~/intelFPGA_pro/23.1/quartus/linux64:$LD_LIBRARY_PATH export CL_CONTEXT_MPSIM_DEVICE_INTELFPGA=1 export PATH=$PATH:/home/tetto/intelFPGA_pro/23.1/quartus/bin/ export INTELFPGAOCLSDKROOT="/home/tetto/intelFPGA_pro/23.1/hld"p.s. It just occurred to me, that my machine CPU is non Intel (AMD Ryzen Threadripper 3960X 24-Core Processor), I would think that not an issue, isn't it?
- BoonBengT_Altera
Moderator
Hi @StefanoC,
Noted on the oneapi and quartus version used. Allow us sometime to try to reproduce the issues from our end.
While waiting, can you please run the aocl diagnose command to check on the board initialization on the environment and share the output here.
Hope to hear from you soon.
Best Wishes
BB
- StefanoC
Occasional Contributor
tetto@ubuntuoffice:~$ aocl diagnose
--------------------------------------------------------------------
ICD System Diagnostics
--------------------------------------------------------------------Using the following location for ICD installation:
/etc/OpenCL/vendorsFound 3 icd entry at that location:
/etc/OpenCL/vendors/Altera.icd
/etc/OpenCL/vendors/Intel_FPGA_SSG_Emulator.icd
/etc/OpenCL/vendors/intel64.icdThe following OpenCL libraries are referenced in the icd files:
/opt/intel/oneapi/compiler/latest/opt/oclfpga/host/linux64/lib/libalteracl.soChecking LD_LIBRARY_PATH for registered libraries:
/opt/intel/oneapi/compiler/latest/opt/oclfpga/host/linux64/lib/libalteracl.so was registered on the system.
/opt/intel/oneapi/compiler/latest/lib/libintelocl_emu.soChecking LD_LIBRARY_PATH for registered libraries:
/opt/intel/oneapi/compiler/latest/lib/libintelocl_emu.so was registered on the system.
/opt/intel/oneapi/compiler/latest/lib/libintelocl.soChecking LD_LIBRARY_PATH for registered libraries:
/opt/intel/oneapi/compiler/latest/lib/libintelocl.so was registered on the system.Using OCL_ICD_FILENAMES to search for ICD clients, it is set to libintelocl_emu.so:libalteracl.so:/opt/intel/oneapi/compiler/2024.0/lib/libintelocl.so
Checking LD_LIBRARY_PATH for registered libraries specified by OCL_ICD_FILENAMES
libintelocl_emu.so was registered on the system at /opt/intel/oneapi/compiler/2024.0/lib
libalteracl.so was registered on the system at /opt/intel/oneapi/compiler/2024.0/opt/oclfpga/host/linux64/lib
/opt/intel/oneapi/compiler/2024.0/lib/libintelocl.so was registered on the system.Using the following location for fcd installations:
/opt/Intel/OpenCLFPGA/oneAPI/BoardsERROR: No FCD entry at that location. Without ICD and FCD, host executables
must be linked directly to Intel FPGA runtime (libalteracl.so) and BSP MMD
library instead of to the Khronos ICD library (libOpenCL.so).
To use FCD, please reinstall using 'aocl install'.
--------------------------------------------------------------------
ICD diagnostics FAILED
--------------------------------------------------------------------
--------------------------------------------------------------------
BSP Diagnostics
--------------------------------------------------------------------
/opt/intel/oneapi/compiler/2024.0/opt/oclfpga/board/intel_a10gx_pac/linux64/libexec/diagnose: error while loading shared libraries: libopae-c.so.1: cannot open shared object file: No such file or directory
--------------------------------------------------------------------
Warning:
No devices attached for package:
/opt/intel/oneapi/compiler/2024.0/opt/oclfpga/board/intel_a10gx_pac
--------------------------------------------------------------------
/opt/intel/oneapi/compiler/2024.0/opt/oclfpga/board/intel_a10gx_pac/linux64/libexec/diagnose: error while loading shared libraries: libopae-c.so.1: cannot open shared object file: No such file or directory
--------------------------------------------------------------------Call "aocl diagnose <device-names>" to run diagnose for specified devices
Call "aocl diagnose all" to run diagnose for all devices - BoonBengT_Altera
Moderator
Hi @StefanoC,
Reviewing through the diagnose output it make sense for the failure as it is complaining about the missing BSP for PAC related product.
In our case, targetted device are not PAC but C10GX, hence we can omit the error for now.
We are still working on the example provided and will get back at earliest.
Best Wishes
BB
- BoonBengT_Altera
Moderator
Hi @StefanoC,
Greetings, to update the compilation flag are able to be completed successfully from our end. Hence suspecting that just the compilation flag that are causing the error. Notice that the used compilation are obselete, please use the xstarget instead.
Hope that clarify.
Best Wishes
BB
- StefanoC
Occasional Contributor
not sure I understand what you wrote, did you try to compile using the same compilation flags I used? If you are successful then the issue is not the compilation flag but some libraries or environment variable? You mention xstarget, is there any documentation?
- BoonBengT_Altera
Moderator
Hi @StefanoC,
Recall that previously there was a mention the use of -DFPGA_DEVICE for the compilation command.
However that flag might be obsolete and suspect it might cause some problem.
Hence would suggest to use the -Xstarget instead, more details can be found in the link below:
Best Wishes
BB
- StefanoC
Occasional Contributor
If you review my post on 12-31-2023 10:18 PM I had used that very same compilation flag with the very same syntax as in the online document you posted, I add here below the line I had used on 12-31-2023 10:18 PM (that fails at runtime):
tetto@ubuntuoffice:~/mytrial1$ icpx -fsycl -fintelfpga fpga_add2.cpp -Xshardware -Xstarget=Cyclone10GX -o fpga_compile.>aoc: Compiling for FPGA. This process may take several hours to complete. Prior to performing this compile, be sure to> tetto@ubuntuoffice:~/mytrial1$ ./fpga_compile.fpga terminate called after throwing an instance of 'sycl::_V1::runtime_error' what(): Invalid device program image: size is zero -30 (PI_ERROR_INVALID_VALUE) Aborted (core dumped)
@BoonBengT_Altera wrote:Hi @StefanoC,
Recall that previously there was a mention the use of -DFPGA_DEVICE for the compilation command.
However that flag might be obsolete and suspect it might cause some problem.
Hence would suggest to use the -Xstarget instead, more details can be found in the link below:
Best Wishes
BB
- BoonBengT_Altera
Moderator
Hi @StefanoC,
Apologies for the confusion and missing the previous comment on mentioning the param used of -Xstarget.
The previous use of -DFPGA_DEVICE usually are example with the makefile, hence that param are used.
I tried to run the emulation for the code provided and it was completed successfully. (with some modification on line #8)
Followed by full hardware compilation which is also completed successfully.
Perhap you can try to compile with the following command form your end:
- icpx -fsycl -fintelfpga -Xshardware -Xstarget=Cyclone10GX code.cpp -o code.fpga
Also, just to eliminate the possibilities of code issues. Would suggest perhaps to try run the existing example available for oneAPI in the link below:
Hope that clarify.
Best Wishes
BB
- StefanoC
Occasional Contributor
@BoonBengT_Altera on my end still same error:
tetto@ubuntuoffice:~/mytrial1$ ./code.fpga terminate called after throwing an instance of 'sycl::_V1::runtime_error' what(): Invalid device program image: size is zero -30 (PI_ERROR_INVALID_VALUE) Aborted (core dumped)what did you modify on line8? can you share your code that you got it to run?
- BoonBengT_Altera
Moderator
Hi @StefanoC,
For the emulation to be successful you can change the link #8 as below:
(from) auto selector = sycl::ext::intel::fpga_selector_v;
(to) auto selector = sycl::ext::intel::fpga_emulator_selector_v;
And compile with the emulation command: icpx -fsycl -fintelfpga code.cpp -o code-compile.fpga_emu
Perhaps would suggest to run a simple vector example instead to narrow down if it is hardware connectino issues.
Hope that carify
Regards
BB
- StefanoC
Occasional Contributor
changing that line8 into emulation results in this runtime error:
tetto@ubuntuoffice:~/mytrial1$ ./code-compile.fpga_emu terminate called after throwing an instance of 'sycl::_V1::runtime_error' what(): Native API failed. Native API returns: -2 (PI_ERROR_DEVICE_NOT_AVAILABLE) -2 (PI_ERROR_DEVICE_NOT_AVAILABLE) Aborted (core dumped) tetto@ubuntuoffice:~/mytrial1$however, on your end why did you switch to emulation? Does it work on the real fpga hardware without emulation?
the github repository you pointed is full of codes, but in all the README files I can read I never see Cyclone 10GX as supported, so now I am puzzled. Can you point a simple example that is tested on the Cyclone10 GX (hardware compilation)?
Since you can run (at least the emulation) my sample code while I get an error even with simulation I would think my setup has an issue, is there any library/settings to be checked? Ultimately, on your end, if you turn line8 the way it was, does it work at runtime?
- BoonBengT_Altera
Moderator
Hi @StefanoC,
Just to clarify the emulation failed even with the compilation command above with the '-Xshardware'?
Kinda weird, yes from my end it does work however with a different hardware setup.
Hence just to narrow down the issues here, you can try running the simple example below to check on the overall setup:
As for library checking the previous aocl diagnose command does so, based on the output suggested it seems that the version and library should be ok.
Note: attached is the aocl output from my setup as references.
Best Wishes
BB
- StefanoC
Occasional Contributor
Ok, I gave it a try to the part1. I was able to compile and run it via emulation, but when I tried the cmake with -DFPGA_DEVICE setting to "Cylone10gx" it said "Ignoring as not applicable" (I also tried Cyclone, CycloneGX), how to target my hardware and run it hardware rather than emulated?
tetto@ubuntuoffice:~/oneAPI-samples/DirectProgramming/C++SYCL_FPGA/Tutorials/GettingStarted/fpga_compile/part1_cpp/build$ cmake .. -DFPGA_DEVICE=Cyclone10gx cmake: /home/tetto/intelFPGA_pro/23.1/quartus/linux64/libcurl.so.4: no version information available (required by cmake) -- Ignoring FPGA_DEVICE: Cyclone10gx, not applicable -- Configuring done -- Generating done -- Build files have been written to: /home/tetto/oneAPI-samples/DirectProgramming/C++SYCL_FPGA/Tutorials/GettingStarted/fpga_compile/part1_cpp/build