Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mobaxterm issue #10

Open
MaRcOsss1 opened this issue Jul 25, 2024 · 18 comments
Open

Mobaxterm issue #10

MaRcOsss1 opened this issue Jul 25, 2024 · 18 comments

Comments

@MaRcOsss1
Copy link

MaRcOsss1 commented Jul 25, 2024

image

Why am I seeing this?

Also when I tried to login it showed this:
image

though after entering the password I was on this window:
image

root@pynqz2_dpu1:~# ls
install.sh  pkgs  samples
root@pynqz2_dpu1:~# cd zynq7020_dnndk_v3.1
-sh: cd: zynq7020_dnndk_v3.1: No such file or directory
root@pynqz2_dpu1:~# ./install.sh
-sh: ./install.sh: Permission denied
@andre1araujo
Copy link
Owner

andre1araujo commented Jul 25, 2024

Hi!
It looks like the SD card image you are using does not include the DNNDK drivers. The zynq7020_dnndk_v3.1 folder contained them but I don't see that folder on there. You can dowload it here on this google drive. Then drag the folder to the left side of mobaXterm and it should be there ready to be accessed.
If the permission is denied use the chmod +x zynq7020_dnndk_v3.1 command and try again.
Good luck!

P.S.: I mentioned on the tutorial that you might need to insert the password "root" twice as mobaXterm for some reason doesn't identify it the first time.

@MaRcOsss1
Copy link
Author

okay I did that

image

this seems alright right? should I ignore /etc/modules: No such file or directory ?

@andre1araujo
Copy link
Owner

I am not sure. Ignore it for now and see if it does not pop up on a later stage.
In any case I really don't think it will be a problem.

@MaRcOsss1
Copy link
Author

MaRcOsss1 commented Jul 25, 2024

image

UMM, how do I install it?

root@pynqz2_dpu1:~# cd yolo_pynqz2
root@pynqz2_dpu1:~/yolo_pynqz2# make
make: Warning: File 'Makefile' has modification time 1200 s in the future
g++ -c -O2 -Wall -Wpointer-arith -std=c++11 -ffast-math -mcpu=cortex-a9 -mfloat-abi=hard -mfpu=neon programs/yolo_image.cpp -o objects/yolo_image.o
make: g++: **Command not found**
make: *** [Makefile:40: objects/yolo_image.o] **Error 127**

@MaRcOsss1
Copy link
Author

So I have looked for every possible solution I could find, I even downloaded the plugin from mobaxterm official website
image

and placed it in the right folder:
image

The development.mxt3 is the plugin file for GCC and G++, but its still not working

@andre1araujo
Copy link
Owner

Look, the problem seems to be that you don't have the correct SD card image. Try to use the one I made available as it already has all the necessary libraries.
gcc should be one of those packages and so, as it is not present there, it means the SD car image is not correct.
Download it here and then flash it on the micro SD card.
Good luck!

@MaRcOsss1
Copy link
Author

MaRcOsss1 commented Jul 26, 2024 via email

@andre1araujo
Copy link
Owner

Thank you! I also added you on the end of the github page as a thank you for your help on this project!
About the way I did this project, it was based on wutianze's work. I was assigned to do this project and after months, I found his work and tried to replicate it. For someone with basically no experience as me, I had contact him on some parts, had to trie to look for other simillar implementations and so on. What I am basically saying is that even I don't fully understand the flow haha.
In general, it goes like this:

  • We first implement the hardware called DPU. This is a Intellectual Property (IP) core from Xilinx that can basically implement any type of CNN on the FPGA part of the board. We do this part in Vivado so we place the DPU and connect it to the Processing System (PL) which has the CPU of the PYNQ-Z2 and make other connections. We basically describe how the hardware should be layed out on the FPGA so that we can later use the DPU to make inference on any neural network we want.
  • Then the Petalinux only serves as a way to create a SD card image so when we insert the micro SD card on the board, it constructs the Hardware we designed previously. It creates the DPU and the connections. The SD card image also contains Linux so we can use c++ programs and access the DPU the way Xilinx desired.
  • We have the board ready to deploy any neural network we desire but to deploy for example YOLO, we have to use the Xilinx tool DNNDK. This tool is equivalent to the Vitis AI of today but an older version. Whith this tool, we select a neural network, quantize it and the create a file that later comunicates with the DPU and tells it how to arrange for deploying our desirde neural network.
  • Finally we just insert the neural network file on the board Linux environment, add a c++ script that uses the DPU libraries and we can make inference with our model.

Sorry for the long explanation. Both the approaches you linked use soemething called HLS which is High Level Synthesis. I never went on that area but what I think it is, is basically program the FPGA using High Level code like c++. So, you create a c++ program for a neural network you want and then point some parts where the program can be parallel, just like multithreading. This approach is not typically as optimized as programming in VHDL or Verilog your own neural network but surelly is a lot easier and faster. Their process is not as different as mine as it might seem:

  • They design the neural network they want using HLS language. This allows them to create a IP block like the DPU but this one only implements one neural network.
  • Then they connect their IP block to the board PS so it communicates with the CPU. Normally this is done for shceduling the communication between data channels and so on. It also is necessary so they can send images from the PS to the FPGA, where the IP is present.
  • I am not sure about the next step but they might use Petalinux to use a Linux OS so they can control the CPU better. Using a c++ script like on my project is easier to send images to the IP block.

I think the process of using HLS is a broad area of its own and might be really complicated. I don't have that experience so I can't tell for sure. But the process is a little different than what I did but kind of the same on some points haha.
The DPU solution from Xilinx seems to be the easiest for unexperienced people like me. It is generally a lot more easy on other boards with Zynq Ultrascale+ chips because now Vitis AI and DPU are a lot more optimized and easier to use. The challenge for the PYNQ-Z2 and other zynq-7000 familly chips is that Vitis AI and the DPU are no longer supported for them and that is why I used DNNDK which was a older version.
My masters degree thesys might be to create a better and more accessible solution for these boards as they seem to be forgotten by Xilinx on the CNN acceleration. My approach will not be HLS but RTL. RTL includes more specific languages like VHDL and Verilog. Essentially do the same as what the people on the paper did with HLS but more optimized. But we will see,

Sorry about the long text but I hope you understand a little bit the different approaches. There are no good (accessible) solutions for deploying object detection in real time on these boards yet.

Good luck!

@MaRcOsss1
Copy link
Author

MaRcOsss1 commented Jul 26, 2024 via email

@andre1araujo
Copy link
Owner

Don't worry, you helped me validate the instructions of the tutorial and that is really helpfull.
I didn't know you had some experience with HLS but that is good to know because I might disturb you one day with that haha.
Yes, I meant writting the neural network in RTL. Seems like a suicide mission but lets try haha. There are lots of work on this field and I will try to implement the most used architectures and see where it goes. I didn't finish the research but it seems that the CNN accelerators follow all some simillar architectures. Because Xilinx never broght the DPU back to the Zynq-7000 chip, I am going to try and make a object detector with newer optimization techniques to see if I can achieve some decent real time performance on this low cost board.

@MaRcOsss1
Copy link
Author

MaRcOsss1 commented Jul 26, 2024 via email

@andre1araujo
Copy link
Owner

The optimization techniques normally used to compress neural networks is quantization and prunning. DNNDK did not use prunning. They explicitly said it was not supported on that version. I suspect they now use prunning on Vitis AI.
There are some frameworks for accelerating neural networks on the Zynq-7000 chips like FINN from xilinx or Brevitas also from Xilinx. They are more easy to work with but I suspect the results will be slighly worse. But we never know!

About the numbers above the boxes on the detections, it represents the accuracy of the detection. 0,99 is 99% accuracy.
I hope this helps!

@MaRcOsss1
Copy link
Author

MaRcOsss1 commented Aug 9, 2024 via email

@andre1araujo
Copy link
Owner

Hello Aryan.
No, that is not normal behaviour at all. The image shuld work evry time.
I don't see why that problem is happening, but I might suspect that due to poor description in the tutorial, you are not executing these commands each time you power up the board:

cd zynq7020_dnndk_v3.1
./install.sh

If that is the case let me know. If you already did those commands every time you restart the board and the problem pressists let me know so we can try to figure out the problem.
Good luck!

@MaRcOsss1
Copy link
Author

MaRcOsss1 commented Aug 9, 2024 via email

@andre1araujo
Copy link
Owner

That is really strange. I never saw that behaviour before.
Can you confirm that the green DONE LED lights up? It probably is something wrong with the SD card image. Can you try it with a different micro SD card?
If you see what LEDs light when the board crahses, it may help identify the cause. I will have to look it up.

@MaRcOsss1
Copy link
Author

MaRcOsss1 commented Aug 10, 2024 via email

@andre1araujo
Copy link
Owner

Hi!
Sorry for the late response.
That zynq7020_dnndk_v3.1 folder comes from the DNNDK package you downloaded for the second chapter of the tutorial. It should contain a folder related to the devices and one of them is the "ZedBoard". I used that folder because that board has the same chip as the PYNQ-Z2. Then I renamed the folder to "zynq7020_dnndk_v3.1". That contains the libraries for DNNDK.
The problem you have might be related to something on the process of the SD card image build or the problem you mentioned on this issue.
I can try to look that up but it will be easier for you to make experiments.
Sorry about that. I will try to think about the problem as soon as i can and then I make a suggestion.
Good luck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants