cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
dikshantbisht
Visitor
Visitor
4,576 Views
Registered: ‎01-08-2020

Fatal Error: No such file or directory for most of #include in cpp

After follwing Vitis-AI installation guide, when I'm trying to run build file, for any of the demo or samples, it's throwing error. 

follwing are the errors 

test_accuracy_yolov3_bdd.cpp:18:10: fatal error: opencv2/opencv.hpp: No such file or directory
#include <opencv2/opencv.hpp>

test_jpeg_yolov3.cpp:16:10: fatal error: glog/logging.h: No such file or directory
#include <glog/logging.h>

test_performance_yolov3.cpp:16:10: fatal error: xilinx/ai/benchmark.hpp: No such file or directory
#include <xilinx/ai/benchmark.hpp>
^~~~~~~~~~~~~~~~~~~~~~~~~

1231.png
0 Kudos
21 Replies
jheaton
Xilinx Employee
Xilinx Employee
4,537 Views
Registered: ‎03-21-2008

It sounds to me like the Vitis-AI Libraries were not intsalled. You need to that as well as te Vitis AI Tools.

https://github.com/Xilinx/Vitis-AI/tree/master/Vitis-AI-Library

0 Kudos
dikshantbisht
Visitor
Visitor
4,505 Views
Registered: ‎01-08-2020

The main issue is coming when I'm running  "sh -x build.sh" command.

I have downloaded Vitis-Ai Library, and vitis-ai runtime image, but when I'm inside workspace the build command is throwing below fatal error. I'm not able to go past this step.

Tags (1)
Screenshot from 2020-01-23 09-51-39.png
0 Kudos
jheaton
Xilinx Employee
Xilinx Employee
4,224 Views
Registered: ‎03-21-2008

This might be a docker issue.

I see you are running as sudo, but can you run docker without sudo?

docker run hello-world

 

If not, then you need to perform this additional configuration: https://docs.docker.com/install/linux/linux-postinstall/

0 Kudos
dikshantbisht
Visitor
Visitor
4,200 Views
Registered: ‎01-08-2020

Screenshot 2020-01-25 at 5.38.30 PM.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Actually I already did those things, and I'm able to run hello-world command without sudo.

I'm not sure what i'm missing. 

0 Kudos
miner_tom
Adventurer
Adventurer
4,069 Views
Registered: ‎10-04-2018

I am having the same issue as in https://forums.xilinx.com/t5/AI-and-Vitis-AI/Fatal-Error-No-such-file-or-directory-for-most-of-include-in-cpp/td-p/1067022 

I am running Ubuntu 18.04, a clean install, just for this purpose. I have attempted to make this post as clear and as succinct as possible.

There are a few other things that I suspect concern an improper docker install to begin with.

First, in the directions to install the "vitis-ai-runtime image" at this site https://github.com/Xilinx/Vitis-AI/tree/master/Vitis-AI-Library  At 

Setting Up the Host
Download the vitis-ai-docker-runtime image

I get only a page with "ERROR 404 Page not found" when I click on the link. So that link on that page is dead.

I had to go to the following page https://hub.docker.com/r/xilinx/vitis-ai and do "docker pull -a xilinx/vitis-ai. This seemed to work. The "-a" is necessary.

I made sure that I had configured docker properly for my user and can run "docker run hello-world" with non sudo.

I ran into some issues here https://github.com/Xilinx/Vitis-AI/blob/master/doc/install_docker/load_run_docker.md 

# GPU Image must be built by user. 

cd Vitis-AI/docker
./docker_build.sh

# After the GPU image is built, load it

./docker_run.sh xilinx/vitis-ai:tools-<x.y.z>-gpu

# i.e.

cd Vitis-AI
./docker_run.sh xilinx/vitis-ai:tools-1.0.0-gpu

My ./docker_build.sh failed, with some very cryptic error, that I could not begin to decode.

However, 

./docker_run.sh xilinx/vitis-ai:tools-1.0.0-cpu
and
./docker_run.sh xilinx/vitis-ai:runtime-1.0.0-cpu

Actually ran without error.

Where I suspect things went wrong is in the UG1354 users guide.

After the docker image is installed, the cross compiler tools are stored in /opt/vitis_ai/
petalinux_sdk/.

After installation there IS NO /opt/vitis_ai/petalinux_sdk. I think that might be also the problem that I was having with "./docker_run.sh xilinx/vitis-ai:tools-1.0.0-gpu" because the error, several lines long, did start out with 

 ERROR: Command errored out with exit status 1:
     command: /opt/vitis_ai/conda/envs/vitis-ai-caffe/bin/python

As far as I can tell, there is no /opt/vitis_ai/conda/envs/vitis-ai-caffe/bin/python directory that I can find.

And, of course, going into the samples/yolo3v directory and doing a ./build.sh I get

test_accuracy_classification.cpp:19:10: fatal error: opencv2/core.hpp: No such file or directory
 #include <opencv2/core.hpp>
          ^~~~~~~~~~~~~~~~~~
compilation terminated.
test_accuracy_classification_squeezenet.cpp:21:10: fatal error: opencv2/core.hpp: No such file or directory
 #include <opencv2/core.hpp>
          ^~~~~~~~~~~~~~~~~~
compilation terminated.
test_jpeg_classification.cpp:19:10: fatal error: opencv2/core.hpp: No such file or directory
 #include <opencv2/core.hpp>
          ^~~~~~~~~~~~~~~~~~
compilation terminated.
test_jpeg_classification_squeezenet.cpp:20:10: fatal error: opencv2/core.hpp: No such file or directory
 #include <opencv2/core.hpp>
          ^~~~~~~~~~~~~~~~~~
compilation terminated.
test_performance_classification.cpp:16:10: fatal error: xilinx/ai/benchmark.hpp: No such file or directory
 #include <xilinx/ai/benchmark.hpp>
          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
test_performance_classification_squeezenet.cpp:19:10: fatal error: xilinx/ai/benchmark.hpp: No such file or directory
 #include <xilinx/ai/benchmark.hpp>
          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
test_video_classification.cpp:19:10: fatal error: opencv2/core.hpp: No such file or directory
 #include <opencv2/core.hpp>
          ^~~~~~~~~~~~~~~~~~

I am hoping that there is some solution.

Thank You

Tom

 

 

 

jheaton
Xilinx Employee
Xilinx Employee
4,045 Views
Registered: ‎03-21-2008

@Tom

Are you running the cpu run time docker container when looking for /opt/viits_ai/petalinux_sdk ?

Try running the docker container first, i.e. <path to Vitis AI>/docker_run.sh /xilinx/vitis-ai:runtime-1.0.0-cpu

You should see somthing like this:

Capture.PNG

 

miner_tom
Adventurer
Adventurer
4,030 Views
Registered: ‎10-04-2018

@jheaton 

Thank you for your reply. Getting very close here.

I did as you recommended below, as in, "docker_run.sh xilinx/vitis-ai:runtime-1.0.0-cpu". I got the results below, and yes, after running the container, I was able to see the workspace directory with the other directories shown in your post. So far so good.

Then from UG1354:

4. Using Git, clone the corresponding AI Library from https://github.com/Xilinx/Vitis-AI.
$cd /workspace
$git clone https://github.com/Xilinx/Vitis-AI.git

I did that successfully, but under sudo, otherwise it would not work.

I ran into some familiar difficulty with the following next step.

$cd /workspace/Vitis-AI/Vitis-AI-Library/demo/demo_yolov3
$sh -x build.sh

Running the above without sudo resulted in a permission denied error. I expect that since the files are owned by root. I think that is because I had to do the git clone https://github.com/Xilinx/Vitis-AI.git as sudo. Otherwise it would not work.

Running the above as sudo resulted in the familiar "no such file or directory" error.

 sudo ./build.sh
demo_yolov3.cpp:16:10: fatal error: glog/logging.h: No such file or directory
 #include <glog/logging.h>
          ^~~~~~~~~~~~~~~~
compilation terminated.

I tried logging in as root but that resulted in another error.

I know that I am close.

Thank You again.

Tom

0 Kudos
jheaton
Xilinx Employee
Xilinx Employee
4,018 Views
Registered: ‎03-21-2008

If I understand correctly, it sounds like you cloned the repo, from within the docker container. I dont think you want to do that.

Just clone the repo first outside of docker, and then start the container.

 

0 Kudos
miner_tom
Adventurer
Adventurer
4,002 Views
Registered: ‎10-04-2018

@jheaton 

Jim, than you again.

Doesn't the direction that you suggested to me contradict the UG1354?

4. Using Git, clone the corresponding AI Library from https://github.com/Xilinx/Vitis-AI.
$cd /workspace
$git clone https://github.com/Xilinx/Vitis-AI.git

The above implies that since that the git clone operaiton should be done in the /workspace directory, which does not exist unless the docker is running.

However the readme.md in the Vitis-AI directory says what you implied:

    * Clone the Vitis-AI repository to obtain the examples, reference code, and scripts. ``` git clone https://github.com/Xilinx/Vitis-AI
       cd Vitis-AI ```
     * Install Docker - if Docker not installed on your machine yet
     * Ensure your linux user is in the group docker
     * Load&Run Docker Container

I started from scratch, and deleted the Vitis-AI directory. I used the git clone and installed Vitis-AI at /.

git clone https://github.com/Xilinx/Vitis-AI.git
cd Vitis-AI
./docker_run.sh xilinx/vitis-ai:runtime-1.0.0-cpu
/workspace
cd Vitis-AI-Library
cd demo
cd yolov3
ls
-rw-r--r-- 1 root root  228 Jan 29 05:14 build.sh
-rw-r--r-- 1 root root 4455 Jan 29 05:14 demo_yolov3.cpp
-rw-r--r-- 1 root root  978 Jan 29 05:14 readme
sh build.sh
/opt/vitis_ai/petalinux_sdk/sysroots/x86_64-petalinux-linux/usr/libexec/aarch64-xilinx-linux/gcc/aarch64-xilinx-linux/8.2.0/real-ld: cannot open output file demo_yolov3: Permission denied


Using sudo did not work either.

As always, I am greatful for your assistance.

Tom

 

 

0 Kudos
dikshantbisht
Visitor
Visitor
3,886 Views
Registered: ‎01-08-2020

Has anyone solved this issue yet?

0 Kudos
miner_tom
Adventurer
Adventurer
3,872 Views
Registered: ‎10-04-2018

@dikshantbisht @jheaton 

No, I have not solved the issue. I have gone through every permutation that I can think of in loading docker, the docker image and Vitis-AI but nothing worked. My experiments are documented in previous posts.

I am still waiting patiently for someone that knows what is going on to provide a suggestion. If I had to guess, I think that since the software is so new, that there is a revision in process. At least, I hope that there is.

Tom

 

0 Kudos
jheaton
Xilinx Employee
Xilinx Employee
3,837 Views
Registered: ‎03-21-2008

@minor_tom

We have not seen this before. It is obvisously some kind of permisson issue.

One thing I notice is that the files are owned by root. Did you launch the docker shell under sudo?

Or were you running as root when you cloned the repo?

Here is what I see for the same files. 

Capture.PNG

miner_tom
Adventurer
Adventurer
3,797 Views
Registered: ‎10-04-2018

@jheaton

Jim, as always, I am completely grateful for your suggestions. Really.

I believe that I am coming close to some understanding. Close.

My permissions are the same as yours, so that does not look like the problem.

-rw-r--r-- 1 tom vitis-ai-users  228 Feb  5 15:09 build.sh
-rw-r--r-- 1 tom vitis-ai-users 4455 Feb  5 15:09 demo_yolov3.cpp
-rw-r--r-- 1 tom vitis-ai-users  978 Feb  5 15:09 readme

However, the error that I get when I run sudo bash build.sh (yes I have to run that as sudo) is suspicious.

demo_yolov3.cpp:21:10: fatal error: opencv2/core.hpp: No such file or directory
 #include <opencv2/core.hpp>
          ^~~~~~~~~~~~~~~~~~

Of course, the workspace environment knows nothing of opencv and I don't know why I thought that it would. I have opencv4 installed, but not in the workspace environment. When not under the workspace environment I run opencv4 by

Python 3.6.9 (default, Nov  7 2019, 10:44:02) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> 

But, I can't even invoke python in the workspace environment.

Does this mean that I will need to do a fresh install of opencv  and python, etc, in the workspace environment? When I exit the workspace environment, would all that I installed be lost?

Thank You again.

Tom

 

0 Kudos
jheaton
Xilinx Employee
Xilinx Employee
3,792 Views
Registered: ‎03-21-2008

The fact that you have to run as sudo indicates an issue with docker permissions. 

If the following does not work without sudo:

docker run hello-world 

Then you need to do the following post docker installation steps: https://docs.docker.com/install/linux/linux-postinstall/

I dont know if this is causing your exact issue, but I do know that having to run as sudo will break running the vitis ai tools docker container. 

miner_tom
Adventurer
Adventurer
3,779 Views
Registered: ‎10-04-2018

@jheaton 

Thank you again.

My mistake about having to run ./build.sh in sudo. I don't.

Also, docker DOES run with "docker run hello-world".

But as my latest question from above, do I need to install opencv within the workspace?

Tom

 

 

0 Kudos
jheaton
Xilinx Employee
Xilinx Employee
3,775 Views
Registered: ‎03-21-2008

No, you shouldn't need to import opencv. 

But you are not running the docker shell as sudo correct? :

./docker_run.sh xilinx/vitis-ai:runtime-1.0.0-cpu

 

miner_tom
Adventurer
Adventurer
3,755 Views
Registered: ‎10-04-2018

@jheatonyou are indeed a genius. My problems were related to privileges all along. For some reason, after I ironed out the privileges I somehow was invoking the wrong docker shell. Your post reply showed me that.

It can't be stressed enough that everything needs to be done as a usr that is not root.

Thank You

Tom

 

0 Kudos
dikshantbisht
Visitor
Visitor
3,743 Views
Registered: ‎01-08-2020

@miner_tom  Can you please explain a little bit in detail what was the issue and how you resolved it ?

 

Thanks

Dikshant

0 Kudos
miner_tom
Adventurer
Adventurer
3,694 Views
Registered: ‎10-04-2018

@dikshantbisht 

Dikshant, There are a couple of things in the documentation that could be emphasized a bit better, and I am not 100% sure that everything is working correctly. For example, I was able to get this tools container docker shell running : "vitis-ai:runtime:1.0.0-cpu", but not "xilinx/vitis-ai:1.0.0-cpu" or "vitis-ai:runtime-1.0.0-gpu". But, be that as it may, the runtime tools container was sufficient for me to be able to compile the sample yolov3.

I am going to recommend that you document your install proceedures, so that you can go back and check the order in which things are loaded. I believe that the process is more dependent upon the order in which things are loaded than the instructions would have you believe. At least, it helped me.

What I did was, from a clean install of ubuntu 18.04, I made sure that everything WRT Vitis AI that I git cloned or installed was done without running sudo (root). In my original install, which failed, there must have been something in the install directory that required me to do a sudo. Once that happens, I think that "it's over".

I found that the instructions in here https://github.com/Xilinx/Vitis-AI  are a bit clearer than those in UG1414.

Clone the Vitis-AI repository to obtain the examples, reference code, and scripts.

git clone https://github.com/Xilinx/Vitis-AI  

cd Vitis-AI

Install Docker - if Docker not installed on your machine yet

Ensure your linux user is in the group docker

Load&Run Docker Container

Yes, docker must be running, which you can verify with "docker run hello-world". And, you must be able to run it as a user other than root.

I think that

newgrp docker 

Can be used to start it up in a terminal shell where it is not running.

Also, you have to download the proper docker shell. I did find the xilinx docker shells here https://hub.docker.com/u/xilinx  and there are two of them listed. When doing a "docker pull" I find that it helps to do a "docker pull -a" (for all) or the shell might not be found.

There is a very subtle error that I found in the pdf documentation in UG1414.

./docker_run.sh xilinx/vitis-ai:runtime:1.0.0-cpu

The above has an error. After the "runtime" there is a ":" and this should be a "-".

Should be

./docker_run.sh xilinx/vitis-ai:runtime-1.0.0-cpu

I then was able to go into samples and do

sh -x build.sh

There is some good information "hidden" here https://github.com/Xilinx/Vitis-AI/tree/master/Vitis-AI-Library where setting up the target is described a bit clearer. I have not done that yet but will soon.

I hope that this helps.

Tom

 

 

 

YilinChen
Visitor
Visitor
1,950 Views
Registered: ‎10-31-2020

Hi, my friend

I found a problem happened when I run "bash -x build.sh" for the demo of yolov3, the screenshot is just like this:

Screenshot from 2020-10-31 22-01-46.png

I think my docker is ok because I can run it without sudo

Screenshot from 2020-10-31 22-08-12.png

The steps I followed for running the demo of yolov3 is based on ug1354 and my hardware is U50 board card

Screenshot from 2020-10-31 22-12-15.png

is there has anyone who can provide some suggestions for this problem, thanks a lot

 

0 Kudos
YilinChen
Visitor
Visitor
1,877 Views
Registered: ‎10-31-2020

Hi, Jheaton

Could you help me to take a look about the problem I mentioned above, that problem hanged over me for a long time, thanks a lot!

0 Kudos