UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Adventurer
Adventurer
3,933 Views
Registered: ‎02-09-2017

Error in running SW_EM program in commandline mode.

Jump to solution

 

After the application was built in CPU emu mode, it runs correctly in SDAccel gui mode. But when I tried to run the executable by a command line in a shell.

It shows an error msg as follows:

error.PNG

 

Plz help me out

thx

0 Kudos
1 Solution

Accepted Solutions
Xilinx Employee
Xilinx Employee
6,720 Views
Registered: ‎07-18-2014

Re: Error in running SW_EM program in commandline mode.

Jump to solution

Did you set XCL_EMULATION_MODE before running exe file?

 

export XCL_EMULATION_MODE=<sw_emu|hw_emu>

View solution in original post

0 Kudos
11 Replies
Xilinx Employee
Xilinx Employee
6,721 Views
Registered: ‎07-18-2014

Re: Error in running SW_EM program in commandline mode.

Jump to solution

Did you set XCL_EMULATION_MODE before running exe file?

 

export XCL_EMULATION_MODE=<sw_emu|hw_emu>

View solution in original post

0 Kudos
Adventurer
Adventurer
3,766 Views
Registered: ‎02-09-2017

Re: Error in running SW_EM program in commandline mode.

Jump to solution

Now I have a problem when tried to run the SW_EM program in commandline mode.

 

The error msg shows:

./test.exe: error while loading shared libraries: libxilinxopencl.so: cannot open shared object file: No such file or directory

 

Please help me out.

thx.

0 Kudos
Xilinx Employee
Xilinx Employee
3,758 Views
Registered: ‎09-08-2011

Re: Error in running SW_EM program in commandline mode.

Jump to solution

It should be under something like:

 

$XILINX_SDX/runtime/lib/x86_64/lib/libxilinxopencl.so

On the system.

 

But generally you should get the needed files when you run xbinst

 

In the /data/runtime/lib/x86_64/

 

Make sure you copied over your xbinst output so when you call make the needed libs are able to be found.

Or you can point in the make file to the location in the install directory like above.

If at first you don't succeed, try redefining success?
0 Kudos
Adventurer
Adventurer
3,753 Views
Registered: ‎02-09-2017

Re: Error in running SW_EM program in commandline mode.

Jump to solution

I'm using centOS 64bit. Here are the library I found:

Should I use the one in lnx64.o instead of x86_64 folder?

 

So one solution is to copy the correct /libxilinxopencl.so file to the folder where test.exe located? Then run the application by the command?

 

 

snapshot1.png

0 Kudos
Xilinx Employee
Xilinx Employee
3,749 Views
Registered: ‎09-08-2011

Re: Error in running SW_EM program in commandline mode.

Jump to solution

Depends how your makefile is setup.

 

Using one of the examples from the github, the make file might call the following:

include $(COMMON_REPO)/libs/opencl/opencl.mk

 

Which in the opencl.mk has the lines:

 

# Definition of include file locations
OPENCL12_INCLUDE:= $(XILINX_SDACCEL)/runtime/include/1_2

or

 

OPENCL12_INCLUDE:= $(XILINX_SDX)/runtime/include/1_2

 

and

 

opencl_CXXFLAGS=-I$(OPENCL12_INCLUDE)

 

Which points to the location in the install location I pointed out before which is what I would recommend doing.

So your makefile will refrence this location for the Host application something like:

 

# hello Host Application
<example_app>_SRCS=./src/<example_app>.cpp $(xcl_SRCS)
<example_app>_HDRS=$(xcl_HDRS)
<example_app>_CXXFLAGS=-I./src/ $(xcl_CXXFLAGS) $(opencl_CXXFLAGS)
<example_app>_LDFLAGS=$(opencl_LDFLAGS)

EXES=<example_app>

 

 

If at first you don't succeed, try redefining success?
0 Kudos
Adventurer
Adventurer
3,718 Views
Registered: ‎02-09-2017

Re: Error in running SW_EM program in commandline mode.

Jump to solution

The application is built in SDAccel GUI mode. It runs correctly in GUI mode. But it shows the error when called by command line in a shell.

Could you advise how to set up for the application compiled by SDAccel GUI mode?

thx.

0 Kudos
Xilinx Employee
Xilinx Employee
3,698 Views
Registered: ‎09-08-2011

Re: Error in running SW_EM program in commandline mode.

Jump to solution

Hi sl_cgi,


So I missed what your use case was and didn't realize you where trying just to run, not start from the build step. So for emulation I took the hello world example as it's quick to build and i already have it on my NIMBIX

From this UG:https://www.xilinx.com/support/documentation/sw_manuals/xilinx2016_2/ug1240-sdaccel-nimbix-getting-started.pdf

We can see the steps starting on page 16.

There should be a xclbin folder generated alongside your <program_name>.exe

Copy the folder and the .exe to the location you with to run. I did it on the data/

so ~/data/hello.exe
~/data/xclbin/<generated files here>

Then run the commands:

$ export LD_LIBRARY_PATH=$XILINX_SDACCEL/runtime/lib/x86_64:$LD_LIBRARY_PATH
$ export XCL_EMULATION_MODE=sw_emu
$ emconfigutil --xdevice 'xilinx:xil-accel-rd-ku115:4ddr-xpr:3.3' --nd 1

****** configutil v2016.4_sdx
**** Copyright 1986-2016 Xilinx, Inc. All Rights Reserved.

emulation configuration file `emconfig.json` is created in ./ directory

This sets it all up for you as covered from earlier in the thread. Now I should be able to run the example:

$ ./hello
INFO: Importing xclbin/krnl_hello.sw_emu.xilinx_xil-accel-rd-ku115_4ddr-xpr_3_3.xclbin
INFO: Loaded file
INFO: Created Binary
INFO: Built Program
Hello World!
The host has sent the following values to the kernel 5 & 25
The kernel in this example does not send data back to the host

 

Which shows my sw emulation worked from the command line from within NIMBIX.

 

So once you locate the files needed, and set the pointer such that you have all the runtime libs (Which is the step i think was causing the error earlier) you should be good to go!


Regards,

Evan

If at first you don't succeed, try redefining success?
0 Kudos
Adventurer
Adventurer
3,383 Views
Registered: ‎02-09-2017

Re: Error in running SW_EM program in commandline mode.

Jump to solution

 

 

I have a similar issue when running other programs 

 

Now it happens when running the applicaiton in SDAccel GUI sw_emu mode. (previously, it happens in command line shell.)

 

The error msg shows :

error while loading shared libraries: libxilinxopencl.so: cannot open shared object file: No such file or directory

 

How can I figure it out?

thanks.

 

error.PNG

 

0 Kudos
Moderator
Moderator
3,344 Views
Registered: ‎03-27-2012

Re: Error in running SW_EM program in commandline mode.

Jump to solution

Hi @sl_cgi,

 

Please check the Environment tab in Run -> Run Configurations window.

The LD_LIBRARY_PATH variable should be set properly otherwise you will see this error.

 

The default value of this variable is:

${env_var:XILINX_SDX}/runtime/lib/x86_64:${env_var:XILINX_SDX}/lib/lnx64.o:${env_var:XILINX_SDX}/lnx64/tools/gcc/lib64

 

Regards,

Sean

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
Capture.JPG
0 Kudos
Adventurer
Adventurer
2,011 Views
Registered: ‎02-09-2017

Re: Error in running SW_EM program in commandline mode.

Jump to solution

Hi Seanz,

Thanks for your help. I checked the run configurations. It turns out the settings are correct. Hereby the screen shot FYI.

 

Btw, I ran this project with SDAccel GUI on nimblix platform. meanwhile, I created a new template project with Matrix

Meanwhile, I created a new template project with Matrix mulitplication(C) in SDAccel GUI mode with all defaulting settings. It compiles and runs correctly for both sw_emu and hw_emu. 

 

 

What else could be the problem?

 

thx

 

Capture.PNG

0 Kudos
Adventurer
Adventurer
1,978 Views
Registered: ‎02-09-2017

Re: Error in running SW_EM program in commandline mode.

Jump to solution

@evant thanks for your help.

 

I still have the problem to run the program in commandline mode. But I have some progress.

The error with loading shared libraries: libxilinxopencl.so has been fixed by following your suggest.

 

Now the problem is that the binary kernel seems not to be loaded correctly. The host program was executed normally. But the application executable failed in loading the binary kernel.

 

As mentioned in you post, "There should be a xclbin folder generated alongside your <program_name>.exe"

It appears that file names and folders created by SDAccel GUI mode and the makeflow illustrated in UG1240 are quite different. In SDAccel GUI mode, there is no xclbin folder generated. I manually created a xclbin folder, and copied .xclbin file into it. When I ran the .exe, the application failed in finding the kernel.

 

Please help me out.

 

0 Kudos