Xilinx / Vitis-AI

Vitis AI is Xilinx’s development stack for AI inference on Xilinx hardware platforms, including both edge devices and Alveo cards.
https://www.xilinx.com/ai
Apache License 2.0
1.47k stars 630 forks source link

Segmentation fault error running vart.Runner.create_runner in python script (Ubuntu 22.04) #1163

Closed mmarquez999 closed 1 year ago

mmarquez999 commented 1 year ago

Hi,

I'm trying to execute a python script inside a Docker container with image Ubuntu 22.04, on a ZCU102 board with Petalinux. The Docker image has installed the packages vitis-ai-library and vitis-ai-runtime and I'm able to import successfully the vart and xir modules in Python.

However, when the code reaches the line where I call the _vart.Runner.createrunner() method, it exists with Segmentation Fault (core dumped) error, without further explanation. The xmodel that the method receives has been compiled in vitis-ai 2.0, which matches the version of the vitis-ai-library and vitis-ai-runtime packages in the container.

Is there anything that I'm missing??

Thanks in advance for your support!

qianglin-xlnx commented 1 year ago

Hi @mmarquez999 We don't try to run docker container on ZCU102 board. Can you use xdputil tool to check the dpu information and run a basic model ? It's just to check the environment is ok.

mmarquez999 commented 1 year ago

Hi @qianglin-xlnx

I tried to run the xdputil query and xdputil status commands directly on the ZCU102 board (on Petalinux) and then inside the Ubuntu Docker container running on the board. The first one was successfully but the execution inside the container was not. As you can see below, we get another "Segmentation fault (core dumped)" error.

root@f833092d31f2:/vart# xdputil status /usr/bin/xdputil: line 20: 30 Segmentation fault (core dumped) /usr/bin/python3 -m xdputil $*

root@f833092d31f2:/vart# xdputil query /usr/bin/xdputil: line 20: 32 Segmentation fault (core dumped) /usr/bin/python3 -m xdputil $*

root@f833092d31f2:/vart# show_dpu Segmentation fault (core dumped)

I guess that the docker container does not have access to the DPU configuration located at the Petalinux host of the board.

It seems that what I'm missing is how to give access to the docker container to the DPU drivers of the board. Would it make sense to mount the corresponding directories located at the board into the container so it could get the drivers and configurations from there? And in that case, what directories shoul I bring into the container?

Thanks for your help!!

xihuazhanghui commented 1 year ago

The edge (ZCU102) board did not support run in docker container.

mmarquez999 commented 1 year ago

Hello @xihuazhanghui,

The ZCU102 does actually support running docker containers on it: as you can read above, I'm already running them without any problem. The issue here is how to use the DPU resource from inside, since it does not seem to be able to access it.

qianglin-xlnx commented 1 year ago

This is not the use case that zcu102 to support.

mmarquez999 commented 1 year ago

Just in case someone is trying to do the same, I managed to finally make it work.