# docker qt xcb 問題 在docker中執行會開啟qt界面的程式發現以下報錯: ``` qt.qpa.plugin: Could not find the Qt platform plugin "offscreen" in "/opt/conda/lib/python3.8/site-packages/cv2/qt/plugins" 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. Aborted (core dumped) ``` ## 解法 * 先退出容器 * 執行`xhost +` * 進入容器後即可執行 * 我的docker-compose.yaml檔: ```yaml= services: itri-bev: stdin_open: true tty: true devices: - /dev/dri group_add: - video volumes: - /tmp/.X11-unix:/tmp/.X11-unix - ./:/src deploy: resources: reservations: devices: - driver: nvidia count: all capabilities: - gpu environment: - DISPLAY=$DISPLAY - QT_X11_NO_MITSHM=1 - NVIDIA_VISIBLE_DEVICES=all - NVIDIA_DRIVER_CAPABILITIES=all container_name: itri-bev-container build: . image: frakw/itri-bev:x64 command: /bin/bash ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up