容器内启动GUI界面相关问题。
在容器内做AI模型推理,想查看下可视化结果,x11转发什么的都设置好了,可是涉及到画面显示的时候,就一直在报QT的相关问题
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/usr/local/lib/python3.8/dist-packages/cv2/qt/plugins" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.Available platform plugins are: xcb.
最终解决方案
apt-get install x11-apps#验证界面是否正常
xclock
附录:
容器设置:
#!/bin/bashxhost +local:root;docker run --name "xx-vision" \
--gpus all \-it \--network host \--ipc=host \-e DISPLAY=$DISPLAY \-v /dev/shm:/dev/shm \-v /tmp/.X11-unix:/tmp/.X11-unix \-v /home:/home \my_tensorrt:1.1