Intel® DevCloud
Help for those needing help starting or connecting to the Intel® DevCloud
1594 Discussions

Device Selector Compilation Error

jbick819
New Contributor I
1,163 Views

Hello,

 

My apologies, I had originally posted this question in the wrong Intel forum, and I am reposting it here now.

 

Prior to the latest oneAPI update, I had been creating my device selector in the following way:

#if defined(FPGA_EMULATOR)
    sycl::ext::intel::fpga_emulator_selector device_selector;
#elif defined(CPU_HOST)
    sycl::host_selector device_selector;
#else
    sycl::ext::intel::fpga_selector device_selector;
#endif
    
sycl::queue q(device_selector, sycl::property::queue::enable_profiling{});

 Things had been working just fine up until 5/4. I adjusted the code following deprecation warnings and a compilation error to follow the new method:

#if defined(FPGA_SIMULATOR)
	auto selector = sycl::ext::intel::fpga_simulator_selector_v;
#elif defined(FPGA_HARDWARE)
	auto selector = sycl::ext::intel::fpga_selector_v;
#else  // #if FPGA_EMULATOR
	auto selector = sycl::ext::intel::fpga_emulator_selector_v;
#endif

sycl::queue q(selector, sycl::property::queue::enable_profiling{});

However, I am still getting errors when I try and compile my code with this new device selector method. My compilation command is as follows:

icpx -fsycl -qactypes -fintelfpga -DFPGA_EMULATOR src/test.cpp -O3 -o bin/test

I ran the setvars script before attempting compilation as well:

source /opt/intel/oneapi/setvars.sh > /dev/null 2>&1

The error that I am getting is this:

OpenCL platform ID is empty
OpenCL platform name is empty
Failed to find any of these OpenCL platforms:
  Intel(R) FPGA Emulation Platform for OpenCL(TM)
  Intel(R) FPGA Emulation Platform for OpenCL(TM) (preview)
llvm-foreach: 
icpx: error: fpga compiler command failed with exit code 14 (use -v to see invocation)

 

Any ideas on how to fix this issue would be greatly appreciated, thank you!

0 Kudos
1 Solution
RajashekarK_Intel
Moderator
813 Views

Hi @jbick819 , Good day to you.

 

The fpga_compile nodes are now fixed and showing the Emulation device, can you confirm it from your end?

 

If this resolves your issue, make sure to accept this as a solution. This would help others with similar issue.

 

cc: @olucas 

 

Regards,

Rajashekar

 

View solution in original post

0 Kudos
8 Replies
RajashekarK_Intel
Moderator
1,107 Views

Hi, Thanks for posting in Intel Communities.

 

I Hope you are using Intel DevCloud for oneAPI, Inorder to debug your issue further can you provide below details?

 

1. On which oneAPI DevCloud node you are trying to execute?

2. Can you provide the output of 

source /opt/intel/oneapi/setvars.sh && sycl-ls

(at the end It displays the available devices and Emulator present).

3. Sample reproducer and any guide that you followed.

 

Regards,

Rajashekar

 

0 Kudos
olucas
Beginner
1,060 Views

Hi, I'm running into the same issue when trying to emulate FPGA code on the DevCloud.

I'm attempting to build the emulation on the JupyterLabs nodes, in this case node s001-n059.

 

Terminal outut for the commands you requested are shown below. 

u132436@s001-n059:~$ source /opt/intel/oneapi/setvars.sh --force
 
:: initializing oneAPI environment ...
   bash: BASH_VERSION = 5.0.17(1)-release
   args: Using "$@" for setvars.sh arguments: --force
:: advisor -- latest
:: ccl -- latest
:: clck -- latest
:: compiler -- latest
:: dal -- latest
:: debugger -- latest
:: dev-utilities -- latest
:: dnnl -- latest
:: dpcpp-ct -- latest
:: dpl -- latest
:: embree -- latest
:: inspector -- latest
:: intelpython -- latest

CommandNotFoundError: Your shell has not been properly configured to use 'conda deactivate'.
To initialize your shell, run

    $ conda init <SHELL_NAME>

Currently supported shells are:
  - bash
  - fish
  - tcsh
  - xonsh
  - zsh
  - powershell

See 'conda init --help' for more information and options.

IMPORTANT: You may need to close and restart your shell after running 'conda init'.



CommandNotFoundError: Your shell has not been properly configured to use 'conda deactivate'.
To initialize your shell, run

    $ conda init <SHELL_NAME>

Currently supported shells are:
  - bash
  - fish
  - tcsh
  - xonsh
  - zsh
  - powershell

See 'conda init --help' for more information and options.

IMPORTANT: You may need to close and restart your shell after running 'conda init'.


:: ipp -- latest
:: ippcp -- latest
:: ipp -- latest
:: ispc -- latest
:: itac -- latest
:: mkl -- latest
:: modelzoo -- latest
:: modin -- latest
:: mpi -- latest
:: neural-compressor -- latest
:: oidn -- latest
:: openpgl -- latest
:: openvkl -- latest
:: ospray -- latest
:: ospray_studio -- latest
:: pytorch -- latest
:: rkcommon -- latest
:: tbb -- latest
:: tensorflow -- latest
:: vtune -- latest
:: oneAPI environment initialized ::
 
u132436@s001-n059:~$ sycl-ls
[opencl:cpu:0] Intel(R) OpenCL, Intel(R) Xeon(R) Gold 6128 CPU @ 3.40GHz 3.0 [2023.15.3.0.20_160000]

 

I'm currently trying to build with this command that used to work up until last week:

icpx -fsycl -fintelfpga -DFPGA_EMULATOR -qopenmp my_code.cpp -o my_emulation.emu

 

Let me know if you need any extra info.

Thanks.

 

0 Kudos
RajashekarK_Intel
Moderator
1,023 Views

Hi, Thank you for the detailed response.

 

The general intuition is when you query the available devices using sycl-ls it should list FPGA Emulation Device, something like this.

fpga-compile-node.png

In order to get node with FPGA Emulation, query the following way according to your use case, Sample reference ( https://github.com/oneapi-src/oneAPI-samples/tree/master/DirectProgramming/C%2B%2BSYCL/DenseLinearAlgebra/simple-add#:~:text=Build%20and%20Run%20the%20Simple%20Add%20Sample%20in%20Intel%C2%AE%20DevCloud ) Interactively

qsub -I -l nodes=1:fpga_compile:ppn=2 -d .

qsub -I -l nodes=1:fpga_runtime:arria10:ppn=2 -d .

Then, 

source /opt/intel/oneapi/setvars.sh && sycl-ls

I'm able to see the issue of sometimes not finding out FPGA emulation device on fpga_compile nodes and we are looking into this, meanwhile try out on arria10.

 

I'm keeping a workaround of this sample ( https://github.com/oneapi-src/oneAPI-samples/blob/master/DirectProgramming/C%2B%2BSYCL/DenseLinearAlgebra/simple-add/src/simple-add-buffers.cpp ) on arria10.

 

uid@s001-n084:$ icpx -fsycl -fintelfpga -DFPGA_EMULATOR simple-add-buffers.cpp
uid@s001-n084:$ ./a.out
Running on device: Intel(R) FPGA Emulation Device
Array size: 10000
[0]: 0 + 100000 = 100000
[1]: 1 + 100000 = 100001
[2]: 2 + 100000 = 100002
...
[9999]: 9999 + 100000 = 109999
Successfully completed on device.

 

Regards,

Rajashekar

 

0 Kudos
jbick819
New Contributor I
967 Views

Hello,

 

Thank you for your feedback on our responses, following your steps I am now able to compile and run my FPGA emulated code.

 

I'm wondering, however, in the future will we be able to simply compile and run the code on nodes such as those olucas was using? Or will we have to continue using this double qsub method for specific fpga compile and runtime nodes?

 

Thank you!

0 Kudos
RajashekarK_Intel
Moderator
930 Views

Hi, Glad to know that you're able to run your code.


Intel DevCloud is configured in such a way to maximize your productivity by providing you the ability to offload your workload by submitting jobs in the background and work Interactively on specific compute nodes which is really helpful when you want to target specific accelerator. so launching a related compute node from login node is the only process (using qsub), 

FYI: https://devcloud.intel.com/oneapi/documentation/job-submission/ 


Regarding fpga_compile nodes, we'll get back to you once we have an update on that.


Regards,

Rajashekar


0 Kudos
RajashekarK_Intel
Moderator
814 Views

Hi @jbick819 , Good day to you.

 

The fpga_compile nodes are now fixed and showing the Emulation device, can you confirm it from your end?

 

If this resolves your issue, make sure to accept this as a solution. This would help others with similar issue.

 

cc: @olucas 

 

Regards,

Rajashekar

 

0 Kudos
jbick819
New Contributor I
797 Views

Hello,

 

Thank you for the update! Everything does seem to be functioning as normal now in regards to FPGA emulation, your help is greatly appreciated.

0 Kudos
RajashekarK_Intel
Moderator
777 Views

Hi,

Thanks for accepting our solution. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.


Regards,

Rajashekar


0 Kudos
Reply