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

Unable to get output from oneAPI Base Toolkit's vector-add example

bzha988
Beginner
1,455 Views

I followed the steps found in 

https://devcloud.intel.com/oneapi/get_started/baseToolkitSamples/

The vector-add example gives the correct output in the .o file if built and ran on the gpu node

bzha988_1-1665056358638.png

 

However, for both the FPGA emulator and hardware approaches, while the vector-add example finished compiling and running with no error outputted to the .e file, the actual output of the vector addition operation is absent in the .o file, as shown below: 

bzha988_0-1665055673694.png

 

0 Kudos
11 Replies
JaideepK_Intel
Employee
1,429 Views

Hi,

 

Thank you for posting in Intel Communities.

From the above pics, I can see you are trying to source the environment variables once again because you are getting that error.

 

work around:

either u need to include the below command:

source /opt/intel/oneapi/setvars.sh --force

(or)

you need to remove (source /opt/intel/oneapi/setvars.sh) from your <xxx>.sh file

 

I hope you followed below steps:

git clone https://github.com/oneapi-src/oneAPI-samples.git
cd ./oneAPI-samples/DirectProgramming/DPC++/DenseLinearAlgebra/vector-add

 

To build/run for FPGA emulator:

qsub build_fpga_emu.sh
qsub run_fpga_emu.sh

 

for more information, please follow the below link:

https://github.com/oneapi-src/oneAPI-samples/tree/master/DirectProgramming/DPC%2B%2B/DenseLinearAlgebra/vector-add#running-the-sample-in-the-devcloud

 

Regards,

Jaideep

 

0 Kudos
bzha988
Beginner
1,327 Views

bzha988_0-1665660621356.png

When I tried your suggestion this is what I got

0 Kudos
Christoph9
New Contributor II
1,320 Views

When looking at the makefile it seems the build_fpga.sh file is incorrect. There is no target hw in the makefile. Instead there is a target called 'fpga', try using this.

0 Kudos
bzha988
Beginner
1,299 Views

The build_fpga.sh file was the one that comes with the vector-add example by default

I did not edit it in any way

It should work out of the box like the documentation suggested here

 

https://github.com/oneapi-src/oneAPI-samples/tree/master/DirectProgramming/DPC%2B%2B/DenseLinearAlgebra/vector-add#running-the-sample-in-the-devcloud

 

0 Kudos
JaideepK_Intel
Employee
1,281 Views

Hi,

 

As christoph9 suggested you need to modify build_fpga.sh. i.e.

from this:

JaideepK_Intel_1-1665734117279.png

 

to this:

JaideepK_Intel_0-1665734075824.png

 

After modifying the above build_fpga.sh script, rerun build_fpga.sh script.

 

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

 

Regards,

Jaideep

 

 

0 Kudos
bzha988
Beginner
1,239 Views

Unfortunately, the above modifications did not solve the issue

bzha988_0-1665797455005.png

 

0 Kudos
bzha988
Beginner
1,235 Views

I wonder if there are more environmental variables etc. to edit before the fpga can work.

But I cannot find anything related to that in the readme file of the vector-add example, other than the setvars variable that I mentioned in the first post.

0 Kudos
Christoph9
New Contributor II
1,205 Views

Actually there is currently something you should add to the compiler: A specific board package, the default one will currently probably not work on the fpga_compile-nodes. However the specific error-message should be in the .o file which you did'nt show...

 

If the error-message is something like

 

Error: The board package being used only supports report generation/emulation/runtime

 

 It is the same error as in these posts:

https://community.intel.com/t5/Intel-DevCloud/FPGA-Compilation-Error/m-p/1421930#M6319

https://community.intel.com/t5/Intel-DevCloud/Issue-on-fpga-compile-nodes/m-p/1421924#M6318

https://community.intel.com/t5/Intel-DevCloud/Cannot-find-board-package-on-devcloud/m-p/1421143#M6292

 

In this case you just need to add the correct board package to the compiler arguments. Sadly this example just uses a plain makefile, so you need to add the parameter to each of the targets, at best behind each occurence of -Xshardware, this is the parameter used in all hardware-builds.

I think changing the 2 subtargets for the non-usm will be sufficient, here for the arria10 board:

 

vector-add-buffers.fpga: a_buffers.o
	$(CXX) $(CXXFLAGS) -fintelfpga $^ -o $@ -Xshardware -Xsboard=/opt/intel/oneapi/intel_a10gx_pac:pac_a10


vector-add-buffers_report.a_buffers: dev_buffers.o
	$(CXX) $(CXXFLAGS) -fintelfpga -fsycl-link $^ -o $@ -Xshardware -Xsboard=/opt/intel/oneapi/intel_a10gx_pac:pac_a10

 

The only board with usm-support is "/opt/intel/oneapi/intel_s10sx_pac:pac_s10_usm", in case you want totest usm add these package to also to the usm-targets.

 

Best regards,
Christoph

0 Kudos
JaideepK_Intel
Employee
1,057 Views

Hi,

could you please try again?

Following some tweaks, I was able to compile on an fpga_compile node and execute on an arria10 node.

 

Please keep in mind the following two points:

you need to check out the 2022.3.0 tag.

That will address the following error that you might encounter otherwise:

 

"fatal error: 'sycl/sycl.hpp' file not found"

 

This is just a temporary solution until the latest code changes are merged into the master branch.

git clone https://github.com/oneapi-src/oneAPI-samples.git
git fetch --all --tags

Fetching origin

From https://github.com/oneapi-src/oneAPI-samples

t [tag update] 2022.3.0 -> 2022.3.0

git checkout tags/2022.3.0

Checking out files: 100% (270/270), done.

Note: checking out 'tags/2022.3.0'.

git branch

* (HEAD detached at 2022.3.0)

 master

 

when compiling on an fpga_compile node, you need to specify an additional argument to the cmake command:

 

# for Arria10

$ cmake .. -DFPGA_BOARD=/opt/intel/oneapi/intel_a10gx_pac:pac_a10

or

# for Stratix10

$ cmake .. -DFPGA_BOARD=/opt/intel/oneapi/intel_s10sx_pac:pac_s10

 

This step is not necessary when compiling on a compute node that hosts a physical FPGA card such as Arria10 or Stratix10.

There are other samples not using cmake but just make instead, such as vector-add.

In this case, in order to compile on an fpga_compile node you need to make changes to the makefile(Makefile.fpga).

Replace the following:

 

$(CXX) $(CXXFLAGS) -fintelfpga $^ -o $@ -Xshardware

with

# for Arria10

$(CXX) $(CXXFLAGS) -fintelfpga $^ -o $@ -Xshardware -Xsboard=/opt/intel/oneapi/intel_a10gx_pac:pac_a10

or

# for Stratix10

$(CXX) $(CXXFLAGS) -fintelfpga $^ -o $@ -Xshardware -Xsboard=/opt/intel/oneapi/intel_s10sx_pac:pac_s10

 

Thanks,

Jaideep

 

0 Kudos
JaideepK_Intel
Employee
1,006 Views

Hi,


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


Regards,

Jaideep


0 Kudos
JaideepK_Intel
Employee
952 Views

Hi,


We assume that your issue is resolved. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.


Thanks,

Jaideep


0 Kudos
Reply