05-09-2017 11:05 AM
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:
Plz help me out
05-16-2017 03:25 PM - edited 05-16-2017 03:26 PM
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.
05-16-2017 03:41 PM
It should be under something like:
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.
05-16-2017 03:53 PM
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?
05-16-2017 04:13 PM - edited 05-16-2017 04:15 PM
Depends how your makefile is setup.
Using one of the examples from the github, the make file might call the following:
Which in the opencl.mk has the lines:
# Definition of include file locations
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>_CXXFLAGS=-I./src/ $(xcl_CXXFLAGS) $(opencl_CXXFLAGS)
05-17-2017 08:17 AM
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?
05-17-2017 03:32 PM - edited 05-17-2017 03:34 PM
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/
~/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:
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
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!
06-09-2017 11:41 AM - edited 06-09-2017 04:52 PM
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?
06-11-2017 07:50 PM
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:
06-12-2017 10:10 AM - edited 06-12-2017 10:29 AM
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?
06-15-2017 12:01 PM
@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.